FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
04-22-2021 08:36 AM
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.
04-22-2021 08:55 AM - edited 04-22-2021 08:55 AM
This is about sending complex data objects to the ctrlX Data Layer. Please refer to this topic where the mechanism is explained.
04-22-2021 09:20 AM
Ok. I think, I made code right like in a post. But something wrong still, error persists.
04-22-2021 09:46 AM - edited 04-22-2021 04:17 PM
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;
04-22-2021 10:28 AM
Indeed, using CREATE method solved the problem!
Thank you, very much!