# NodeRED, Network Variables and CC100

**URL:** <https://www.wago.community/t/nodered-network-variables-and-cc100/242>\
**Category:** Node-RED\
**Tags:** codesys, cc100\
**Created:** [September 6, 2022, 12:45pm UTC](https://www.wago.community/t/nodered-network-variables-and-cc100/242 "2022-09-06T12:45:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ragren](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@Ragren](https://www.wago.community/u/Ragren)\
**Post date:** [September 6, 2022, 12:45pm UTC](https://www.wago.community/t/nodered-network-variables-and-cc100/242/1 "2022-09-06T12:45:36Z")

</div>

Hello

Trying to send some values from NodeRED to CODESYS through network variables and have followed this tutorial: [Using Node-RED with Network Variables - YouTube](https://www.youtube.com/watch?v=NNqeP3N1j7E)

I want to send from NodeRED running on the same PLC that will recieve the values.

I have changed the list identifier to 3 and the names of the tags in the NVL export before importing it again.

Recieving is no problem, however I don’t get the sending to function properly. The ID-number in the netvar-sender block i NR must correspond to what is seen in the NVL reciever struct in Codesys if I have understood this correct, according to the tutorial the ID number should be 2970419.

But this variable is 0 when I look it up in Codesys.  
Device.Application.NetVar\_Application\_GVL.NetVarManager\_UDP\_MainTask\_0.dwIdentity

When I try to inject the netvar-send I get this error  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/1X/efb7b2979e2d737516077c3fc0488b229b25edfe.png)

I have started NodeRED with this command

```auto
docker run --restart unless-stopped -d --name node-red --network=host --security-opt seccomp:unconfined -v node_red_user_data:/data nodered/node-red:latest-minimal --log-opt max-size=10m --log-opt max-file=5

```

---

<div class="post-metadata">

**Author:** ![WagoKurt](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/wagokurt/32/11_2.png) [@WagoKurt](https://www.wago.community/u/WagoKurt)\
**Post date:** [September 6, 2022, 2:39pm UTC](https://www.wago.community/t/nodered-network-variables-and-cc100/242/2 "2022-09-06T14:39:33Z")

</div>

Hello,  
Please see this discussion on similar topic.

> [@WAGO-PFC UDP Port Network-variables](https://www.wago.community/t/wago-pfc-udp-port-network-variables/201):
>
> Hello i am running node-red under docker and the UDP netvar receiver variable works fine on the port 1202, the netvar sender port is configured for the port 1400. When i run "docker ps " command on a ssh terminal the output is below: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d8372f9ae59a nodered/node-red:2.2.2 “npm --no-update…

Can you confirm you are using two different ports for send & recieve?

---

<div class="post-metadata">

**Author:** ![Ragren](https://avatars.discourse-cdn.com/v4/letter/r/71e660/32.png) [@Ragren](https://www.wago.community/u/Ragren)\
**Post date:** [September 6, 2022, 4:01pm UTC](https://www.wago.community/t/nodered-network-variables-and-cc100/242/3 "2022-09-06T16:01:54Z")

</div>

No, I hade the same port-number on send and recieve. Tried to change it to 1400 but no change, but I get another error:

![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/1X/ffa6051337aa3c519fcff570a49b21c9de32ad5d.png)

I have setup like this now:

![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/1X/c3b66b9e86b9f67f5fbabc08f090fe7147ec3486.png)

IP-adress is the PLCs IP

![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/1X/7cdf6f3cd34a8c5a08f093f1ee72834a446d84f8.png)

In Codesys in the NVL sender GVL. These values were default 0 and port 1202. But this seems to be the port for sending data?

 ![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/1X/34bfb06404ae32277e838dfa7d3ffdf3698228d5.png)

---

<div class="post-metadata">

**Author:** ![quenorha](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/quenorha/32/429_2.png) [@quenorha](https://www.wago.community/u/quenorha)\
**Post date:** [September 7, 2022, 5:52am UTC](https://www.wago.community/t/nodered-network-variables-and-cc100/242/4 "2022-09-07T05:52:46Z")

</div>

Maybe try to run `netstat -tulpn` to see if another service is using port 1400 ?  
And also `docker ps -a`, maybe you have a somehow a remaining old Node-red container using the same port ?

---

<div class="post-metadata">

**Author:** ![WagoKurt](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/wagokurt/32/11_2.png) [@WagoKurt](https://www.wago.community/u/WagoKurt)\
**Post date:** [September 7, 2022, 1:46pm UTC](https://www.wago.community/t/nodered-network-variables-and-cc100/242/5 "2022-09-07T13:46:57Z")

</div>

During development, I have found that when changing ports in NR and Codesys, it is often necessary to reboot the PFC to fully close the old ports and open the new ones. It might start working after a reboot.

---

<div class="post-metadata">

**Author:** ![WagoDamRud](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/wagodamrud/32/258_2.png) [@WagoDamRud](https://www.wago.community/u/WagoDamRud)\
**Post date:** [September 16, 2022, 11:00am UTC](https://www.wago.community/t/nodered-network-variables-and-cc100/242/6 "2022-09-16T11:00:01Z")

</div>

there is another parser **node-red-contrib-nvl** that is much easier to use. You just need to type list id and paste NVL content.
