1. input mapping register (digital input mapping area) (i)
Digital input image area is a storage area opened by S7-200CPU for signal status of input terminals. The identifier of the input image register is i. At the beginning of each scanning cycle, the CPU samples the input point and stores the sampled value in the input image register.
Input image register is the window for PLC to receive external input switch signals.
It can be accessed in four ways: bit, byte, word and doubleword.
(1) According to the "bit" mode: from I0.0 to I 15.7, * * * has 128 points.
(2) According to the "byte" mode: from IB0 to IB 15, * * * has 16 bytes.
(3) According to the "character" mode: from IW0 to IW 14, * * * has 8 characters.
(4) According to the "double-word" mode: from ID0 to ID 12, * * * has four double words.
2. Output image register (Q)
Digital output image area is a storage area opened by S7-200CPU for the signal state of the output terminal. The identifier of the output image register is q (from Q0.0 to Q 15.7, there are 128 points in * *). At the end of each scanning cycle, the CPU transmits the data of the output image register to the output module, which drives the external load.
It can be accessed in four ways: bit, byte, word and doubleword.
(1) According to the "bit" mode: from Q0.0 to I 15.7, * * * has 128 points.
(2) According to the "byte" mode: from QB0 to QB 15, * * * has 16 bytes.
(3) Press "Character" mode: from QW0 to QW 14, * * * has 8 characters.
(4) Press the "double word" mode: from QD0 to QD 12, * * * has four double words.
Note: Memory cells that are not actually used in the input and output image areas can be used as intermediate relays.
(2) Analog input mapping area and output mapping area
1. Analog input image area (AI area)
Analog input image area is the storage area opened by S7-200CPU for analog input signals. S7-200 converts measured analog quantities (such as temperature and pressure) into digital quantities of 1 word (2 bytes), and the analog input image register is represented by identifier (AI), data length (W) and byte start address.
From AIW0~AIW30, * * has 16 words, and * * allows 16 analog inputs.
Note: Analog input values are read-only.
2. Analog output image area (AQ area)
Analog output image area is the storage area opened by S7-200CPU for analog output signals. S7-200 converts the digital quantity of 1 word (2 bytes, 16 bits) into current or voltage in proportion. The analog output image register is represented by an identifier (AQ), a data length (w) and a start address of a byte.
From AQW0~AQW30, * * has 16 words, and * * * allows 16 analog outputs.
(3) Variable memory (V) (equivalent to internal auxiliary relay)
There will be some intermediate results in the process of PLC executing programs, and these intermediate data also need to be stored in memory. Variable memory is designed according to this actual demand. Variable memory is a storage area set by S7-200CPU for saving intermediate variable data, which is denoted by V. ..
It can be accessed in four ways: bit, byte, word and doubleword.
(1) According to the "bit" mode: from v0.0 to i5 1 19.7, * * has 40,960 points. The variable memory of CPU22 1 and CPU222 is only 2048 bytes, and its variable memory area can only reach V2047.7 bits.
(2) According to the "byte" mode: from VB0 to VB5 1 19, * * * has 5 120 bytes.
(3) According to the "word" mode: from vw0 to vw5 1 18, * * * has 2560 words.
(4) Press the "double word" mode: from VD0 to VD5 1 16, * * * has 1280 double words.
(4) bit memory (M) area
Some flag bits may be used in the process of PLC executing programs, and these flag bits also need to be stored in memory. Bit memory is designed according to this requirement. Bit memory is a storage area set by S7-200CPU to store flag bit data, which is denoted by m ... Although this area is called bit memory, the data in it can be not only bits, but also bytes, words or double words.
(1) According to the "bit" mode: from M0.0 to M3 1.7, * * * has 256 points.
(2) According to the "byte" mode: from MB0 to MB3 1, * * * has 32 bytes.
(3) According to the "word" mode: from MW0 to MW30, * * * has 16 words.
(4) According to the "double word" mode: from MD0 to MD28, * * * has 8 double words.
(5) sequence control relay area
Sequential control can be used in the process of PLC executing programs. The sequence control relay is designed according to the characteristics and requirements of sequence control. Sequence control relay area is the storage area established by S7-200CPU for sequence control relay data, which is denoted by S .. It is used to control the step-by-step process in the sequence control process.
It can be accessed in four ways: bit, byte, word and doubleword.
(1) According to the "bit" mode: from S0.0 to S3 1.7, * * * has 256 points.
(2) According to the "byte" mode: from SB0 to SB3 1, * * * has 32 bytes.
(3) Press the "word" mode: from SW0 to SW30, * * * has 16 words.
(4) According to the "double word" mode: from SD0 to SD28, * * * has 8 double words.
(6) Local storage area (L) (equivalent to internal auxiliary relay)
S7-200PLC has 64 bytes of local memory, of which 60 bytes can be used as temporary memory or pass parameters to subprograms.
Local memory and variable memory are very similar, the main difference is that variable memory is globally effective, while local memory is locally effective. Global means that any program (for example, main program, subroutine or interrupt program) can access the same memory. Locally, the instruction store is associated with a specific program.
There is no exchange of visits between several projects.
The local storage area is a storage area established by S7-200CPU for local variable data, which is denoted by L. The data in this area can be accessed in four ways: bit, byte, word and double word.
(1) According to the "bit" mode: from L0.0~L63.7, * * * has 5 12 points.
(2) According to the "byte" mode: from LB0 to LB63, * * * has 64 bytes.
(3) According to the "character" mode: from LW0 to LW62, * * * has 32 characters.
(4) Press the "double word" mode: from LD0 to LD60, * * * has 16 double words.
(7) Timer storage area (T)
PLC needs timing in its work, and timer is a timing device to realize the timing function of PLC. Number of timers:
T0、T 1、…、T255
S7-200 has 256 timers.
(8) Counter storage area (C)
Sometimes PLC needs not only timing but also counting function in its work. Counter is a counting device with PLC counting function.
Number of counters:
C0、C 1、C255
(9) High speed counter area (HSC)
The high-speed counter is used to accumulate events at a faster speed than the CPU scanning rate. S7-200 high-speed counter not only has a counting frequency as high as 30kHz.
S7-200 Each high-speed counter has the current value of a 32-bit signed integer counter. To access the value of the high-speed counter, you must give the address of the high-speed counter, that is, the number of the high-speed counter.
The serial numbers of high-speed counters are: HSC0, HSC 1, ..., HSC5.
S7-200 has six high-speed counters. Among them, CPU22 1 and CPU222 only have four high-speed counters (HSC0, HSC3, HSC4 and HSC5).
(10) accumulator area (AC)
Accumulator is a device that can be read/written like memory. For example, an accumulator can be used to pass parameters to a subroutine, or return parameters from a subroutine, and to store calculated intermediate data.
S7-200CPU provides four 32-bit accumulators (AC0, AC 1, AC2, AC3).
The data in the accumulator data can be accessed by bytes, words or doublewords. However, when the data in the accumulator is read/written in bytes, only the lowest 8 bits of the 32-bit data in the accumulator can be read/written. If the data in the accumulator is read/written in word form, only the low 16 bits of the 32-bit data in the accumulator can be read/written. Only by reading and writing the data in the accumulator in the form of double words can all 32-bit data be read and written at one time.
Because the operation function of PLC can not be separated from the accumulator. Therefore, there is no situation that the accumulator is occupied like other memories.
(1 1) Special storage area (SM)
Special memory is the medium for S7-200PLC to transfer information between CPU and user programs. They can reflect all kinds of state information of CPU in operation, and users can judge the working state of the machine according to these information, so as to determine what the user program should and should not do. These special information also need to be registered in memory. Special memory is designed according to this requirement.
1. Special storage area
It is a storage area established by S7-200PLC to save its own working state data, which is represented by SM. Some data in the special storage area are readable and writable, and some are read-only. The data in the special storage area can be bits, bytes, words or doublewords.
(1) according to the "bit" mode: from Sm 0.0 to Sm 179.7, * * * has 1440 minutes.
(2) According to the "byte" mode: from SM0 to SM 179, * * * has 180 bytes.
(3) According to the "word" mode: from SMW0 to SMW 178, * * * has 90 words.
(4) Press the "double word" mode: from SMD0 to SMD 176, * * * has 45 double words.
Note: The first 30 bytes of the special storage area are read-only.
2. Common special relays and their functions
Dedicated memory is used to exchange information between CPU and users. For example, SM0.0 is always in the "1" state, and SM0. 1 is only in the "1" state in the first scanning cycle of user program execution. SM0.4 and SM0.5 provide clock pulses with periods of 1 min and 1 sec, respectively. SM 1.0, SM 1. 1, SM 1.2 are zero, overflow and negative respectively.
The 256 io images here refer to 128 8-bit E I and 128 8-bit E O switches with 128.
But if it is DW, there are only 4 I and 4 O, which is to improve the accuracy of data acquisition. Such as temperature, liquid level, etc. , bytes or words need more DW acquisition accuracy.
Theoretically, you can use 256 IO, if you like.