There is a big difference between the programming of single-chip microcomputer and PLC. All programs of single-chip microcomputer are designed by users, while the programs of PLC include system programs (called operating system by Siemens) and user programs. The operating system is used to organize all CPU functions that are not related to specific control tasks. The tasks of the operating system include processing the startup process, refreshing the input/output process image, calling user programs, detecting interrupt events and calling interrupt organization blocks, detecting and handling errors, managing memory, and handling communication tasks. Many functions of PLC , such as scanning working mode, timer function and interrupt processing, are completed by the operating system. This issue should be considered when drawing a flow chart.
The program of the PLC switch control system is more concise to describe with a sequential function diagram. In principle, it is also possible to describe the PLC user program with a flow chart, but it should be distinguished which functions are completed by the operating system and which are implemented by the user program.
For example, someone asked if it is necessary to use a jump instruction to wait for the rising edge of a certain signal. This is a kind of thinking in single-chip computer programming. The scanning working mode of PLC reads all the switch inputs at the beginning of each scanning cycle, and judges whether there is a rising edge according to the change of the state of the same input point in the previous and next two scanning cycles. Therefore, there is no need to use a jump instruction to jump back to wait for the appearance of a certain input signal. If this method is used to query the state change of the signal, the PLC cannot do anything else because all its energy is used for querying! And this query is performed within a scanning cycle, which will make the scanning cycle very long, and it is easy to cause the error of the monitoring timer (watchdog) timeout.
In the PLC user program, only one rising edge detection instruction is needed to capture the rising edge of the pulse signal. If a quick response is required, an interrupt method can be used, and the system program calls the interrupt program written by the user on the rising edge of the pulse signal.
Previous article:Several data storage methods make the compact and flexible microcontroller have unlimited uses
Next article:0P7200 embedded multi-function controller: a complete analysis from principle to application
- Popular Resources
- Popular amplifiers
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- 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
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- CircuitPython-powered bracelet
- Send data to USART1->DR but USART1->DR outputs all 0? ?
- Is there a difference between the positive and negative sides of the 8*8 dot matrix? If the positive and negative sides are connected, will the pattern be reversed?
- Share a Huawei base station power amplifier from many years ago
- Prize-winning live broadcast: ST's PLC solutions in industrial automation. You are invited to watch at 10:00 am on May 26 (Wednesday)!
- ARM's IoT solution pocket book
- GW1N DS90C124 to SPI parallel-serial conversion for thermal imaging data acquisition
- [Environmental Expert's Smart Watch] Part 9: Activity Status Recognition
- USB DFU mode for ESP32-S2-Saola-1
- Does anyone know what chip the silkscreen 95360E is? I guess it is the 5V regulator?