How to read CIP -plc tag in which count of consequent elements is more than 1

I have connected Allen-Bradely Control logix 1756-EN3TR/B PLC with node-red-contrib-cip-ethernet-ip module where i am trying to reading String value named Recipe from plc which is having tag Recipe_Name.DATA . I am able to read data but now only one word. How can we set element count more than one . I want to read array of 39 element. and then i will use function and use below code to to have in readable format.

def charArray = Recipe
StringBuilder builder = new StringBuilder(charArray.size())
charArray.forEach { ch -> if (ch !== null) builder.append((char) ch) }
return builder.toString()

Currently i am able to read only 1st char.

Any help in this regard will help to devloped production dashboard automation.

I can’t help with the PLC stuff - plenty here who can..

But Node RED is JavaScript NOT Java , so that code won’t work.

2 different languages entirely

1 Like

You could try reading strings using the beta version: node-red-contrib-cip-st-ethernet-ip (node) - Node-RED

Alternatively, follow the advice by another user: Support of string datatype · Issue #17 · st-one-io/node-red-contrib-cip-ethernet-ip · GitHub

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.