Changing the state of the master ETHERCAT from Node-RED

Good morning, I have a problem changing the state of the ETHERCAT master from INIT to OP in Node-RED. I was able to update its state directly from the CORE by writing a JSON with the following structure: {"request": {"newState": "op"}} and by using HTTP went OK too, but when try to modify it from Node-RED, it gives me the following error: CtrlxProblemError: DL_TYPE_MISMATCH. I have tried the methods WRITE and CREATE  in the data layer request node, at the path fieldbuses/ethercat/master/instances/ethercatmaster/admin/fieldbus_status/master_state, but both give me the same error. The JSON structure sent by the payload is the same as the one I write at the CORE. I have attached several photos of how everything is configured. How can I modify this value with data layer request node?  Thank you so much!

what I recived from debugs

how i did the connection
the structure from the JSON

 

 

Best reply by CodeShepherd

A "Write" must be used and the "Payload" switched to "value + type (json)". Then send following payload:

 

msg.payload ={"type": "object", "value": {"request": {"newState": "op"}} }
return msg;

 

See all my standard examples on github. Or see also this thread for another complex example.

View original
2 replies