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-15-2023 09:34 AM
Hello Community,
I have SFK project with Ctrlx, I need to change the loaded program on SFK via Node-Red, i try to inject the program ID, but it doesn't work. is there any idea to change the SFK loaded program Via Node red?
Solved! Go to Solution.
06-15-2023 10:38 AM
As I cannot see which path you are using it is hard to say if it should work or not.
I tested using the path "smartfunctionkit/communication/cmd/changeprogram" and posted my project ID. This works like expected.
Same should be fine at your side as it seems that sfk4h is connected via OPC UA client app to a ctrlX CORE and you try to use ctrlX CORE - Node-Red app to access the OPC UA data via the data layer.
06-12-2024 08:50 AM
This works on the ctrlx data layer screen. But the question is different. How do I control this with a node red? I want to choose a program in the smart function kit with a node red.
06-12-2024 09:52 AM
As Node-RED is accessing the data layer, just send the corresponding project ID, like mentioned above, to the path "smartfunctionkit/communication/cmd/changeprogram".
See Node-RED example code:
[{"id":"17a3602f8f96374c","type":"ctrlx-datalayer-request","z":"a4ae14cc47a2173c","device":"2739e1940fb53718","method":"WRITE","path":"smartfunctionkit/communication/cmd/changeprogram","payloadFormat":"value_type","name":"","x":900,"y":280,"wires":[[]]},{"id":"6a87077de3d35b10","type":"inject","z":"a4ae14cc47a2173c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":400,"y":280,"wires":[["10bf744b5b089955"]]},{"id":"10bf744b5b089955","type":"function","z":"a4ae14cc47a2173c","name":"","func":"var newMsg = {}\nnewMsg.payload = { \"type\": \"string\", \"value\": \"ea073ff6-181d-4fa9-9de2-5b65f4226cd6\" }\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":280,"wires":[["17a3602f8f96374c"]]},{"id":"2739e1940fb53718","type":"ctrlx-config","name":"boschrexroth","hostname":"localhost","debug":false}]
For further examples you can have a look to the node-red-contrib-ctrlx-automation pallette on github. It is also included in the ctrlX OS - Node-RED app.