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
Solved! Go to Solution.
Please have also a look to this thread discussing file access out of the PLC. I will ask to add a example.
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
Thanks a lot!
An example will be really useful.
Hello, What if the file is stored on a network pc? How to read, write and post csv file stored in a network pc? Thanks.
Hi YT123,
we have not yet a native build in client to map network drives, this is on our roadmap.
As a workaround you could try Node-RED.
Regards
Thank you for your quick reply. We look forward to having this function soon. 😀
Hi,
attached you find a simple flow how to make a smb access with Node-RED.
I used the "node-red-contrib-smb" package.
But be careful, it seems the package is not very well programmed, any miss configuration leeds to an uncaught exception.
Hello TheCodeCaptain,
thanks for the example!
Btw, is it possible to realize it using PLC engineering ? Cause customer will mainly work with PLC.
Thx.
Hello TheCodeCaptain,
Do you have the palette of SMB node that I can install with? This is not a default node.
Thx.
Hello jh123,
you are right, this is a third party node and not distributed by us, we can also not support it.
You can download it in the palette manager, your engeneering pc and your ctrlX need internet access for that.