How to read, write and post csv file stored in sd-card plugged in CF01 slot?

Hello Community,

our customer is testing with our Drive based ctrlX Core to control their punching gun. Currently they are trying with PLC engineering to read and write the operation log into a csv file, which will be stored on a plugged sd-card in CF01 slot. 

We found that there is PLC lib called CXA_FileAsync, is this the right lib to be used? 

If there is simple how-to example, it will be really helpful.

Thanks and best regards,

Hui

Best reply by TheCodeCaptain

Hi jh123,

there is an example included in the library, see screenshot.

The correct path to the SD Card would be eg. "/media/mmcblk1p1/testfile.txt", you have to mount the card before in the Settings --> Storage,

The name can be found in the web frontend "Settings --> Storage" as well

The file in the example will be written to appdata/plc/run/linux-gcc-aarch64/data. See also this post.

You could read/write it from there eg. with Node-RED, see second screenshot:

Path: /var/snap/ctrlx-node-red/current/solutions/activeConfiguration/plc/run/linux-gcc-aarch64/data/testfile.txt

 

 

 

View original
12 replies