Can't write a value to a Controller via modbus due to failure on state sending

Hi all, how are you?.

I'm trying to write a value to a genset controller via node red by using the modbs flex write function but I can't. Every time I try to do so the modbus flex write node sends the following error

Modbus Failure On State sending Get More About It By Logging

then the debug node sends the following

topic: "99cfbb88159119eb"
messageId: "6362fb8185457da10c74d944"
payload: object
value: 35701
unitid: 10
fc: 6
address: 4104
quantity: 1
messageId: "6362fb8185457da10c74d944"
queueLengthByUnitId: object
unitId: 10
queueLength: 0
queueUnitId: 10
unitId: 10
error: object
message: "[object Object]"
source: object
id: "99cfbb88159119eb"
type: "modbus-flex-write"
name: ""
count: 1
_msgid: "46049664d1227872"

the error object appears to be empty and of course I don't kow why.

in addition to that, the code that sets the payload in the function node previous to the modbus flex write node is the following

var u_id = 10;
var fc = 6;
var sa = 4104;
var addresses = 1;
var value = 35701;
msg.payload = { "value": value, 'fc': fc, 'unitid': u_id, 'address': sa, 'quantity': addresses };
return msg;

the code was copied and modified from the page

Now, in the status area of the node can be seen the status changing from connected to queueing to timeout to initialize to connected again every time the modbus flex write node is triggered.

In the same flow I have a modbus getter node to read the voltage source of the device and this works without problems when triggered.

The only thing that I can think right now is that the address where I'm trying to write is unavailable or the code that I'm sending is not available to since that code is supposed to be a code to change the working mode of the controller to manual.

So, how can I solve this problem?

Thanks in advance for the help.

Problem solved, just I didn't send the second part of the command I needed. Once done the system worked very well

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