Trigger behavior in 8.3

Hello,

I made an observation in 8.3 that I’d like to discuss with you. I’m reading one value of hundreds small devices using Ignition — many via Modbus/TCP, but some via a PLC as well. I want to write the value to a database every 5 minutes, regardless of whether the value has changed. To do this, I have a trigger item that triggers a driven tag group to read the data.

At the same time, the trigger item triggers a script that runs asynchronously (system.util.invokeAsynchronous). This script waits (sleeps) for 30 seconds and then writes all the values to the database. This isn’t ideal, but I have to wait until the values have actually arrived. And since I always want to write all values regardless of whether there’s been a change, I haven’t found any other way to do it. There is no value transmitted trigger for a retransmission without change.

This has always worked surprisingly well. The database always contained all the values. However, since the update to 8.3, I’ve been getting sporadic gaps. Do you have any idea what might have changed in 8.3?

Consider not using a trigger, but instead use a gateway scheduled event script. In that script (not using system.util.invokeAsynchronous()), use system.tag.readBlocking(...) to gather all the current values from tags with ordinary subscriptions (significantly faster than 5min), and use system.opc.readValues() to explicitly read fresh values from OPC items that aren't otherwise subscribed. (No driven tag group. Not a great choice in either v8.1 or v8.3.)

The script would then push the new samples to the DB with system.db.runPrepUpdate() or system.db.runSFPrepUpdate().

The script itself should be in a function in a project library script module. The event would have just a one-line call to the project library function. The constants defining the SQL necessary and the lists of tag paths and OPC item paths should be outside the function.

3 Likes