I am trying to write the results of a SQL query into PLC tags based on the value of a trigger tag changing.
This is being used in a batch process and I am logging additions of each batch to a table in the DB. When the operator switches between batches the batch number is being changed in the PLC. When this happens I want to query the DB to sum the total of batches to that point in the process. The reason for this is there are multiple batches being worked on at the same station
I have a working query in the query browser that is returning a single row of totals that I want to use. Where I am failing is how to write those values to a set of tags in the PLC.