I need help! The system.opc.read is giving me unreliable results.
I am trying to pull an array of characters from the PLC.
Here is the siemens datablock: (the highlighted row is wrong, its the one above it)
I am trying to get an array of characters from the PLC in this command:
Here is that sub function:
When I pass the box 4 times, I get the following messages. The green is the correct shipping label and the red messed up shipping label.
I have tried so many methods to pull this string( you can see some of the commented out methods) I am sure that my datablock and offsets are set correctly and I confirmed that the PLC is getting the correct string. The only thing is that the system.opc.readValue is not consistently returning the same value.
I even tried adding sleep functions in various places hoping it was some asynchronous read issue, but it doesn't seem to make a difference.
At this point, I want to blame the Siemens Driver, but I figured that I would at the very least post in the forum to see if someone else can catch something I am missing.
Are there any known issues with the siemens driver that may produce unreliable reads?