Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

We Value Your Feedback!
Could you please spare a few minutes to share your thoughts on Cloud Connected vs On-Premise Services. Your feedback can help us shape the future of services.
Learn more about the survey or Click here to Launch the survey
Schneider Electric Services Innovation Team!

M241 accessing SDcard using scripts

Machine and Motion Control Forum

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

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Industrial Automation
  • Machine and Motion Control Forum
  • M241 accessing SDcard using scripts
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
Bastian_Schmitz
Admiral Bastian_Schmitz Admiral
8
FernandoRodrigues
FernandoRodrigues Support
6
Francesco_Begnoni
Francesco_Begnoni Support
5
LeTomas
Lt. Commander LeTomas Lt. Commander
5
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to Machine and Motion Control Forum
kurtklingbeil
Crewman kurtklingbeil
Crewman

Posted: ‎2022-05-19 01:58 PM

0 Likes
1
1072
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2022-05-19 01:58 PM

M241 accessing SDcard using scripts

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

Labels
  • Labels:
  • Modicon M2xx
  • Tags:
  • english
Reply
Contact Support

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic
Reply 1
AlmasAbuov
Ensign AlmasAbuov
Ensign

Posted: ‎2024-02-13 01:09 AM

0 Likes
0
723
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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?

Reply
Contact Support

Link copied. Please paste this link to share this article on your social media post.

Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

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.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of