I am adding on to the my previous post regarding Node Red, OPC DA and CtrlX (link to previous post: https://developer.community.boschrexroth.com/t5/ctrlX-IOT/Node-Red-node-for-OPC-DA-CtrlX/m-p/53187)
I was able to successfully install OPC DA pallette in Node Red and read PLC data from an MTX system. The output of the OPC DA node is in JSON format. Sample output message is shown in the attached pic (Sample-Node-Red-Output.jpg)
My next task is to save the JSON string to a file on CtrlX core. To do this, I will have to use the "Write File" node available in Node Red and configure the absolute path to where the file will be located (sample shown in attached pic Write-File-Node-Red.jpg)
My question: How do I create a folder on CtrlX and have it accessible to Node Red so that the file can be saved in that location? Also how to determine the absolute path?
Solved! Go to Solution.
The path used in Node-RED has to be a complete absolute path on the ctrlX CORE. System variables like $SNAP_DATA will not be resolved:
We would suggest using an self created folder:
Data in the app data storage can also be accessed from the outside of a ctrlX CORE.
See also this thread for further information where snaps can store data.