Local variable storage variable storage is very similar, the main difference is that the local variable storage is partially valid, variable storage is global. Global refers to the same memory can be any program (such as the main program, interrupted procedures or subroutines) access, partially valid is stored and associated with specific programs. Local variable memory used as a temporary data storage transfer function or subroutine. Can be bit, byte, Word or double word to access the data stored in the local variable.
1. Bit, byte, Word and double word
1-bit binary number (bit) value of 0 and 12 different, can be used to switch (or digital) of two different States, such as the contacts open and close coils powerup and powerdown. If the bit is 1, it means that the ladder diagram programming elements in coils “electricity“, normally open, normally closed contact closed fracture, later called the programming elements 1 status, or ON the programming elements. Reverse is also against.
8-bit binary number 1 byte (Byte), No. 0 is the lowest bit (LSB), the 7th highest bit (MSB). 1 two byte Word (Word), two words 1 double word.
2. How to access the data
(1) “,“ access: the address of the memory cell formed by byte address and address, such as I3.2, which regional identifiers “I“ indicates an input (Input), the byte address 3, address 2. As shown in Figure:
This access method is called “byte •“ addressing modes.
(2) “byte“ access: IB3 input bytes (Byte) by I3.0~I3.7 the 8 bits.
(3) the word “access: adjacent bytes in a Word, a two byte characters in the address must be continuous, and the low byte in a word it should be 8-bit, high byte in a word should be the lower 8 bits. IB14 and IB15 IW14 made of 1 Word, IW14 I region in identifier, w (Word), 14 as the starting byte address. IW14 IB14 should be 8-bit, IB15 should be the lower 8 bits.
(4) “double word“ access: the next four bytes represents a double word, four–byte addresses must be continuous. Lowest bytes in a double word it should be up to 8-bit. ID12 consists of IB12~IB15 double words, I as a regional identifier, d represents access to double word (Double Word), 12 as the starting byte address. ID12 IB12 should be up to 8-bit, IB15 should be the lowest 8 bits.
As shown in Figure:
Such as: the electric 0231, 0232, 40 students in one class, each class is divided into 5 groups, each group of 8 people.
The “position“: first set electric 0231 class 1th class
“Bytes“: electrical 0231 group
The word “mode: electrical 0231
S7-200 CPU module 5VDC 24VDC power supply:
CPU when there are extension modules via the I/O bus to provide 5V power supply, 5V power consumption of all the extension modules and cannot exceed the power rating of the CPU to provide. If an external 5V power supply won’t be enough. Each CPU has a 24VDC sensor supply, it entered for the native entry point and extension modules and extension module 24VDC relay coil. CPU module power supply if power requirements exceed the fixed, you can add an external 24VDC power supply provided to the expansion module.
The so-called power calculation is to use the available power capacity of the CPU, less power consumption required for each module.
Note: EM277 module itself does not require a 24VDC power supply the power supply for the communication port used. 24VDC power supply demand depends on the load on the communications port.
The communication port on the CPU, and TD 200 can connect PC/PPI cable and power supply for them, the power consumption is no longer included in the calculation.
L[bytes address]. [Address] L0. 5
Byte, Word or double word:][L[length a starting byte address] LB34 LW20 LD4
S7-200 CPU, counter to be accrued from the input port or the number of pulses sent by internal components. It has additional counters, counter and increase/decrease the counter 3 types. Due to the counter frequency scan cycle limitations, when you need to use high frequency to high frequency signal count counter (HSC).
Counter has the following two kinds of address form.
Current value of addressing: a 16-bit signed integer, stored cumulative number of pulses.
Counter address: based on the current value and preset values of the result set or reset. As with the timer, two addressing modes use the same format, the C+ counter number. For example: C0
In logical operations usually require some intermediate information element, they are not directly drive external load, intermediate staging effects, similar to a relay contact relay in the system. In the S7-200 series PLC, memory can be used as control relays to store the intermediate operational state and control information. General bits of the use.
Store 4 addressing modes that can be bit, byte, Word or double word to access the data in the memory.
position : m (bytes address]. [Address]: M0.3
Byte, Word or double word: m length][the starting byte address]: MB4 MW10 MD4
Enter a relay used to accept signals from external sensors or switches are special registers of the input image. It can only be driven by external signal driver. At the beginning of each scan cycle, CPU total physical input is sampled and sampled values written to the input register. Enter the relays generally used an octal number, a Terminal occupies a point. It has 4 addressing modes that can be bit, byte, Word or double word to access the input process image data in the registers.
section : I (bytes address]. [–Address) such as: I0.1
Byte, Word or double word:][I[length a starting byte address] such as IB3 IW4 ID0
1) byte–addressed (8 bit)
Byte addressable by the store identifier, identifier, a byte address combination of bytes. As VB100, its byte addressing mode as shown in the figure.
Byte addressing format: [region ID] [–identifier].[–byte address]
2) addressing (16 bit)
Addressed by the store identifier, identifier and byte the starting address combination. VW100, addressing mode as shown in the figure.
Address format: [region ID] [start address identifier].[bytes]
3) double word address (32 bit)
Double-word addressed by the store identifier starting address, two-character identifier and byte combinations. VD100, its double-word addressed, as shown in the figure.
Double word address format: [region ID] [two-character identifier starting address].[bytes]
For ease of use and the unification of data and memory cell length, S7-200 series, general storage unit has addressed, byte–addressable, addressing and Gemini addressed 4 addressing modes. When addressing, different ways of addressing cases use the same byte address as the start address, it indicates that the address space is different.
In S7-200, some special storage unit for storing data-bit addressing mode is not supported, mainly analog input/output, accumulators, timers, and the current value of the counter memory. Regardless of what mode of addressing and accumulator, will use 32-bit, analog unit addresses are even signs. In addition, timers, memory and the memory with the current value of the counter, belong to the same marking of device memory using the same address.
A) digital input and output image area
1. Enter mapping registers (digital input image areas) (I)
Digital input image is S7-200CPU for the input signal state opened up a store. Register identifier for the input image I, at the beginning of each scan cycle, CPU to sample the input points and registers the sample values in the input image.
Enter image register is the digital signals of PLC receives external input window.
Can be bit, byte, Word, double word four ways to access.
(1) press the “bits“: from I0.0~I15.7, a total of 128 points
(2) press the “bytes“: from IB0~IB15, a total of 16 bytes
(3) press “character“: from IW0~IW14, a total of 8 characters
(4) press the “double-word“: from ID0~ID12, a total of 4 double word
2. The output image register (Q)
Digital output image area is the S7-200CPU for the signal at the output state of a storage area. Register the output image‘s identifier is Q (from Q0.0~Q15.7, a total of 128 points), at the end of each scan cycle, CPU registers of the output image data to output module, which then drive the external load.
Can be bit, byte, Word, double word four ways to access.
(1) press the “bits“: from Q0.0~I15.7, a total of 128 points
(2) press the “bytes“: from QB0~QB15, a total of 16 bytes
(3) press “character“: from QW0~QW14, a total of 8 characters
(4) press the “double-word“: from QD0~QD12, a total of 4 double word
Note: practically no use of input and output image area of the storage unit can be used as relay.
(B) analog input images and output image area
1. Analog input image areas (AI)
Analog input image area is the S7-200CPU analog input signal opens a store. S7-200 measurement of analog (such as temperature and pressure) into a 1–length (2 bytes) of digital, analog input registers with the image identifier (AI), the length of the data (w) and the bytes of the start address.
From AIW0~AIW30, a total of 16 characters, a total of 16 analog input is allowed.
Description: analog input values for read–only data.
2. Analog output image area (AQ)
Analog output image area is the S7-200CPU analog output signal to open a store. S7-200 1–Word (2 byte, 16-bit) converts the digital proportional current or voltage. Analog output registers with the image identifier (AQ), the length of the data (w) and the bytes of the start address.
From AQW0~AQW30, a total of 16 characters, allowed a total of 16 analog outputs.
(C) the memory variable (v) (the equivalent of auxiliary relays)
PLC program execution process, there will be some intermediate results of the control process, these intermediate also need memory to save the data. Variable storage is designed according to the actual requirements. Variable storage is one of the S7-200CPU set up to save the intermediate variable data stores, represented by v.
Can be bit, byte, Word, double word four ways to access.
(1) press the “bits“: from V0.0~I5119.7, a total of 40,960 points. CPU221, CPU222, memory only 2048 bytes of the variable, its variable store only to V2047.7.
(2) press the “bytes“: from VB0~VB5119, a total of 5,120 bytes
(3) press “character“: from VW0~VW5118, a total of 2,560 words
(4) press the “double-word“: from VD0~VD5116, a total of 1280 double word
(D) information technology–(m)
PLC program execution process, some flags may be used, which also use memory to storage. Memory is designed according to the requirements. Memory is one of the S7-200CPU set up to keep flag data store represented by m. Although the area is called memory, but the data can not only be, but also can be a byte, Word or double word.
(1) press the “bits“: from M0.0~M31.7, a total of 256 points.
(2) press the “bytes“: from MB0~MB31, a total of 32 bytes
(3) press “character“: from MW0~MW30, a total of 16 characters
(4) press the “double-word“: from MD0~MD28, a total of 8 double word
(E) the control relays in the order (s)
PLC program execution process, the sequence may be used. Sequence control relays are designed according to the characteristics of sequential control and. Control relay is S7-200CPU in order to control relays in the order established a store of data, denoted by s. Control process in order for the organization step process control.
Can be bit, byte, Word, double word four ways to access.
(1) press the “bits“: from S0.0~S31.7, a total of 256 points.
(2) press the “bytes“: from SB0~SB31, a total of 32 bytes
(3) press “character“: from SW0~SW30, a total of 16 characters
(4) press the “double-word“: from SD0~SD28, a total of 8 double word
(F) local storage area (l) (the equivalent of auxiliary relays)
S7-200PLC 64 bytes of local storage, which can be used as a temporary store for the 60 and passing parameters to the subroutine.
Local and variable storage is very similar, the main difference is that the variable memory is of global and local storage is partially valid. Global refers to the same memory can be accessed by any program (for example, the main program, subroutine, or interrupt). Local guide memory areas associated with specific programs.
Several programs between visits.
Local storage area is a store set up S7-200CPU as a local variable data, represented by l. Data in the region can be bit, byte, Word, double word four ways to access.
(1) press the “bits“: from L0.0~L63.7, a total of 512 points.
(2) press the “bytes“: from LB0~LB63, a total of 64 bytes
(3) press “character“: from LW0~LW62, a total of 32 characters
(4) press the “double-word“: from LD0~LD60, a total of 16 doubleword
(G) the timer memory area (t)
PLC at work and ultimately need timing, the timer is the realization of PLC timer function of timing equipment. Timer number:
S7-200 has 256 timers.
(VIII) counter memory area (c)
PLC at work sometimes requires not only time count may also be required. Counter is counting device of PLC with counting function.
(H) high speed counter (HSC)
Today high speed counter is used to scan faster than CPU events. S7-200 high speed counters not only count the frequency of up to 30kHz.
S7-200 high speed counter there is a 32-bit signed integer to the current value of the counter. To access high-speed counter values, you must give high speed counter address, namely, high speed counter number.
High speed counter number: HSC0, HSC1, … …, HSC5.
S7-200 6 high-speed counters. Where CPU221 and CPU222 only have 4 high-speed counters (HSC0, HSC3, HSC4, HSC5)
(I) the accumulator (AC)
Accumulators can be read/write device like a memory. For example, you can use the accumulator parameters passed to a subroutine, or return from the subroutine parameters and is used to store intermediate data are calculated.
S7-200CPU provides 4 32-bit accumulator (AC0, AC1, AC2, AC3).
Can be byte, Word or double word accumulator to access data in the data. However, as bytes when reading/writing data in the accumulator, read/write only the lowest 8 bits of the accumulator in the 32-bit data data. If it is read/write in Word forms the accumulator data can only read/write in 32-bit accumulator data the low 16 bits of data. Only take the form of double words when reading/writing data in the accumulator, can read and write all 32 bits of data at once.
Because operation of PLC function is separated from the accumulator. Not as occupied as the other memory accumulators.
(J) special storage areas (SM)
Special memory is S7-200PLC the media for passing information between the CPU and the user program. They can reflect the CPU running the various status information, users can use this information to determine the machine‘s operating status, to determine the user what to do, what not to do. These special information storage to storage. Special memory is designed according to the requirements.
1. Special storage areas
It is S7-200PLC to save its State data and established a store, SM said. Special memory data is read write, some are read–only. Special memory data can be a bit or a byte, Word or double word.
(1) press the “bits“: from SM0.0~SM179.7, a total of 1440 points.
(2) press the “bytes“: from SM0~SM179, a total of 180 bytes
(3) press “character“: from SMW0~SMW178, a total of 90 characters
(4) press the “double-word“: from SMD0~SMD176, a total of 45 double word
Description: special the first 30 bytes of the memory area is read–only.
2. Commonly used special relay and its function
Special storage for CPU and the exchange of information between users, for example, SM0.0 has been the “1“ State, SM0.1 only the first scan of the execution of the user–process cycle for the “1“ State. SM0.4 and SM0.5 provide a period of 1min and 1s of the clock pulse. SM1.0, SM1.1 and SM1.2 respectively zero flag, overflow flag and negative signs.
1, FM 355 closed–loop control module
FM 355 closed–loop control channel 4, used for pressure, flow, liquid level control, optimum temperature control and PID algorithms. FM 355C analog output is 4 fracture of continuous controller, FM 355 s is 8 digital output point step controllers or pulse. CPU FM 355 people after a disruption or failure will continue to operate, control procedure stored in a module.
FM 355 4 analog input is used to collect analog values and feed-forward control value, additional analog inputs for thermocouple temperature compensation. Can use a variety of sensors such as thermocouples, Pt100, thermal resistance, voltage and current sensors. FM 355 closed–loop control of 4 separate channels, you can implement a custom control, cascade control, proportional control and 3–component control, using several controllers can be integrated into one system. Automatic, manual, safety, follow, back this way. 12 for the resolution of the sampling time of 20~100ms,14 for 100~500ms resolution.
Self-tuning temperature control algorithm in m fast, starts automatically when the set point change is greater than 12% liberalization; configuration software package can be used to optimize PID control algorithm.
Defective CPU or CPU to stop working is controller can control independently. In: “backup“ function set adjustable security settings or security control variables. You can read and modify all the parameters of fuzzy temperature controller, or online to modify other parameters.
2, FM 355-2 closed-loop control module
FM 355-2 is suitable for temperature–controlled 4–channel closed–loop control module, you can easily realize online automatic temperature control, including control of heating and cooling, and combination control of heating and cooling. FM 355-2C is continuous controller has 4 analog outputs, FM 355-2S is 8 digital output of the step or pulse controller. CPU FM 355-2 after a disruption or failure is still able to run.
3, FM 455 closed–loop control module
12-bit resolution sampling time for 20~180ms,14 100~1700ms (associated with the number of actual use of the analog input), there are 16 digital inputs.
4, FM 458-1DP application module
FM 458-1DP is designed for a free closed–loop attitude control, and 300 block of library functions and CFC continuous function chart graphical configuration software, with a PROFIBUS-DP interface.
FM 458-1DP basic modules can perform a calculation, the open–loop and closed–loop control, I/O and communication modules can be extended by extension.
EXM 438-1 I/O expansion module is an optional plug-in for FM458-1DP extension module for reading signals and output requirements. Digital/analog input/output module, incremental and absolute encoders can be connected, there are 4 two 12-bit analog output.
EXM 448 communications is the optional FM 458-1DP insert the expansion module expansion module. You can use PROFIBUS-DP or SIMOLINK for high speed communication, with a spare slot, you can insert MASTERDRIVES optional modes, used to establish a SIMOLINK optical fiber communication.
FM 458-1DP and some attachment interface modules, including digital input, digital output and program storage modules.
1, switch 6 on/off button to divide the table into two States unipolar/bipolar two full scale input. SW6=ON, select the unipolar; SW6=OFF, select dual polarity.
2, switches 4 and 5 Select gain. SW4 and SW5 3 combinations, namely SW4=ON,SW5=OFF;SW4= OFF,SW5=ON;SW4= OFF,SW5=OFF. A case study of unipolar, when SW4=ON,SW5=OFF, full scale input 0 to 50mV,0 to 100mV when SW4=OFF,SW5=ON; full scale input 0 to 500mV,0 to 1V; if SW4= OFF,SW5=OFF, full scale input 0 to 5V,0 to 20mA,0 to 10V. It is easy to see, SW4= OFF,SW5=OFF corresponding to a current or voltage DIP switch full range input is combined with the first two DIP switches correspond to the current or voltage full scale input into 100 times-times, 10 times. Switch 4 and 5 Select gain *100,*10,*1.
3, select attenuation switches 1,2 and 3. SW3 3 combinations and SW1,SW2, SW1=ON,SW2=OFF,SW3=OFF;SW1= OFF,SW2=ON,SW3=OFF;SW1= OFF,SW2=OFF,SW3=ON, respectively. Users who use the EM235 module knows that unipolar analog signal range is 0-32000, bipolar analog signal range is -32000-+32000, but in fact this value and gain as well as a full range input voltage between attenuation coefficients of conversion. Positive and negative 2.5V to the full range of bipolar input, positive and negative 5V, 10V positive and negative, for example, SW1= OFF,SW2=OFF,SW3=ON corresponding to positive and negative 10V full scale input is combined with the first two DIP switches correspond to the positive and negative 2.5V, plus or minus 4 times, twice times the 5V voltage relationship. So when the attenuation coefficient is 0.2 select DIP switch SW1= OFF,SW2=OFF,SW3=ON; when the attenuation coefficient is 0.4 select DIP switch SW1= OFF,SW2=ON,SW3=OFF; select DIP switch when the attenuation coefficient of 0.8 SW1=ON,SW2=OFF,SW3=OFF