Tag values from SQL Table

We have a project where data is coming in for a particular set of devices from a SQL table (the devices themselves write the data into the database table) which is read-only for SCADA.

What is the most efficient way to get this data into tags in Ignition for use in templates and other components? There will be 21 tags per device, and 3 devices (63 tags altogether):

  1. a query tag for each data point, each querying the SQL table for the data they’re looking at (63 queries per x seconds - probably 10s, not sure yet update rate)
  2. a single query performed in a script (gateway event or gateway tag change) and then script writes to the device memory tags
  3. something else

To me from a performance and efficiency point of view, I would choose the 2nd option. It’s not as simple to roll out.
Am I right in my choice?

I would say that if you create a UDT that each device is an instance of, you could use the 2nd option with a rather dynamic tag writing script that just writes to a certain instance based off a “device name” column in your dataset.

That would be the most efficient query wise, and a rather simple script to write after the execution of the named query.

I would also pick option 2.

Out of curiosity, are the devices writing to separate tables, or to the same one?

To the same one. Same type of devices

Yep, One query, and separate them out through scripting.

2 Likes