I've just setup my first transaction group and I was able to setup trigger to work correctly when a PLC tag changes state from 0 to 1. I've noticed when I query the table the transaction group is tied to, I'm sometimes missing data. Essentially I'm trying to capture batch information on a report when a batch completes. Each time a batch completes, the batch id increments up one. I've noticed in the table I'm missing anywhere from 1 to 5 batch id's and then I'll get 5-10 in a row without missing any.
The PLC tag = 1 for roughly 10 minutes at a time and then = 0 for 3-4 minutes before the next batch completes. So I don't believe it's a timing issue. I thought that something was happening with the trigger but as I've been monitoring the process I just noticed that it's showing the transaction group triggered but a new row wasn't added to the table:
18:41 is missing but shows as the last time it was triggered. I'm unsure if this is always the case or if sometimes the trigger is missed, but I'll keep monitoring to see.
Assuming the transaction group is triggering correctly and consistently, what could be preventing the data from being added to the table?
Transaction groups are the right tool for this (unless you need fancy handshaking, then you need a script), but must be configured correctly both in the PLC and in Ignition.
Use OPC Items, not Ignition tags, for everything except the trigger. (Optional for the trigger.)
Set the group to use OPC "Read" mode instead of "Subscribed" mode. This causes just the trigger to be subscribed, and everything else will be read after the trigger fires.
Ensure that the PLC trigger is the Last piece of information changed in the PLC tags for each batch.
I'm very new to ignition but I believe everything in the transaction group is an OPC Item. All of the tags are under Basic OPC/ Group Items.
I did not change the mode so, it was set to Subscribed. I just changed it to Read so I'll see if that helps. But if it's showing it triggered, would that still potentially prevent the data from being stored in the table? I would expect that if it triggered, the data would be stored.
The trigger is last. I was having trouble with the correct data being pulled timing-wise when the batch completed so I added a two second delay timer for the trigger yesterday. Since there's an A and B batch, one queues up while the other is "batching" I actually added tags for all the ingredients to move the A and B ingredients to one tag for each ingredient when the respect batch completes. That way I can use just one tag in Ignition for both batches. The Batch Complete tag I'm using for the Ignition trigger is delayed by 2 seconds after the data is moved
That's not clear. If you selected from Ignition's Tag Browser, it isn't an OPC Item. You must select or drag and drop from Ignition's OPC Browser to end up with a direct OPC item.
Try each and compare how the details for each show up.
Changing to Read seems to have helped. Every batch was recorded last night but one was out of order. I went back and looked at the ones I previously thought were missing and it looks like the same thing happened.
For some reason batch 10,411 was added to the table much later than it actually triggered. I have a dropdown listing the batch id's that when selected, pulls up the batch report in a viewer. Any thoughts on what's causing the row to be added at the wrong time? Or would it be just how the table is being organized? And if so, how can I go about organizing it so the batch id's are in ascending order?
Is your transaction group sending inserts through the Store and Forward system? You might also be experiencing scattered DB faults that S&F corrects with later retries.
You probably should inspect your database's own log files. (Possibly configuring the DB to log with more verbosity.)
If there should only ever be one row per batch ID, then consider making that your primary key (and omitting the auto-generated ID column).
I checked off the Bypass Store and Forward system in the Advanced options and it doesn't seem to have helped.
I looked at logs and didn't see anything directly related to the Transaction Group. But it's the first time I've looked through the logs so I may be missing something.
I'm not entirely sure I understand the auto generated ID column. If that's the "Use custom index column" under the Action tab, I'm not using that for the dropdown. But the column is default to "batching5_ndx" and it's also out of order.