Triggered Block Group - Db to PLC

Presumably this is allowed: I’d like to send a block of data from the db to the PLC (in an array) on a trigger (again a db field). I set it up, and it looks like it’s allowed however when the trigger goes true, I get an error:

WARN Tried to write a value with bad quality to item ‘DieNumbers[0]’.

This error is repeated for each tag in each group (two block groups of 20 each or 40 total).

However, in the designer it shows a valid PLC value for the above item. Is what I’m trying possible and if so, what am I doing wrong? I’m attaching the XML for that group. Thanks
TestBlockGroup.xml (6.17 KB)

Yes, it’s definitely allowed. Looks like your group is setup incorrectly in the “Table Action” section- it’s set to “insert new block”- but it should be one of the other options, so the group knows how to look up the rows to write.

The error message isn’t too useful, but basically it’s saying “I don’t have good data to write”. I’ll make a ticket to make this situation a little more user friendly.

Regards,

OK, I got the blocks to transfer using Update/Select and Custom WHERE clause: “LineIndex=6”
However I have two problems:

  1. Data transfered to PLC is ‘backwards.’ row 0 to PLC element 19
  2. I can’t seem to make a resettable trigger. My trigger resides in another table. I’ve tried a SQL Expression which reads the trigger but does not reset it. I’ve also tried setting up a SqlTag the reads the db field. The problem with that is I get the error:

ERROR Write to SQLTag [[KanbanProvider]PlcDownloadTrigger_L05] failed with code [StatusCode[Severity=Bad, Subcode=Bad_NotWritable, 0x803B0000]] - Tag does not support writing. Thu May 12 12:41:34 CDT 2011 0

When the trigger goes true. I also noticed for that SqlTag’s diagnostics I get the message: Scan class not specified or does not exist. (It is and it does). It does read the tag fine though.

One note: I only have the Bridge license currently is that a factor?

Thanks
TestBlockGroup.xml (6.92 KB)

The group selects the data ordered by the index- is it possible that the data is ordered according to something else in the way you’re writing it?

Try this: open the DB Browser and run this query:

SELECT * FROM PartData WHERE LineIndex=6 ORDER BY partdata_ndx ASC

Does it appear to be in the correct order, or reversed?

As for resetting the trigger, it’s not possible to write to an expression/query tag. Instead, you’ll need to make a “triggered” item in the table that runs an update query:

UPDATE PartDataDownloadCommands SET ToPlcCmd = 0 WHERE LineIndex = 6

As long as the item is set to respect the trigger, it will only execute once the group has actually run.

Of course, in your latest XML file, you have a PLC trigger- which should work and be resettable, if you want to trigger that way.

Hope this helps,

Your right (of course) setting the Custom Index Option to an appropriate column works. I was thinking that applied to writes only but I guess not.

On trigger resets: I made a triggered tag that does the update query as suggested, works like a charm. It’s a little misleading (for me anyway) that that tag shows as “read only” even though it’s performing an UPDATE operation.

Thanks for your help

Glad you got it sorted out. Yeah, “read-only” is a tad misleading, what it really should be is “No Binding” or something like that, in that it’s not bound to a column or tag.