I need to get the top 5 items in a MS SQL database table (descending order) and looking for the best way to accomplish this in Ignition. I have a table that is collecting data for a production line and need to get the top 5 names and times for those stations. It is very likely to have less than 5 with greater than zero, so I will ignore zero values.
table:
index, int
station, nvarchar(50)
time, int
What would the best method of getting this data be, transaction group or gateway script, or something else?
This would be a gateway script. I have a table that is tracking current downtime and I need to show a chart with the top 5 downtime locations and the total time they were down, all that is included in a current status table.
If you need the data in a chart then you do not need the data in the gateway, you need it in a runtime client because charts are in clients. More specifically you need the data in a client window, in a chart.
Perhaps what you should do is write a database query for a SQL Query binding on the “DB Pens” property on an Easy Chart in an Ignition window. Or do the same thing on the “Data” property of a Chart or Bar Chart component.