Issue
When my Modicon M221 PLC has an SD Card inserted, after a power cycle the ERR LED is lit indicating that the PLC is cloning the application to the SD Card or attempting to run of a Script.cmd from the root of the SD Card. I wish to only use the SD Card for either Data Logging or backup and loading of saved %MW values when commanded in the program.
How do I ensure the PLC does not attempt a clone operation or running the Script.cmd upon startup after a power cycle?
Product Line
SoMachine Basic v1.6+, Modicon M221
Environment
Physical PLC
Cause
The default behaviours for a Modicon M221 PLC at power cycle startup are:
- If an inserted SD Card is does not contain at the root folder 'Script.cmd', the M221 will clone the application to the SD Card.
- If the inserted SD Card has 'Script.cmd', it will interrupt normal startup, execute the script.
In both cases, the PLC will not go back to RUN mode until after the SD Card is removed and another power cycle is applied.
Resolution
There is a Data Logging function (added in SoMachine Basic v1.6 and higher) which allows the SD Card to be kept in the slot of the M221 without starting the Clone process.
The requirement is that:
- The Modicon M221 is of Functional Level 6.0 or higher a.k.a. a Boot loader version of 50 or higher - this can be checked in the system word %SW13
- The Modicon M221 has an SV number (on the sticker with the serial number) of 1.6 or higher (devices manufactured after May 2017).
To set up the SD Card as a "Data Logging" storage device for the M221, follow these steps:
- Put your SD Card in your PC card reader
- Open Windows File Explorer
- Right-click on the drive letter associated with the SD Card in File Explorer
- Choose "Properties"
- In the General Tab's first field presented at the top, set name of the SD Card to "DATA"
- Click OK
- Delete 'Script.cmd' from the root directory of the SD Card
- Eject the SD Card
For more information on the Data Logging, please see the guide on the feature in the HTML Help of SoMachine Basic:
SoMachine Basic-> SoMachine Basic - Generic Functions Library Guide->Software Objects->Data Logging