Good Afternoon,
I have a question that is a continuant off of my previous post (Pull Rate of Ignition), but a little more in depth on coding.
We are implementing the queue on a Keyence Data Collector and giving Ignition access to the data, along with the ability to control the out pointer. We are only really wanting to get a row at a time and not the whole queue. However, I believe that the way we are doing it, grabs the whole queue first. And then gets the row from it.
These are the kind of steps:
values = system.opc.readValues(server, paths)
outPtr = int(values[3].value)
rowData = str(values[4].value[outPtr].strip())
Would we have to just have the PLC only send the row. Or is there another way in Ignition scripting that allows for us to only grab the row?
What is the path you are reading?
the paths contain the variables that exist on the Keyence that are being used here. It contains the in pointer path, the queue path, the out pointer path, a queue size path.
The rowData line is what I'm asking about because it seems to pull the whole queue and then I use the outpointer to get the row that I want. However, I just want to pull one row, not the whole queue. I was just wondering if there was a way to do this in Ignition Scripting where you can connect directly to the queue and only pull the necessary row.
He's asking about the path because you're getting this variable from an OPC Server, and whether you can get a "row" or the whole queue value depends entirely on whether that server allows access to a single row via some alternate NodeId (OPC Item Path).
Sometimes you can guess the right syntax, if it's supported. e.g. if you have a path of FooArray
then it's a good guess that FooArray[0]
might give you access to just the 0th element.
3 Likes
"=urn:_______:PLC:OpcUaServer;s=Queue[0]", So, you would be able to do something like the above. Have the row selection be on the path?
If supported by the Server.
2 Likes
Alright. It seems to not be supported with what we are doing.
Instead we have worked it out to where instead of getting the Queue, we get the RowData (current row of the queue) and the RowIndex sent over. We validate that the data we are reading is correct based on the Out Pointer and the Row Index.
This made our processing one row of data go from me being able to see the process running for a full second due to reading a 14,000 row table to not being able to see the process run due to the speed with only one row of data is being pulled at a time.
Hopefully, this helps someone else going down the same path.
1 Like