Siemens S7-200 PLC left shift, right shift instruction programming - Database & Sql Blog Articles

Programmable Package SG-8018CA(SG7050C) 0.67M~170M
Brand AVX TPSE226M035R0125 Low impedance tantalum capacitor AVX 22
LPDDR4-200-16Gb

1. Left shift, right shift command
The ladder programming format of the left and right shift instructions of the S7-200 is shown in Figure 10-5.1.
SHL B in the ladder diagram is the shift instruction flag, where:
SHL: SH is the shift marker, L is the left shift (R is the right shift):
B: Byte instruction flag (W is a 16-bit word, WD is a 32-bit double word);
IN: the memory address that needs to be shifted;
OUT: Result memory address.
Digital camera
The shift command of the S7-200 has the following features:
The shift of the 1S7-200 is performed in two steps.
- Use the shift instruction (MOV) to move the data to be shifted into the result memory, see Figure 10-5.1 (b). If you only need to shift the specified memory contents and the execution results are still saved in the original memory, you do not need to perform this step, as shown in Figure 10-5.1 (a).
- Shift the result memory.
When the 2S7-200 executes the shift instruction, the "vacancy" after the data is shifted out is automatically added to the state "0".
The last bit state that was shifted out is stored in the system flag register SMl.1.
4 shift bit N should not exceed the length of the shift data itself (byte operation is 8, word operation is 16, double word operation is 32), if the length of the data itself is exceeded, then "remaining" is required. deal with. For example, when shifting 12 bits of byte data, the actual movement is 4 bits (12 is divided by 8 and the remainder is 4); when N is 0, no shift operation is performed, and the system flag register SMl.0 is set. 1" status.
2. Loop left shift, loop right shift instruction
The ladder programming format of the cyclic left and right shift instructions of the S7-200 is shown in Figure 10-5.2.
Digital camera
The ROL B in the ladder diagram is the shift instruction flag, where:
ROL: RO is the cyclic shift marker, L is the left shift (R is the right shift):
B: Byte instruction flag (W is a 16-bit word, WD is a 32-bit double word);
IN: Memory address to be shifted:
OUT: Result memory address.
The S7-200 shift instruction can sequentially return the shifted data from the other end to the vacant position after the data is removed, thereby realizing the cyclic movement of the data. Other features are the same as the "Left and Right Shift" commands.
3. The shift register instruction uses the shift register instruction to step-by-step shift the binary bit signal (DATA) from the outside of the register into the register in a specified direction. The ladder programming format of the S7-200 shift register is shown in Figure 10-5.3.
Digital camera
The SHRB in the ladder diagram is a shift instruction flag, where:
DATA: binary bit status input;
S__ BIT: the lowest bit address of the shift register;
N: The length of the shift register and the shift direction, the positive number is shifted to the left, the input is shifted from the lowest into the shift register; the negative number is shifted to the right, and the input is shifted from the highest into the shift register.
To ensure that data is shifted by only one bit each time the "enable" input signal arrives, the "enable" input should use an edge instruction.

Ballpoint Pens With Stylus

Shenzhen Ruidian Technology CO., Ltd , https://www.wisonens.com