For PLC users, when writing user programs or selecting equipment, they must be clear about the three stages described below, that is, the principles of the user program execution process.
PLC adopts a centralized processing method, that is, centralized batch processing is used for input scanning signals, execution of user programs and output refresh.
(1) Input Scan In this phase, the PLC reads the input signals from all input terminals in a scanning manner and stores the input signals in the input image area. The input image memory is refreshed. During the program execution phase and the output refresh phase, the input image memory is isolated from the outside world and its content remains unchanged until the input scan phase of the next scan cycle, when it is refreshed by the re-read input signals.
It can be seen that when executing programs and processing data, PLC does not directly use the input signal at the time of the scene, but uses the data input into the image area during this sampling. If the input device can form a closed loop at the PLC input end, the internal input relay corresponding to the input end number is saved as "1", which is equivalent to the relay coil being turned on.
During the execution of the program, the contact corresponding to this number will be activated; if the input device can open the input circuit, the internal input relay corresponding to the input terminal number will be saved as "0", which is equivalent to the relay coil not being turned on. During the execution of the program, the contact corresponding to this number will not be activated.
If the state of the input device outside the PLC changes when the PLC is in the non-input scanning stage, the internal input relay will not change, and it will have to wait until the next input scanning stage to refresh according to the input state at this time. Therefore, input signals less than a dozen milliseconds are often not collected.
(2) Execution of the program During the execution of the user program, the PLC scans and executes one by one from top to bottom and from left to right in the order of the ladder diagram program, that is, it executes in the order of the mnemonic instruction table. However, when encountering a program jump instruction, the program jump address is determined based on whether the jump condition is met. During the execution of the program, the PLC takes the current state of the input variable from the input image area, and then performs logical operations or other operations determined by the program, and stores the operation results in the corresponding internal relays according to the program instructions, including output relays, internal auxiliary relays, timers, counters, etc. The signal of the output relay is stored in the output image area, that is, the output relay corresponds to the output point with the same number outside the PLC.
During the execution of a program, in the same cycle, the previous logical result affects the following contacts, that is, the program executed later may use the latest intermediate calculation result of the previous one; but in the same cycle, the calculation result of the later one does not affect the previous logical relationship. The final state (conduction or not) of all internal relays except the input relays in this scanning cycle will affect the opening and closing of each contact in the next scanning cycle.
(3) The calculation results of the output refresh program execution phase are stored in the output image area, but not sent to the output port. In the output refresh phase, the PLC sends the output variables in the output image area to the output latch, and then the latch generates the control output of this cycle through the output module. If the state of the internal output relay is "1", the output relay contact is closed. The state of all output devices must be maintained for one scan cycle.
Previous article:Sensors help robots develop further
Next article:PID regulation setting rules
Recommended ReadingLatest update time:2024-11-15 07:09
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Design of fully automatic intelligent car washing machine control system based on PLC program_Man Jianhui
- PLC Practical Technology (Siemens)
- Electrical and Electronic Technology (Editors-in-Chief: Liu Yaoyuan, Hu Minshan; Associate Editors-in-Chief: Zou Xiaolian, Zhou Hongyu, Li Heshui)
- 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
- EEWORLD University Hall----Design of DC power supply system for battery testing equipment
- 【TI recommended course】#Give old motors new skills#
- This is a brain teaser - hypotenuse, leg, chord, even Pythagorean theorem
- Should the PCB trace angle not be 90°? — PCB Layout Tips
- Problems with serial programming of STC89C51RC microcontroller
- 【ST NUCLEO-H743ZI Review】+ 2. LED Flowing Light
- [National Day Self-driving Tour] - There are mountain and water routes, please recommend
- PIC16F15324 microcontroller serial port interrupt cannot enter
- High-speed PCB design technology (Chinese)
- A case of SPI communication malfunction