Memory Card for Modicon M340 CPU
Original instructions
Overview
The Modicon M340 PLC simulator panel displays a memory card in the bottom left corner of the virtual front plate. See Simulator Control for Modicon M340 CPU.
The memory card is inserted by default after the startup of the PLC Simulator.
No Backup/Restore
On a real Modicon M340 CPU, the memory card is separated in 2 parts:
NOTE: The simulator does not simulate the backup/restore part of the memory card.
Not Simulated Features of a Memory Card
The following features of a real memory card are not supported:
Simulated Features of a Memory Card
The following features of a memory card can be simulated for the Modicon M340 CPU:
File Management Function Blocks
The simulator supports the file management function blocks and simulates the generation of the files on the PC.
A directory on the PC simulates the file management part of the memory card. In this directory, the files created by the user application are stored.
The directory used for memory card simulation is either the default one (C:\Documents and Settings\USERNAME\Local Settings\Temp\DataStorage) or the directory used during the last simulation. The last used directory is stored persistent in the registry.
The files written by the application can be accessed by normal tools like an editor or Office tools.
The simulator never deletes the application written files. If an application needs to have a blank empty memory card, the system word %SW93 (Memory Card File System Erasing) has to be used in STOP state of the CPU.
NOTE: There is no tracking of the size and number of files written into the memory card.
Limitations for File Management Function Blocks
For detailed information about the file management functions/function blocks please refer to the System Block Library documentation.
Remove Memory Card
By default the memory card is inserted at simulator start.
The procedure for removing the memory card is as follows:
Step
Action
1
Set the system bit %S65 (CARDIS).
Result: After a potential card access has finished the Card Acc LED goes out.
2
Open the context menu by clicking the memory card with the right mouse button.
3
Select Remove Memory Card....
Result: The virtual front plate shows an empty memory card slot and the CARDERR LED is on.
NOTE: Removing the memory card has no influence on the used directory and the files, but the access to the files is disabled inside the simulator.
Insert Memory Card
The procedure for inserting the memory card is as follows:
Step
Action
1
Open the context menu by clicking the memory card with the right mouse button.
2
Select Insert Memory Card....
Result: A Windows standard file selection dialog opens. The selection is pre-initialized with the last used memory card directory.
Note: The file selection box also has a Write protected check box to insert a write protected virtual memory card.
3
Proceed with one of the 2 following possibilities:
  • Use the preinitialized directory.
    Result: The last removed memory card is inserted.
  • Select another directory.
    Result: Another memory card (for example different in content or empty) is inserted.
Result: The CARDERR LED turns off.
4
Reset the system bit %S65 (CARDIS).
Result: The virtual front plate shows a memory card and the Card Acc LED goes on.
Since a directory and its content represent the memory card, exchanging the content of the directory can simulate the exchange of a memory card. This can be done by normal Windows means (cut/copy/paste of files or renaming/moving folders).
Memory Card Full
By default the memory card is not full at simulator start.
Since there is no size tracking, at any time it is possible to simulate that the memory card is full.
This is done by opening the context menu (right-click the memory card) and selecting the menu command Memory Card Full.
After this menu command is selected:
This state is indicated by the check mark in the context menu command.
Write Protection
By default the memory card is not write protected at simulator start.
At any time, it is possible to simulate that the memory card is write protected.
This is done by opening the context menu (right-click the memory card) and selecting the menu command Write Protection.
After this menu command is selected:
This state is indicated by the check mark in the context menu command.
Control Expert adds some restrictions linked with the memory card (for example program modification is forbidden if the card is write protected). The simulator supports these restrictions too.
To simulate the write protection feature the following system bits and words are supported by the simulator:
NOTE: It is not possible to access the files via an FTP client through the simulator since the files are directly accessible by Windows features.