plcpeople / nodepccc

Library for node.js to communicate with some Allen-Bradley programmable controllers (PLCs)
MIT License
81 stars 24 forks source link

String support #12

Closed srebling closed 7 years ago

srebling commented 8 years ago

Trying to read a string and getting error:

[509683,693316634] Unknown data type when figuring out bad value - should never happen. Should have been caught earlier. STRING

ST9:0 CompactLogix - File Number 9 Mapped to tag ST9 (Data type: STRING[5])

plcpeople commented 7 years ago

CompactLogix PLCs do not seem to support reading of ST values using the PCCC protocol.

You can add a variable, say "INTSTRING" defined as type INT[88] and then add a rung in your logic to "COP MYSTRING[0] INTSTRING[0] 88". Then you can map INTSTRING to file 9, and nodePCCC will be able to read/write the string if you map it as NST9:0 (or NST9:0,5 if you have 88*5=440 array elements). You can COP it back over the string as needed with suitable logic. It's clunky but it works and seems to be the best possible workaround.

At some point we hope to write a CIP driver that will read and write strings natively from the tag, without file mapping. Until then, this should work for you, please re-open the issue if you have difficulty.

srebling commented 5 years ago

Can only read the first three strings with this method. All subsequent strings return empty string ("").

plcpeople commented 5 years ago

Please try this again with 0.1.10, many issues were found and fixed to do with arrays.