I. Concepts of Memory Chip Selection and Bus
Where do the eight wires for sending data to each memory cell come from?
It comes from the computer. Generally, these eight wires are used to connect to a memory chip and other devices. This raises a problem: since these eight wires aren't dedicated to the connection between the memory and the computer, it's not good to always connect a particular cell to these eight wires. For example, if the value in one memory cell is 0FFH and another memory cell is 00H, should this wire be at a high or low level? Wouldn't that cause them to fight each other? Therefore, we need to separate them. The solution is simple: when the external wires come into the integrated circuit's pins, don't connect them directly to the individual cells; just add a switch in between.
Normally, we keep the switch off. We only turn it on when we need to write or read data from the memory. This switch is selected by three leads: read control, write control, and chip select. To write data to the chip, we first select the chip, then send a write signal, the switch closes, and the received data (charge) is written to the chip. To read, we first select the chip, then send a read signal, the switch closes, and the data is sent out. The read and write signals are also simultaneously connected to another memory. However, because the chip select signals are different, although there is a read or write signal, there is no chip select signal, so the other memory will not "misunderstand" and open, causing a conflict. What if two chips are not selected simultaneously? This won't happen in a well-designed system because it is controlled by a computer, not by humans. If two chips are selected simultaneously, it indicates a circuit malfunction, which is beyond the scope of our discussion.
The working principle in high-temperature memory is the same: writing charges. The most crucial aspect here is achieving stability in high-temperature environments. Because electrons become more active at higher temperatures, maintaining charge recording and storage under these conditions is the core challenge.
II. Several Commonly Used Physical Memory Types in PLCs
A PLC's memory is divided into system program memory and user program memory. The system program is equivalent to the operating system of a personal computer; it gives the PLC basic intelligence and enables it to perform various tasks specified by the PLC designer. The system program is designed by the PLC manufacturer and stored in ROM (Read-Only Memory), which cannot be read by the user. The user program is designed by the user and enables the PLC to perform specific functions required by the user.
PLCs commonly use the following types of physical memory:
(1) Random Access Memory (RAM): Users can read the contents of RAM using a programming device, and they can also write user programs into RAM. Therefore, RAM is also called read/write memory. It is volatile memory; the stored information will be lost when the power is interrupted. The memory modules used in computers are RAM.
RAM is fast, inexpensive, and easy to rewrite. A lithium battery can be used to save the user program and some data in the RAM after the PLC is powered off. The disadvantage of this solution is that the lithium battery needs to be replaced with one that is too low-voltage after 1-5 years of use.
(2) Read-Only Memory (ROM) The contents of ROM can only be read, not written. It is non-volatile, and its stored contents can still be preserved after the power is turned off. ROM is used to store the PLC's system program.
(3) Electrically erasable programmable read-only memory (EEPROM), also known as E2PROM, is non-volatile but can be programmed using a programming device. It combines the advantages of non-volatility of ROM and random access of RAM, but the time to write data is much longer than that of RAM. EEPROM is used to store user programs and important data that needs to be stored for a long time.
(4) Flash Memory Flash Memory is translated into Chinese as "flash memory". It is usually called "flash memory" or simply "flash memory". It has the same characteristics as EEPROM.
Because EEPROM or flash memory are non-volatile and relatively easy to rewrite, the trend is for them to replace RAM, which uses lithium batteries to store data, making PLCs completely maintenance-free devices. However, some PLCs still use RAM and lithium batteries to store user programs.