0
votes

I'm developing a program in node-red that gets tags from a database and should then "write" the value of them on a connected plc, but some tags are not passed due to this error "TypeError: Cannot read property 'ODP' of undefined" the script inside the node that from error is the following :

"msg.payload = {"value":[''+msg.payload[0].ODP+'']}; return msg;"

the tags are : OPD (string[30]) , DATA(string[10] , QUANT_INIZIALE DINT , QUANT_PROD DINT

enter image description here

1

1 Answers

1
votes

The error implies that your input msg.payload to the function node is not an array.

It is not possible to see in the image you have posted, exactly which node the error is happening on, but if you attach a debug node before point you should be able to see what the input message looks like.