In this post, we will learn the basic types and concepts of memory in a programmable logic controller (PLC).
PLC Memory
The memory of a PLC consists of two types:
- RAM and
- ROM.
Let us study the two types in detail.
Random Access Memory in PLC
A RAM (Random Access Memory) is that part of memory where programs and data are stored. All the user programs and data variables are stored in RAM memory. That means a RAM memory location can be written and read.
Simply, if you write a program section or create a new memory (data) variable, it is stored in RAM memory. Any changes by the programmer in the program or data will automatically be overwritten in the memory.
All the instructions and program sections are written in program RAM memory. All the IO values and variables are stored in data RAM memory.
RAM memory can further be categorized into volatile and non-volatile. Volatile memory can be defined as non-retentive memory. That means, when the PLC is powered off, the memory value is not retained.
For example, if the last value of the memory variable was 20, then after power recycles, its value will become zero. Non-volatile memory retains the value of memory even after power recycle.
Read Only Memory in PLC
ROM (Read Only Memory) refers to that part of the memory where data can only be read and not written. The operating system, firmware version, and system-defined variables are stored in ROM or EEPROM.
Now, let us see some other concepts related to PLC memory.
PLC’s also have cache memory, as like laptops, mobiles, and other storage devices. Here, the cache memory can store periodic and event tasks, system use data, and programs.
Apart from standard program memory, there is also non-program memory stored in PLC like project properties, symbols, comments, animation tables, etc.
In some PLCs, you have the option to define variables or data memory as retentive or non-retentive. For retentive memory variables, you just have to choose which variables to retain. There are some limitations set for using this part of memory.
For example, in Siemens S7-200 Smart PLCs, you get the option to choose the memory range for retentive variables. Variables out of this memory range will be automatically defined as non-retentive.
Memory backup and restore options are given in PLC for saving and restoring values of memory variables.
For example, if you click the memory backup button in a PLC software online, the values of all the data and program variables will be saved to an external file; like excel or notepad. Then, if you click the memory restore button, the values that you have saved will be overwritten in the values of variables.
The capacity of memory is defined in kilobytes. As you know, one byte is a group of 8 bits. In the memory part, thus, 1K means 1024 bytes. So, 32K memory means 32* 1024 (32768 bytes) of memory.
Various PLC manufacturers design the memory allocation according to their requirements. Also, some provide a very dynamic allocation of memory to programmers. That means you can set the memory allocation in a PLC according to your needs.
If you liked this article, then please subscribe to our YouTube Channel for Instrumentation, Electrical, PLC, and SCADA video tutorials.
You can also follow us on Facebook and Twitter to receive daily updates.
Read Next:
- Statement List Language
- PLC Simulator using Excel
- DC Injection Braking in VFD
- What is Alarm Prioritization?
- PLC System Cabinet Check List