Looking for possible solutions for a timing issue I am having.
memory tags - SQL parameters for SQL tag
SQL tag - grabs data at fixed rate from DB1 (results are constantly changing but query parameters are constant unless changed by trigger event)
Data tags - couple simple expression tags reformat some of that data from the SQL tag with data from other ignition tags
DB ref tags - couple of memory tags that get updated with references that gateway timer script uses to enter data into DB2
gateway timer script - grabs data at a high rate from Data tags and inserts into DB2 based on the DB ref tags
Trigger event - from operator input changes the memory tags so the SQL tag has new parameters and sets new values for the DB ref tags.
My issue appears to be in the timing that one the trigger event occurs the timer script can trigger after the DB ref tags are updated by the trigger event but before the SQL tag refreshes so that I end up with results from old SQL tag data into DB2 so I need to make sure that after a trigger event occurs that the gateway timer script doesn't run till after the SQL tag does an update.
what I have done is made
(A) Memory tag DateTime - set by tag change script on the SQL tag
(B) Memory tag DateTime - set by tag change script on DB ref tags
(C) Expression tag - if time A > time B
then set timer script to not run unless (C) is true
I think this should work and testing now but wondering if I am making this harder then it should / could be. Other solutions?