node-red: how to send commands, like booting motion, or move axis?

I was trying to send

msg.payload='{"type":"string","value":"Booting"}';

to a "data layer request" node with "WRITE" method, to "motion/cmd/opstate", like in REST method, but to no avail - gives me error "CtrlxProblemError: DL_TYPE_MISMATCH". Does structure of request and destination differs from REST method (and how)?

 

Best reply by CodeShepherd

You mentioned two things.

First is switching to booting/running. You have to send a CREATE to the node "motion/cmd/opstate" not a WRITE with this payload:

EDIT:

 

var newMsg = {};
newMsg.payload = {
     "type":"string",
     "value":"Configuration"
     };
return newMsg;

 

 Second sending a movement command via CREATE to "motion/axs/AxisX/cmd/pos-abs":

 

var newMsg = {};
newMsg.payload = {
      "type":"object",
      "value":{
	    "axsPos":"10","buffered":false,"lim":{"vel":"10","acc":"10","dec":"10","jrkAcc":"0","jrkDec":"0"}
	    }
     }
return newMsg;

 

View original
problem.png
62.52KB
4 replies