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

Save a file created in Node Red on to CtrlX CORE

Save a file created in Node Red on to CtrlX CORE

Bala
Member

Hello,

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?

Thanks,

Bala

2 REPLIES 2

CodeShepherd
Community Moderator
Community Moderator

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:

 

/var/snap/ctrlx-node-red/current/solutions/activeConfiguration/node-RED

 

Node-RED write file nodeNode-RED write file node

 We would suggest using an self created folder:

 

/var/snap/ctrlx-node-red/current/solutions/activeConfiguration/node-RED/myData/myFile.json

 

Data in the app data storage can also be accessed from the outside of a ctrlX CORE.

  1. Using a WebDAV client to manipulate the data inside the app data. See this post.
  2. Upload a complete app data archive and activate it.

See also  this thread for further information where snaps can store data.

Same behaviour for accessing the certificate storage.

Node-RED access certificateNode-RED access certificate

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