(D) CMP (P) Comparison: This instruction performs an algebraic comparison between the data of two source operating elements and sends the result to the target element to determine its state.
Source Operating Elements: K/H KnX KnY KnM KnS TCDV/Z
Target Component: YMS
Format: LD X0
CMP(P) K100 C20 M0
When X0 transitions from OFF to ON:
- If K100 > C20 current value, M0 = 1
- If K100 = C20 current value, M1 = 1
- If K100 < C20 current value, M2 = 1
The CMP instruction is executed once per scan cycle when the condition is met.
(D) ZMP (P) Interval Comparison: Compares a single data value with the interval of two source components and sends the result to the target component to determine its state.
Source Operating Elements: K/H KnX KnY KnM KnS TCDV/Z
Target Component: YMS
Format: LD X0
ZCP(P) K100 K120 C30 M3
When X0 transitions from OFF to ON:
- If K100 > C30 current value, M3 = 1
- If K100 ≤ C30 ≥ K120, M4 = 1
- If K120 < C30 current value, M5 = 1
The ZCP instruction is also executed once per scan cycle when the condition is satisfied.
(D) MOV (P) Transfer: Transfers the data from the source operating element to the target component.
Source Operating Elements: K/H KnX KnY KnM KnS TCDV/Z
Target Components: KnY KnM KnS TCDV/Z
Format: LD X0
MOV(P) K100 D10
When X0 transitions from OFF to ON, the value 100 is transferred to D10. In continuous mode, the instruction executes once per scan cycle when the condition is met.
For 32-bit data transfer using DMOV, component pairs are used, with the first digit being even for better accuracy. The constant is automatically converted to binary and stored in the target component.
SMOV(P) Shift Transfer: Converts the source component's data into BCD code and shifts it to the target component as specified.
Source Operating Elements: K/H KnX KnY KnM KnS TCDV/Z
Target Components: KnY KnM KnS TCDV/Z
Range of m: K/H is 1-4 (D1 cannot exceed 9999).
n: KH
Example: D1=1685, D2=0
LD X0
SMOV(P) D1 K4 K2 D2 K3
When X0 transitions from OFF to ON:
- D1=1685 becomes BCD: 0001 0110 1000 0101
- D2=0 becomes BCD: 0000 0000 0000 0000
- Then, the rightmost 2 bits of D1’s BCD code (from the 4th bit from the right) are shifted to the 2nd position of D2, resulting in D2 = 0000 0001 0110 0000, which equals 160.
The SMOV instruction runs once per scan cycle when the condition is met.
(D) CML (P) Negated Transmission: Converts the source component's data into binary, inverts each bit (0 → 1, 1 → 0), and transfers it to the target component.
Source Operating Elements: K/H KnX KnY KnM KnS TCDV/Z
Target Components: KnY KnM KnS TCDV/Z
Example: D0=11
LD X0
CML(P) D0 K1Y0
When X0 transitions from OFF to ON:
- D0=11 becomes binary: 1010
- Inverted to 0101
- Output to K1Y0: Y0=0, Y1=1, Y2=0, Y3=1
The CML instruction is executed once per scan cycle when the condition is satisfied.
Share this information with your fans and keep learning about industrial electronics!
Laser Level,Osram Laser,Five-Line Lasers,Tumtec Laser Level Guangdong Tumtec Communication Technology Co., Ltd , https://www.gdtumtec.com