Modbus Flex Connector: Error Payload not Valid - connector Type

image

Created with change node json:
image

I don't understand where's the problem. It's just like the documentation example, but replacing single quotes that are not valid on json.

Hello .. not exactly .. in the help docs of the Flex Connector node the examples are for a Function node.
You have used a Change node, which is still fine, but you constructed a payload object inside of msg.payload (msg.payload.payload) as i can see from the screenshot.

sidenote: the single quotes would have worked if you do for example:
msg.payload = { 'connectorType': 'TCP', 'tcpHost': '127.0.0.1', 'unitId': 2 } return msg
because in Function node payload is a Javascript object and single quotes are allowed there.
In Change node you use JSON and needs double quotes.

1 Like

DOH! Your absolutely right.... :flushed: :scream: