Hi!
Trying to find an optimal solution for following:
There are some OPC tags that by default change their values at the same time:
dateTime
partCode
partQuality
The idea is to insert the data as a new row in DB on each dateTime tag value change, but first it is necessary to give each new partCode an unique ID, which must be used for inserting to parts_history table.
Knowing that it takes time to write to DB it seems that the main issue is the delay which does not allow to run needed Named Queries in a row (presenting them as a short list just for the overview):
- INSERT INTO parts
- SELECT id FROM parts
- INSERT INTO parts_history
What options are available in this case?
For example having a Query tag for partID to run on value change script for "3rd Named Query" is not ideal solution since it may cause problems if same partCode comes consecutively.
Important to note, that these tags are used in UDT and system overall performance should be affected as little as possible.
Any help or suggestions for a proper approach would be greatly appreciated!