Ask our Experts
Didn't find what you are looking for? Ask our experts!
Support forum for Machine and Motion Control solutions, including Lexium MC12 and robotics, PacDrive, Modicon PLCs and I/Os, EcoStruxure Machine Expert Twin, … - from design, implementation to troubleshooting and more, by Schneider Electric
Search in
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-05-19 01:58 PM
Question: I need some detailed information about the use of scripts on M2xx to perform various file operations between system memory and the SDcard
My first kick at the can both succeeded beyond my expectation and was also spectacularly problematic...
I prepared a script file, using the tools in ME on an SDcard which contained the command 'Upload "/usr/Log/*"'
I wrote some sample .CSV files into what seemed like the /Log folder as seen in ME File manager.
I then inserted the SDcard and power-cycled and was quite surprised that the .CSV files had indeed been copied to the SDcard... However, the PLC had its brains thoroughly blown away by this and was no longer IP accessible, and initially didn't even want to connect via USB
I ended up using a firmware image SDcard to restore functionality. That seems completely bizarre to me that executing a script file appears to be inextricably linked to replacing the firmware/program and all of the configuration etc.
I notice there are a bunch of empty folders on that script SDcard...
In the folder containing the script file was also a log file of its action in copying the CSV files
My question is whether/how is it possible to _only_ run the script file without blowing the PLC's brains out...in an attempt to update the firmware with null files I suspect that perhaps if all of the folders are deleted from the SDcard except the one containing the script file that goofy behaviour might be circumvented.
Given the amount of farting around it takes for each attempt, I decided to request a definitive answer as to how to create an SDcard which only executes a script file, and leaves the PLC in an unmangled running condition.
Related to this, in digging in the docs, I was surprised to encounter the SCRIPT_EXEC function meaning that the desired file transfer could be done without resorting to reboots. However, I notice that the same 'Upload "/usr/Log/*"' command file consistently fails with the message that SDcard is not accessible - even though it is inserted, and I do see the SD LED illuminate whenever it is inserted
I modified the script to simply Delete /usr/Log/* and that worked OK So the scripting mechanism is working OK, it is just that it appears that the SDcard is not accessible once the PLC is booted, even though it appears to be accessible at boot-time, perhaps before the PLC OS is running
I would like some detailed definitive description of whether/how the SDcard can be written read using scripts executed from the PLC program.
I notice that the script requires an "extra" /usr to be inserted to the path compared with the view from the PLC program and the ME File manager I write the CSV files to /Log/20220519.CSV and they appear in the /Log folder as seen in FileManager, but for the scripts to access them they appear in /usr/Log my guess is that the root / is not accessible to the PLC program which is why the SDcard cannot be accessed via /sd0 or something like that
I did attempt to run a script "Delete /sd0/*.log and got the same SDcard not accessible error
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-02-13 01:09 AM
Hello! Were you able to write to a .csv file? If so, how did you do it?
Link copied. Please paste this link to share this article on your social media post.
You’ve reached the end of your document
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.