Modbustcp write fc15

Hi,

I'm trying to switch a simple on/off by modbustcp write but is imposible...

I can read prefectly array from plc (Arduino, with mudbus.h library)

but I can't write, always recived error about is not an array.

ko_01

I need the funcion F15, the F5 doesn't work, with modbus test app F15 works fine

Thanks

ko_02
aurduino

For FC 5, msg.payload must be a value of 1 or 0 or true or false
For FC 15, msg.payload must be an array[] of comma separated values true or false

Put a debug node AFTER the switch node - what are you feeding into the modbus node?


EDIT

Just realised the node icons in your screenshot are different to mine - you might be using a different set of modbus nodes to me (it is always a good idea to provide a link or the full name of the contrib node you are using (to save everyone some time)). My info above ↑ us using node-red-contrib-modbus

This is my node, I know about array, but I don't know how do it

How to do what? How many coils do you want to set, and what value(s) do you need to write?

I only need one coil, with value 1/0

What comes out of the switch node? (Add a debug node and post screenshot)

Also post a screenshot of the config of the switch node.

(You will have to indulge me as I am not at a computer and can't check for myself)

switch_02

Does the "on" and "off" payload permit you to enter JSON? if so then choose that& enter value [1] or [0]

Hi,

Finally is work correctly, I change my node modbustcp and I installed the modbus node like you.

Thanks

1 Like