(D) CMP (P) Comparison---Compare the data of the two source operating elements algebraically, send the result to the target element, and determine the state of the target element.
Source operating element: K/H KnX KnY KnM KnS TCDV/Z
Target component: YMS
Format: LD X0
CMP(P)K100 C20 M0
When X0 changes from OFF to ON: When K100>C20 current value, M0=1
When K100=C20 current value, M1=1
When K100 < C20 current value, M2 = 1
When CMP is executed in a continuous manner, it is executed once per scan cycle when the conditions are met.
(D) ZMP (P) Interval comparison--------Compare a data with the data interval of two source elements, send the result to the target element, and determine the state of the target element.
Source operating element: K/H KnX KnY KnM KnS TCDV/Z
Target component: YMS
Format: LD X0
ZCP(P) K100 K120 C30 M3
When X0 changes from OFF to ON: When K100>C30 current value, M3=1
When K100≤C30≥K120, M4=1
When K120 < C30 current value, M5 = 1
When ZCP is executed in continuous mode, it is executed once in each scan cycle when the condition is met.
(D) MOV (P) Transfer--------- Transfer the data of the operating component to the target component.
Source operating element: K/H KnX KnY KnM KnS TCDV/Z
Target components: KnY KnM KnS TCDV/Z
Format: LD X0
MOV(P) K100 D10
When X0 changes from OFF to ON, 100 is transferred to D10.
When MOV is executed in a continuous manner, it is executed once in each scan cycle when the condition is met.
For 32-bit data, use DMOV to transfer, and use two components with adjacent component numbers to form a component pair. The first number of the component pair can be an odd number or an even number, but to avoid errors, it is recommended to use an even number as the first number of the component pair.
When the transfer instruction is executed, the constant is automatically converted into a binary number and stored in the target element.
SMOV (P) shift transfer--------Convert the data of the source component into BCD code, then shift the BCD code as required and transfer it to the target component.
Source operating element: K/H KnX KnY KnM KnS TCDV/Z
Target components: KnY KnM KnS TCDV/Z
m: The value range of KHK/H is 1-4, that is, the value of D1 cannot exceed 9999
n: KH
Use format: such as D1=1685 D2=0
XO
SMOV(P) D1 K4 K2 D2 K3
When X0 changes from OFF to ON: convert D1=1685 to BCD code 0001 0110 1000 0101
D2=0 is converted to BCD code 0000 0000 0000 0000
Then move the BCD code of D1 from the 4th bit to the right 2 bits to the 3rd bit in D2, and the 1st and 4th bits remain unchanged. At this time, D2 is 0000 0001 0110 000, D2=160
When SMOV is executed in a continuous manner, it is executed once per scan cycle when the condition is met.
(D) CML (P) Invert and transfer----------Convert the data in the source element into a binary number, invert it bit by bit (0→1, 1→0), and transfer it to the specified target element.
Source operating element: K/H KnX KnY KnM KnS TCDV/Z
Target components: KnY KnM KnS TCDV/Z
Format: For example, D0=11
XO
CML(P)D0K1Y0
When X0 changes from OFF to ON: first convert D0 = 11 to binary 1 0 1 0, then invert it to 0 1 0 1
Then the output of K1Y0 is Y0=0, Y1=1, Y2=0, Y3=1
When CML is executed in a continuous manner, it is executed once in each scan cycle when the condition is met.
Previous article:Checking Siemens PLC Program
Next article:What are the advantages of brushless DC motors
- Popular Resources
- Popular amplifiers
- Red Hat announces definitive agreement to acquire Neural Magic
- 5G network speed is faster than 4G, but the perception is poor! Wu Hequan: 6G standard formulation should focus on user needs
- SEMI report: Global silicon wafer shipments increased by 6% in the third quarter of 2024
- OpenAI calls for a "North American Artificial Intelligence Alliance" to compete with China
- OpenAI is rumored to be launching a new intelligent body that can automatically perform tasks for users
- Arm: Focusing on efficient computing platforms, we work together to build a sustainable future
- AMD to cut 4% of its workforce to gain a stronger position in artificial intelligence chips
- NEC receives new supercomputer orders: Intel CPU + AMD accelerator + Nvidia switch
- RW61X: Wi-Fi 6 tri-band device in a secure i.MX RT MCU
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- How to start the design of adjustable voltage regulated power supply application
- Has anyone used the AT32F403 microcontroller? Is there any example program or something?
- A detail of MSP430 interrupt
- The upper limit for each mobile phone is US$2.5. How much 5G patent fees can Huawei collect?
- Schematic diagram of one-input and eight-output terminal block
- IEEE Top Programming Language Rankings 2021
- Tell us what information you need and we will serve you
- Why do we need to add an external EEPROM when using some MCUs?
- Tony teacher perfectly supports esp32-c3
- [Domestic RISC-V Linux Board Fang·Starlight VisionFive Trial Report] Unboxing