I’m doing a screen that switch information every 15 sekund.
I have an array of struct in my PLC with 4 values (string, string, string, int). The array can be quite long so i have done it so that every time there is a status change, the PLC the code runs the code to update the values.
The array are then stored in a dataset in Ignition.
My plan is now that i want to show 5 row at the time on a power table. To do this I have tried to saved the five rows from stopDataSet to newData behind a timer. But for some reason I gett the hole stopDataSet-1.
Is there some function in Ignition where I can pick which rows to copy to my new dataset?
import math #number of instances from the PLC, rows that will fill the dataset. nrOfInstances=system.tag.read("[default]OPCServer/LineSpecials/fullScreenTB/nrOfInstances").value #formula to keep track of the number of screens that will be shown, 5 rows per screen nrOfPages=math.ceil(float(nrOfInstances)/5) #loop nr Screens for pageNr in range(1, int(nrOfPages)+1): #formula for what row in the dataset that we will start copy from func=(pageNr-1)*5 newData= #loop 5 times sinces one screens shows 5 rows for stopIndex in range(5): row=stopIndex+func #copy to new dataset, should only copy 5 rows newData=system.dataset.deleteRow(event.source.parent.stopDataSet, row) #put newData to power table event.source.parent.getComponent('Power Table').data=newData