cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

Changing Loaded program on Smart Function Kit via node-red

Changing Loaded program on Smart Function Kit via node-red

ahmadzakirhanif
New Poster

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?

3 REPLIES 3

CodeShepherd
Community Moderator
Community Moderator

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.

ctrlX CORE data layer viewer sfk4h changeprogramctrlX CORE data layer viewer sfk4h changeprogram

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.

yudas_0-1718174992061.png

yudas_1-1718175021284.pngyudas_2-1718175038338.png

 

CodeShepherd
Community Moderator
Community Moderator

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.

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist