IEC 61131-3 standard and ARM embedded control system
2026-04-06 06:20:10··#1
Abstract: This paper introduces the IEC 61131-3 international standard, ARM microprocessors, and embedded systems; it studies the design and implementation technology of an embedded real-time control system based on the AT91M55800A microprocessor and the IEC 61131-3 standard, and provides a detailed serial communication program. Keywords: ARM, AT91M55800A, IEC 61131-3 standard, serial communication Introduction ARM is a microprocessor that uses ARM's proprietary intellectual property (IP) core. The ARM7 is a low-power 32-bit core, characterized by its small size, low power consumption, low cost, and high performance, and is widely used in information appliances, industrial control, and wireless communication. The IEC 61131-3 international standard is the first international standard developed by the International Organization for Standardization (International Electrotechnical Commission) for industrial control software programming. This standard describes software design concepts and models for industrial control systems, adapting to the current development direction of software and industrial control systems worldwide, and represents a very advanced design technology. User-friendly interfaces, network connectivity, intelligent software, and real-time data processing have become common requirements for modern measurement and control systems. Therefore, designing and implementing an embedded real-time control system based on an ARM microprocessor and the IEC 6113l-3 standard is of great significance. 1 System Design and Implementation 1.1 System Hardware Foundation The control system is designed based on the Atmel AT91M55800A microprocessor. The AT91M55800A is a 16/32-bit microcontroller based on the ARM7TDMI core. Its processor core features a high-performance 32-bit RISC architecture; it has a high-density 16-bit instruction set and extremely low power consumption. It integrates 8 KB SRAM, a vector interrupt controller (VIC), an advanced power management controller (APMC), and a fully programmable external bus interface (EBI); it has 3 USARTs, 58 programmable I/O lines, 6-channel 16-bit timers/counters, 8-channel 10-bit ADCs, and 2 10-bit DACs, providing a highly flexible and cost-effective solution for various ultra-low-power applications. Figure 1 is a block diagram of the control system's hardware structure. The hardware design adopts a structured and modular design concept, which is easy to customize. The communication interface includes RS232 serial communication interface, Ethernet interface and CAN bus interface. It can be interconnected with industrial Ethernet through the Ethernet port. Combined with the ARM integrated development environment ADS1.2 and the online debugging tool Multi-ICE, the system can be simulated and traced and debugged in real time through the JTAG debugging interface and the embedded ICE logic in the processor. 1.2 Software foundation of the system (1) Porting μC/OS-II The work that the control system needs to do is very complex, there are many peripherals to manage, and the program is getting bigger and bigger. Therefore, porting an embedded real-time multitasking operating system is an inevitable choice. For small real-time control systems, the open source code, solidifiable and customizable, with good portability, high stability and high reliability, and a preemptive real-time multitasking operating system μC/OS-II with a preemptive kernel is a good choice. The concise code of μC/OS-II has been applied to embedded systems such as smart meters, information appliances, wireless communication equipment and industrial robots. Porting μC/OS-II to the AT9lM5800A processor is relatively simple, requiring only modification of three ARM architecture-related files—OS_CPU.H, OS_CPU_A.S, and OS_CPU_C.C, with approximately 500 lines of code. The specific porting process will not be detailed here; many successful porting examples are available online for reference. (2) Application of IEC 61131-3 standard software The IEC 61131-3 standard is the first programming language standard for digital control software technology developed by the International Electrotechnical Commission (IEC) for industrial control worldwide. It comprises two parts: programming and common elements. The common elements describe the variables and data types of all common programming elements used in the five programming languages of IEC 61131-3 (instruction list, structured text, ladder diagram, function block diagram, and SFC), the IEC software model, and the communication model. It provides rules for naming these software elements, declaring variables, and initializing variables and data types, and is an indispensable component for implementing an IEC 61131-3 programming system. The programming section describes two important models: the IEC software model and the communication model. These two models form the conceptual foundation for implementing a programming system conforming to the IEC 61131-3 international standard. The IEC 61131-3 standard also defines a standard function and function block algorithm library, and users can also create their own algorithm libraries. Because the functions and function algorithm libraries are written in ANSI C, user control algorithm programs have excellent portability and reusability. The application of IEC61131-3 standard software on the AT91M55800A-based hardware platform involves running the IEC runtime system as a task within μC/OS-II. The code is as follows: 2. Serial Communication Programming The program written by the user in the IEC61131-3 standard-based programming system, after compilation and linking, generates target code that can be downloaded to the target system (i.e., the control system) for execution via serial port or Ethernet port. The choice of communication connection between the programming system and the target system is highly flexible; it can be RS232 serial communication, Ethernet communication, or other communication methods. The following is the code for RS232 serial communication programming based on the AT91M55800A. A data receive/transmit buffer is allocated in memory: Finally, the interface communication program between the IEC runtime system kernel and the user program is written: With the above code, the embedded control system can receive user IEC programs downloaded from the host computer, while the host computer can acquire and monitor real-time data from the control system. This real-time data can also be published to an industrial Ethernet network for information sharing. Conclusion This paper introduces the design and implementation method of an embedded real-time measurement and control system based on ARM and the IEC 61131-3 standard. This system has excellent openness, customizability, and upgradeability. RS232 communication interfaces, Ethernet interfaces, and CAN bus interfaces were designed to meet the networking needs of modern industrial control. The software programming adopts the IEC 61131-3 international standard, making the developed user program highly portable and reusable.