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)?
Solved! Go to Solution.
This is about sending complex data objects to the ctrlX Data Layer. Please refer to this topic where the mechanism is explained.
Ok. I think, I made code right like in a post. But something wrong still, error persists.
function code
data layer node parameters
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;
Indeed, using CREATE method solved the problem!
Thank you, very much!