A real-time industrial fieldbus drive system based on MIPS architecture
By designing a real-time industrial fieldbus drive system under the mips architecture, the problem that industrial fieldbus implementation solutions in the existing technology cannot be both real-time and portable, real-time bus drive on the general operating system platform is realized, and the real-time performance and universality of the system are improved.
Patent Information
- Application Number
- CN202211521160.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2042-11-30
AI Technical Summary
The existing industrial fieldbus implementation solutions cannot be both real-time and portable, and have poor versatility and cannot be applied to a general operating system.
A real-time industrial fieldbus driver system under the mips architecture is designed, including EtherCAT real-time driver module, Ethernet driver module, interrupt interception module and network card driver module. Through the coordinated work of these modules, the packaging and interrupt processing of the EtherCAT protocol is realized, ensuring the real-time and portability of the system.
It realizes the design of real-time bus drivers on the mips platform of a general operating system, and can complete normal communication between masters and slaves in accordance with the industrial fieldbus standard protocol, improves the real-time performance and versatility of the system, and meets a wide range of real-time application needs.
Smart Images

Figure CN115865554B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of industrial field bus implementation, and more specifically, relates to a real-time industrial field bus driving system under a MIPS architecture. Background Art
[0002] Patent CN205563239U discloses an integrated small PLC with both industrial real-time Ethernet and fieldbus, wherein the PLC is provided with two industrial real-time Ethernet ports and one fieldbus port. The PLC enables the integrated small PLC to have both Ethernet and fieldbus. However, based on the specific platform of the PLC, the hardware versatility cannot be guaranteed, and it cannot be adapted for use in non-PLC occasions.
[0003] Patent CN102621974A discloses an industrial automation real-time control device and control method based on a communication bus, which integrates a driver and a physical layer module on an FPGA chip to realize an industrial automation real-time control device based on a communication bus. However, it can only be implemented using parallelized hardware circuits on an FPGA platform and cannot be adapted to the operating system, so it can only be used as a customized system.
[0004] Patent CN1655155A discloses an industrial bus monitoring system and its control software. The configuration bus software is developed based on the traditional PLC bus, which integrates the configuration and configuration functions and reduces the complexity of the bus configuration software. However, the system is also based on the PLC framework and cannot be applied to operating system scenarios.
[0005] In summary, the current industrial fieldbus implementation solutions mainly adopt the PLC or customized circuit route, but they are not suitable for general-purpose operating systems. Summary of the invention
[0006] In view of the defects of the prior art, the purpose of the present invention is to provide a real-time industrial field bus drive system under the mips architecture, aiming to solve the problem that the existing industrial field bus implementation scheme cannot have both real-time performance and portability and has poor versatility.
[0007] To achieve the above object, the present invention provides a real-time industrial field bus drive system under the MIPS architecture, the system comprising:
[0008] The EtherCAT real-time driver module is used to receive the control instructions, sending instructions or receiving instructions sent by the application layer, and then send them to the network card driver module through internal encapsulation by building a periodic timing interrupt; after receiving the protocol data transmitted by the Ethernet driver module, it is parsed again according to the EtherCAT protocol to obtain the slave station information required by the user;
[0009] The Ethernet driver module is used to receive the protocol data transmitted by the interrupt interception module, parse the data according to the requirements of the general network protocol stack, and send it to the EtherCAT real-time driver module;
[0010] The interrupt interception module is used to identify the interrupt source of the industrial field bus after receiving the data transmitted by the network card driver module, and call the corresponding Ethernet driver according to the serial number of the bound industrial field bus interrupt source;
[0011] The network card driver module is used to receive the data transmitted by the EtherCAT real-time driver module, parse it and send it to the network card according to the instructions; after receiving the data transmitted by the network card, the MAC layer data is parsed and sent to the interrupt interception module.
[0012] Preferably, the EtherCAT real-time driver module implements the cyclic command between the master and slave stations by constructing a periodic timing interrupt task, and its periodic timing interrupt follows the first-in-first-out scheduling rule.
[0013] Preferably, the EtherCAT real-time driver module provides an operation interface for the industrial field bus, and the operation interface specifically includes: a read and write operation interface for slave devices, a switching operation interface for the host state, and a management interface for sending and receiving communication data.
[0014] Preferably, the interrupt interception module constructs a dedicated interrupt source by allocating a specific interrupt number in advance. When an interrupt occurs in the pre-bound interrupt source, the interrupt interception module follows the setting of the highest priority of the specific interrupt and obtains the system control right first.
[0015] Preferably, after completing data parsing and forwarding, the Ethernet driver module returns the acquired system control right to the system scheduling.
[0016] In general, the above technical solution conceived by the present invention has the following beneficial effects compared with the prior art:
[0017] The present invention proposes a real-time industrial field bus driving system under a MIPS architecture. The real-time bus driving system is designed to operate under a MIPS platform using a general operating system, and the system comprises: a real-time driving layer completes the encapsulation of an EtherCAT protocol, and can complete normal communication between a master and a slave according to an industrial field bus standard protocol; a network card driver is transformed into a real-time driver by adding an interrupt intercepting layer, and the interrupt intercepting layer can distinguish between normal non-real-time interrupt sources and industrial field bus interrupt sources by allocating fixed interrupt numbers. When an interrupt occurs, the interrupt can be intercepted, and the interrupt can be quickly processed and forwarded to an upper driver, thereby improving the real-time performance; the network card hardware layer can perform the function of sending and receiving data, and an interface capable of sending and receiving original data network packets is exposed upward, so the system has better versatility, so that the driver has both real-time performance and portability, and meets a wide range of real-time application requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A block diagram of a real-time industrial field bus drive system under a MIPS architecture provided by the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0020] like Figure 1 As shown, the present invention provides a real-time industrial field bus drive system under the MIPS architecture, the system comprising:
[0021] The EtherCAT real-time driver module is used to receive the control instructions, sending instructions or receiving instructions sent by the application layer, and then encapsulate them internally and send them to the network card driver module by building a periodic timing interrupt, which mainly includes the master station command; after receiving the protocol data transmitted by the Ethernet driver module, it is parsed again according to the EtherCAT protocol to obtain the slave station information required by the user.
[0022] The EtherCAT protocol is encapsulated in the real-time driver layer of the industrial field bus, and an operating interface for the industrial field bus is provided. The interface includes the interface exposed in the downward docking general network card driver that can perform original data transmission and reception of network packets, as well as state control, reading, writing, switching and other operations of the master and slave machines in the industrial field bus EtherCAT protocol; and can complete normal communication between the master and slave machines in accordance with the industrial field bus standard protocol.
[0023] The Ethernet driver module is used to receive the protocol data transmitted by the interrupt interception module, parse the data according to the requirements of the general network protocol stack, and send it to the EtherCAT real-time driver module.
[0024] The interrupt interception module is used to receive the data transmitted by the network card driver module, read the cause register under the mips architecture to obtain the interrupt, quickly identify the interrupt source of the industrial field bus, and then call the corresponding Ethernet driver according to the serial number of the bound industrial field bus interrupt source.
[0025] The network card driver module is used to receive the data transmitted by the EtherCAT real-time driver module, parse it and send it to the network card according to the instructions; after receiving the data transmitted by the network card, the MAC layer data is parsed and sent to the interrupt interception module.
[0026] Preferably, the EtherCAT real-time driver module implements cyclic commands between the master and slave stations by constructing periodic timer interrupt tasks, and its periodic timer interrupts follow the first-in-first-out scheduling rule, thereby ensuring the real-time and deterministic nature of the protocol.
[0027] Preferably, the EtherCAT real-time driver module provides an operation interface for the industrial field bus, and the operation interface specifically includes: a read and write operation interface for slave devices, a switching operation interface for the host state, and a management interface for sending and receiving communication data.
[0028] Preferably, the interrupt interception module constructs an exclusive interrupt source by allocating a specific interrupt number in advance. When an interrupt occurs in a pre-bound interrupt source, the highest priority setting of the specific interrupt is followed, system control is obtained first, and the priority of the corresponding user thread is increased to ensure the real-time performance of the system.
[0029] Preferably, after completing data parsing and forwarding, the Ethernet driver module returns the acquired system control right to the system scheduling to avoid occupying the system control right all the time.
[0030] Those skilled in the art will readily understand that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications and equivalents made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A real-time industrial field bus drive system under the mips architecture, characterized in that: The system comprises: The EtherCAT real-time driver module is used to receive the control instructions, sending instructions or receiving instructions sent by the application layer, and then send them to the network card driver module through internal encapsulation by building a periodic timing interrupt; after receiving the protocol data transmitted by the Ethernet driver module, it is parsed again according to the EtherCAT protocol to obtain the slave station information required by the user; The Ethernet driver module is used to receive the protocol data transmitted by the interrupt interception module, parse the data according to the requirements of the general network protocol stack, and send it to the EtherCAT real-time driver module; The interrupt interception module is used to identify the interrupt source of the industrial field bus after receiving the data transmitted by the network card driver module, and call the corresponding Ethernet driver according to the serial number of the bound industrial field bus interrupt source; The network card driver module is used to receive the data transmitted by the EtherCAT real-time driver module, parse it and send it to the network card according to the instructions; after receiving the data transmitted by the network card, the MAC layer data is parsed and sent to the interrupt interception module.
2. The system according to claim 1, characterized in that The EtherCAT real-time driver module implements the cyclic command between the master and slave stations by constructing a periodic timing interrupt task, and its periodic timing interrupt follows the first-in-first-out scheduling rule.
3. The system according to claim 1, characterized in that The EtherCAT real-time driver module provides an operation interface for the industrial field bus, and the operation interface specifically includes: a read and write operation interface for slave devices, a switching operation interface for the host state, and a management interface for sending and receiving communication data.
4. The system according to claim 1, characterized in that The interrupt interception module constructs a dedicated interrupt source by allocating a specific interrupt number in advance. When an interrupt occurs in the pre-bound interrupt source, the interrupt interception module follows the setting of the highest priority of the specific interrupt and obtains the system control right first.
5. The system according to claim 4, characterized in that After completing data parsing and forwarding, the Ethernet driver module returns the acquired system control right to the system dispatcher.
Citation Information
Patent Citations
Industrial automatic real-time control device and method based on communication bus
CN102621974A
Industrial bus monitoring system and control software therefor
CN1655155A
Have real -time ethernet of industry and field bus's small -size PLC of integral type concurrently
CN205563239U
Method for implementing EtherCAT field bus control system
CN110658751A
Autonomous controllable numerical control system construction method based on domestic CPU
CN114509993A