S7Comm node Output operation

Hello,

I am taking data from Siemens PLC into node-red using the S7comm node.

Reading operation performs perfectly, but not able to write getting error as you can in the screenshot.

Yellow highlight - For Read Operation
Red Highlight - For Write Operation

Br,
Devendra Songra

Hello

Can u share more details? what are trying to write? boolean ? db ?

Hello,

I am trying to write Boolean data for output.

Br,
Devendra

Hello,

As below error, I am getting while trying to perform a write operation.

Please find node red flow

[{"id":"fc79ac05.92266","type":"inject","z":"9fae712c.a0866","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":110,"y":94,"wires":[["ba050d00.316df"]]},{"id":"ba050d00.316df","type":"s7comm write","z":"9fae712c.a0866","connection":"22bb055a.e4e8fa","payload":"{\"S7_Type\":\"Q\",\"S7_DBnum\":\"0\",\"S7_Datatype\":\"X\",\"S7_Offset\":\"33\",\"S7_BitOffset\":\"1\",\"S7_Quantity\":\"1\",\"S7_Name\":\"Out\"}","s7Name":"Out","topic":"","name":"","signalSetted":false,"x":360,"y":94,"wires":[["dc07eade.836518"]]},{"id":"dc07eade.836518","type":"debug","z":"9fae712c.a0866","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.value","targetType":"msg","statusVal":"","statusType":"auto","x":670,"y":94,"wires":[]},{"id":"22bb055a.e4e8fa","type":"s7comm","ip":"192.168.2.1","port":"102","rack":"0","slot":"2","payload":[{"S7_Type":"Q","S7_DBnum":"0","S7_Datatype":"X","S7_Offset":"33","S7_BitOffset":"1","S7_Quantity":"1","S7_Name":"Out"},{"S7_Type":"I","S7_DBnum":"0","S7_Datatype":"B","S7_Offset":"34","S7_BitOffset":"1","S7_Quantity":"1","S7_Name":"In"}]}]

Br,
Devendra Songra

Admin edit, use correct formatting for forum

Can you copy the flow again? There is some error apparently.

Anyway, from the documentation it looks like the payload you want to write must be formatted in a precise way; take a look here:

1 Like

Thanks, MountainKing91 for your support, issue is resolved.

For Writing, I have used the below formats in inject node and the issue is resolved.

for boolean value: {"value":[true]}
for single value: {"value":[1]}
for array value: {"value":[1,2,3]}
for Character value:{"value":["S"]}
for string value:{"value":["Simatic"]}

Br,
Devendra

1 Like

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