Help with Modbus write

Greetings. I can retrieve via FC 4: Read Input Registers the Actual and Setpoint values from my Modbus RTU enabled temperature controller. Now I want to try to write the setpoint using FC 6.

Both flows are attached. I do not get any errors or output from the Write flow.

[{"id":"d6f6bf810ef3e905","type":"modbus-read","z":"f20b61e62e9f6292","name":"temperature","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"showWarnings":true,"unitid":"1","dataType":"InputRegister","adr":"123","quantity":"15","rate":"60","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"a1b3011ddb70921d","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":130,"y":100,"wires":[["065484719b48680c"],[]]},{"id":"065484719b48680c","type":"buffer-parser","z":"f20b61e62e9f6292","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int16be","name":"MB30123","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"int16be","name":"MB30137","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":false,"outputs":1,"x":330,"y":100,"wires":[["5ef94a4ed46ae1ff"]]},{"id":"5ef94a4ed46ae1ff","type":"function","z":"f20b61e62e9f6292","name":"","func":"msg.payload = [\n    [{\n        temperature: msg.payload.MB30123\n    },\n    {\n        MeasType:\"actual\",\n        EquipNumber:\"217\"\n    }],\n    [{\n        temperature: msg.payload.MB30137\n    },\n    {\n        MeasType:\"setpoint\",\n        EquipNumber:\"217\"\n    }]\n];\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":100,"wires":[["efa94b00a95071e5"]]},{"id":"efa94b00a95071e5","type":"debug","z":"f20b61e62e9f6292","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":700,"y":40,"wires":[]},{"id":"392812d56cb9a378","type":"function","z":"f20b61e62e9f6292","name":"function 2","func":"msg.payload = {\n    'value': msg.payload,\n    'fc': 6,\n    'unitid': 20,\n    'address': 137,\n    'quantity': 1\n}\n\nreturn msg","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":300,"y":160,"wires":[["aceb431c7c9e1380"]]},{"id":"aceb431c7c9e1380","type":"modbus-flex-write","z":"f20b61e62e9f6292","name":"","showStatusActivities":false,"showErrors":false,"showWarnings":true,"server":"a1b3011ddb70921d","emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"","x":510,"y":160,"wires":[["44b975de9deda924"],[]]},{"id":"b75a776cc0b033dc","type":"inject","z":"f20b61e62e9f6292","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"99","payloadType":"num","x":90,"y":160,"wires":[["392812d56cb9a378"]]},{"id":"44b975de9deda924","type":"debug","z":"f20b61e62e9f6292","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":760,"y":160,"wires":[]},{"id":"a1b3011ddb70921d","type":"modbus-client","name":"USB0","clienttype":"serial","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"failureLogEnabled":true,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"500","serialAsciiResponseStartDelimiter":"0x3A","unit_id":"","commandDelay":1,"clientTimeout":8000,"reconnectOnTimeout":true,"reconnectTimeout":5000,"parallelUnitIdsAllowed":false,"showErrors":true,"showWarnings":true,"showLogs":true}]

In my flow, I am attemping to write the value 99 via FC 6. The slave address of the device is 20 and the address for the setpoint is 137.

msg.payload = {
    'value': msg.payload,
    'fc': 6,
    'unitid': 20,
    'address': 137,
    'quantity': 1
}

return msg

The doc for this controller is here (unfortunately little or no Modbus info) and a sister product (with much more Modbus info) is here. Thanks in advance for any help here. I have done this successfully with Allen Bradley VFDs but that has not worked with this controller.

You should enable errors in the nodes config

Looking at that manual, it seems to be linked to the prior register. Try setting both.

Thank you @Steve-Mcl

I had overlooked this in the manual....

To get it working, I send this via one flow (note that I had to use FC 5):

msg.payload = {
    'value': msg.payload,
    'fc': 5,
    'unitid': 20,
    'address': 218,
    'quantity': 1
}

return msg

and then this within 3 seconds of enabling Modbus bit 218 (note FC 6 and also as @Steve-Mcl pointed out, I had to use address 138 instead of 137)

msg.payload = {
    'value': msg.payload,
    'fc': 6,
    'unitid': 20,
    'address': 138,
    'quantity': 1
}

return msg