FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important
information on the platform change.
06-03-2024 10:30 PM
Hi all,
Just setting up an application on the CtrlX for the first time, and I'm running into this issue:
For some reasono it seems to me that the CtrlX DatalayerRequest node only works if I give it impropper JSON. The flow in the snippet bellow should demonstrate what I'm talking about. (Also find flow JSOn attached - change the .txt to .json to import back into node red.)
The first inject node send invalid json which the CtrlX node accepts and sets the corresponding digital output
The second inject node which sends valid json does not get accepted by the Ctrlx node, but is valid json as shown by the debug node.
Any ideas here? THanks!
Also, the input to the CtrlX request node seems pretty counter intuitive to me. I feel like I should be able to just set the inject node as follows and have it write to the PLC bit on the path. but this doesn't work.
THanks!
Solved! Go to Solution.
06-03-2024 10:41 PM
06-04-2024 09:47 AM
You are right, that the JSON needs to be valid but also it needs to have the correct format. Please have a look to the examples on GitHub and also included in the ctrlX OS - Node RED app.
06-04-2024 02:05 PM
I'm still not quite clear, I don't think you've adressed my question.
The Ctrlx WRITE node has an option to accept value only as shown here (the configuration of the first node with invalid JSON)
But this invalid JSON works, and does set the datalayer tag.
The first example in my flow, clearly shows that an invalid json does activate the output on the Ctrlx datalayer, but is NOT a valid JSON. And the following three examples of valid JSON do not write correctly to the datalayer.
Thus my confusion, why does the CtrlX expect INVALID json?
Thank you!
06-04-2024 03:39 PM
Your problem is also described in the troubleshooting documentation on GitHub. For the write method you always need to use the "value + type (json)" format to get it working properly.
06-04-2024 04:56 PM
Hello @CodeShepherd , thank you for the prompt replies, and I really appologize if I came accross a little upset. I'm just under a real time crunch for this project and trying to get socket communication setup between a UR20 and node red, and that was the last piece of the puzzle!
Thanks a million!