1. Left Shift and Right Shift Commands
The ladder programming format for the left and right shift instructions in S7-200 is illustrated in Figure 10-5.1. In the ladder diagram, SHL represents the shift instruction flag. Here’s a breakdown of the components:
- SHL: "SH" is the shift marker, while "L" stands for left shift (R is used for right shift).
- B: Indicates that the instruction operates on a byte (W for 16-bit word, WD for 32-bit double word).
- IN: Refers to the memory address containing the data to be shifted.
- OUT: Specifies the result memory address where the shifted data will be stored.
Frequency Inverters, also known as Variable Frequency Inverters or Variable Speed Drives, are electronic devices that are used to control the speed of an electric motor. They convert the incoming AC power into DC power and then back to AC power at the desired frequency and voltage. These devices are commonly used in industrial and commercial applications to regulate the speed of machines and equipment. Low Power Inverters, on the other hand, are designed for use in smaller applications such as home appliances and small machinery. They are typically less expensive and have a lower power output compared to their industrial counterparts. Overall, Frequency Inverters and Variable Frequency Inverters are essential components in modern industrial and commercial applications, while Low Power Inverters are more commonly used in smaller scale applications. Frequency Inverter,Variable Frequency Inverter,Low Power Inverter,Variable Speed Drive WuXi Spread Electrical Co.,LTD , https://www.vfdspread.com
The S7-200 shift commands have several key features:
- Data shifting is performed in two steps. First, the data to be shifted must be moved into the result memory using the MOV instruction, as shown in Figure 10-5.1 (b). If you only need to shift the original data and keep it in place, this step is not necessary, as seen in Figure 10-5.1 (a).
- After the data is moved, the actual shift operation takes place.
- When data is shifted out, the vacant space is automatically filled with a "0".
- The last bit that was shifted out is stored in the system flag register SM1.1.
- The number of bits to shift (N) should not exceed the size of the data being shifted. For example, when shifting a byte (8 bits), if N is 12, only 4 bits are actually shifted (since 12 mod 8 = 4). If N is 0, no shift occurs, and the system flag register SM1.0 is set to "1".
2. Loop Left Shift and Loop Right Shift Instructions
The ladder programming format for the loop left and right shift instructions is displayed in Figure 10-5.2.
In the ladder diagram, ROL is the cyclic shift instruction flag. The structure is similar to the standard shift command:
- ROL: "RO" indicates a cyclic shift, while "L" stands for left shift (R for right shift).
- B: Byte instruction flag (W for 16-bit word, WD for 32-bit double word).
- IN: The memory address containing the data to be shifted.
- OUT: The result memory address.
Unlike regular shifts, cyclic shifts return the shifted-out data from the opposite end to fill the vacant position, allowing for continuous data movement. Other functionalities remain the same as the basic shift commands.
3. Shift Register Instruction
The shift register instruction is used to sequentially shift binary bit signals (DATA) into the register in a specified direction. The ladder programming format for the S7-200 shift register is shown in Figure 10-5.3.
The SHRB in the ladder diagram is the shift register instruction flag, which includes:
- DATA: Input signal representing the binary bit status.
- S_BIT: The lowest bit address of the shift register.
- N: Defines the length of the shift register and the direction. A positive value shifts data to the left, with input entering from the lowest bit. A negative value shifts data to the right, with input entering from the highest bit.
To ensure that only one bit is shifted per enable signal, the "enable" input should use an edge detection instruction.
Frequency Inverter,Variable Frequency Inverter,Low Power Inverter,Variable Speed Drive