ModbusFlexGetter - Override unitid

Hi !
I'm having issues to override the value of the unitid in the ModbusFlexGetter node using the function node.

Here is my flow :

[{"id":"2dec2833.200ce","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"20c38ef2.180982","type":"inject","z":"2dec2833.200ce","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":120,"wires":[["3411cd12.0d4662"]]},{"id":"3411cd12.0d4662","type":"function","z":"2dec2833.200ce","name":"","func":" msg.payload = \n {\n 'fc': 3,\n 'unitid': 14,\n 'address': 164,\n 'quantity': 1\n };\n return msg;","outputs":1,"noerr":0,"x":280,"y":120,"wires":[["e6f95e2c.4859e8"]]},{"id":"e6f95e2c.4859e8","type":"modbus-flex-getter","z":"2dec2833.200ce","name":"","showStatusActivities":false,"showErrors":false,"logIOActivities":false,"server":"e3663c5a.c8ea4","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":450,"y":120,"wires":[["b814c14b.23a188"],]},{"id":"b814c14b.23a188","type":"modbus-response","z":"2dec2833.200ce","name":"","registerShowMax":20,"x":670,"y":120,"wires":},{"id":"e3663c5a.c8ea4","type":"modbus-client","z":"","name":"","clienttype":"serial","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"2","serialParity":"none","serialConnectionDelay":"100","unit_id":"10","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]

I thought it was possible but is it really ?
Or what do I do wrong ?

Thanks !!
Nico

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