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

**URL:** <https://discourse.nodered.org/t/how-to-read-cip-plc-tag-in-which-count-of-consequent-elements-is-more-than-1/83275>\
**Category:** Industrial\
**Created:** [29 November 2023 07:55 UTC](https://discourse.nodered.org/t/how-to-read-cip-plc-tag-in-which-count-of-consequent-elements-is-more-than-1/83275 "2023-11-29T07:55:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joseeviral](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@joseeviral](https://discourse.nodered.org/u/joseeviral)\
**Post date:** [29 November 2023 07:55 UTC](https://discourse.nodered.org/t/how-to-read-cip-plc-tag-in-which-count-of-consequent-elements-is-more-than-1/83275/1 "2023-11-29T07:55:12Z")

</div>

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.

```auto
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.

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [29 November 2023 08:00 UTC](https://discourse.nodered.org/t/how-to-read-cip-plc-tag-in-which-count-of-consequent-elements-is-more-than-1/83275/2 "2023-11-29T08:00:17Z")

</div>

> [@joseeviral](#):
>
> and then i will use function and use below code to to have in readable format.

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

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [29 November 2023 10:13 UTC](https://discourse.nodered.org/t/how-to-read-cip-plc-tag-in-which-count-of-consequent-elements-is-more-than-1/83275/3 "2023-11-29T10:13:16Z")

</div>

You could try reading strings using the beta version: [node-red-contrib-cip-st-ethernet-ip (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-cip-st-ethernet-ip/in/5fYnLUcjL77U)

Alternatively, follow the advice by another user: [Support of string datatype · Issue #17 · st-one-io/node-red-contrib-cip-ethernet-ip · GitHub](https://github.com/st-one-io/node-red-contrib-cip-ethernet-ip/issues/17#issuecomment-593988547)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [28 January 2024 10:13 UTC](https://discourse.nodered.org/t/how-to-read-cip-plc-tag-in-which-count-of-consequent-elements-is-more-than-1/83275/4 "2024-01-28T10:13:54Z")

</div>

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