I am using a PLC based on raspberry Pi and the Codesys version I am working on is Codesys SP17 Patch 3. I have connected an USB drive to the Rasp Pi and I am given a file patch 'ls -al /media/pi' that I have to type somewhere in Codesys so that I can store results in this path. I am new to both Rasp Pi and Codesys. I am figuring out where to write this command. Can anyone help me?
Or is there any other way I can access the USB drive connected to Rasp Pi using Codesys?
Best Regards!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
You can use the SysProcess library to run commands from CodeSys. You can use the SysProcessExecuteCommand2 to run a command and get its output in a string.
For example if you wanted to wrap this function in your programm you could do the following :
by the way, could you please helpe through this issue. i am suddenly unable to download the code into my plc. and i have no clue what is going on. i have pasted the link that elaborates the problem here.
Hello All,
I am using a PLC based on raspberry Pi and the Codesys version I am working on is Codesys SP17 Patch 3. I have connected an USB drive to the Rasp Pi and I am given a file patch 'ls -al /media/pi' that I have to type somewhere in Codesys so that I can store results in this path. I am new to both Rasp Pi and Codesys. I am figuring out where to write this command. Can anyone help me?
Or is there any other way I can access the USB drive connected to Rasp Pi using Codesys?
Best Regards!
Hello,
You can use the SysProcess library to run commands from CodeSys. You can use the SysProcessExecuteCommand2 to run a command and get its output in a string.
For example if you wanted to wrap this function in your programm you could do the following :
Then You can manage errors with the value returned in the "res" variable as you want.
Hope this helps,
BR
Hello, Thank you so much. I will check this and get back to you.
by the way, could you please helpe through this issue. i am suddenly unable to download the code into my plc. and i have no clue what is going on. i have pasted the link that elaborates the problem here.
https://forge.codesys.com/forge/talk/Engineering/thread/7053c43207/#7c33