An industrial I / O module supporting dual-protocol stack parallel communication and a multi-bus communication method.

By embedding a parallel communication scheme between EtherCAT and Modbus RTU within an industrial I/O module, and utilizing a shared memory mapping table and a real-time operating system, the high cost and low efficiency issues of existing technologies are resolved, achieving efficient data transmission and flexible configuration between EtherCAT and Modbus RTU.

CN123123465APending Publication Date: 2026-11-17SICHUAN ZERO POINT AUTOMATION SYST CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611329125.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing technologies in industrial automation systems suffer from problems such as high cost of independent gateway devices, high communication latency, complex system configuration, single MCU serial processing bottleneck, and lack of a unified data mapping mechanism, resulting in low conversion efficiency between EtherCAT and Modbus RTU protocols.

Method used

It adopts an industrial I/O module that supports parallel communication with dual protocol stacks, and has a built-in microcontroller, EtherCAT slave controller and RS485 transceiver. It realizes parallel communication between EtherCAT and Modbus RTU through a shared memory mapping table and a real-time operating system, eliminating the coupling between tasks and supporting online configuration and status linkage.

Benefits of technology

It reduces hardware costs and communication latency, improves real-time performance and ease of system configuration, and enables efficient data interoperability and flexible adaptation between EtherCAT and Modbus RTU.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123465A_ABST
    Figure CN123123465A_ABST
Patent Text Reader

Abstract

This invention discloses an industrial I / O module and a multi-bus communication method supporting dual-protocol stack parallel communication, belonging to the technical field of industrial automation communication. The industrial I / O module includes a microcontroller, an EtherCAT slave controller, an RS485 transceiver, and digital I / O circuitry. The microcontroller is connected to the EtherCAT slave controller, the RS485 transceiver, and the digital I / O circuitry. The EtherCAT slave controller connects to an EtherCAT master station, and the RS485 transceiver connects to a Modbus RTU slave device. The microcontroller also includes a shared memory mapping table, through which EtherCAT and Modbus communication tasks exchange data. This industrial I / O module, while performing digital I / O acquisition and control functions, has built-in protocol conversion capabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of industrial automation communication, specifically relating to an industrial I / O module that supports parallel communication with dual protocol stacks and a multi-bus communication method. Background Technology

[0002] EtherCAT (Ethernet for Control Automation Technology) is a high-performance industrial Ethernet protocol widely used for real-time data communication in industrial automation systems. Modbus RTU is a classic serial communication protocol; due to its simplicity, reliability, and low cost, many devices in industrial settings still use Modbus RTU communication with an RS485 interface.

[0003] In industrial automation projects, hybrid bus scenarios are common: the upper-level control system (such as a PLC) uses the EtherCAT bus, while some older field devices or third-party equipment only support the Modbus RTU protocol. Existing solutions have the following drawbacks:

[0004] 1. High Cost of Standalone Gateway Solutions: Currently, all EtherCAT to Modbus RTU solutions on the market use standalone gateway devices (such as JM-ECT-RTU and YC-ECT-RTU). These gateway devices only perform protocol conversion and do not have I / O functions, increasing additional hardware costs, installation space, and cabling workload. Existing patents (such as utility model patent CN201120308044 "A Gateway for EtherCAT to RS485 Communication Conversion") also focus on standalone gateway devices.

[0005] 2. Long communication links and high latency: In the standalone gateway solution, data needs to go from the EtherCAT master station → gateway → Modbus device, undergoing two protocol conversions and two physical transmissions. The communication latency is superimposed, reducing real-time performance.

[0006] 3. Complex system configuration: EtherCAT and Modbus networks need to be configured separately, and gateway devices need to be configured with mapping relationships independently, which is not conducive to unified management and maintenance.

[0007] 4. Single MCU serial processing bottleneck: If the protocol conversion is integrated inside the IO module, the existing solution usually adopts a serial processing method, that is, EtherCAT communication is processed first and then Modbus communication is processed in a task, which causes the two protocols to block each other and cannot meet the real-time requirements of EtherCAT and Modbus at the same time.

[0008] 5. Lack of a unified data mapping mechanism: The existing solution lacks a standardized mapping mechanism between EtherCAT PDO process data and Modbus registers. Data conversion requires writing a lot of adaptation code manually, resulting in poor scalability and maintainability. Summary of the Invention

[0009] The purpose of this invention is to provide an industrial I / O module and a multi-bus communication method that support parallel communication with dual protocol stacks, aiming to solve any of the problems mentioned above.

[0010] This invention is mainly achieved through the following technical solutions:

[0011] An industrial I / O module supporting dual-protocol stack parallel communication includes a microcontroller, an EtherCAT slave controller, an RS485 transceiver, and digital I / O circuitry. The microcontroller is connected to the EtherCAT slave controller, the RS485 transceiver, and the digital I / O circuitry. The EtherCAT slave controller is used to connect to an EtherCAT master station, and the RS485 transceiver is connected to a Modbus RTU slave device.

[0012] The microcontroller has a built-in real-time operating system, which is used to create independently scheduled EtherCAT communication tasks and Modbus communication tasks; the microcontroller also includes a shared memory mapping table, through which EtherCAT communication tasks and Modbus communication tasks exchange data.

[0013] The EtherCAT communication task is used to process EtherCAT protocol data (PDO process data transmission and reception and SDO service data interaction of the EtherCAT protocol stack) and write or read the data into the shared memory mapping table; the Modbus communication task is used to process Modbus protocol data (message parsing and response of Modbus RTU / ASCII protocol) and send requests to Modbus RTU slave devices or return responses according to the data in the shared memory mapping table.

[0014] To better implement the present invention, the microcontroller is further connected to the EtherCAT slave controller via the SPI interface; the microcontroller communicates with the RS485 transceiver via the UART interface; and the microcontroller controls the DE / RE pins of the RS485 transceiver via the GPIO pins to control the switching of the RS485 communication direction.

[0015] To better realize the present invention, the EtherCAT slave controller is CF1106A and the microcontroller is HC32F452KETB.

[0016] To better implement the present invention, the shared memory mapping table is further divided into an input area and an output area; the input area is used to store the mapping data from Modbus slave device data to EtherCAT master station; the output area is used to store the mapping data from EtherCAT master station to Modbus slave device.

[0017] To better realize the present invention, the microcontroller is further configured with a state linkage module for monitoring the state machine of the EtherCAT communication task and linking the Modbus communication state with the EtherCAT state machine; when EtherCAT enters the Operational state, the Modbus communication task is started; when EtherCAT enters the Safe-Operational state or a lower state, the Modbus communication is paused to ensure the consistency of the states of the two bus protocols.

[0018] To better implement the present invention, the microcontroller is further configured to receive configuration instructions via the EtherCAT SDO service to switch the operating mode of the Modbus communication task online; when switched to Modbus slave mode, the Modbus communication task performs the following operations:

[0019] In response to a read request from an external Modbus master, data is read from the input area of ​​the shared memory map and returned; specifically, when the industrial I / O module receives a read holding register request, data is read from the corresponding address in the input area of ​​the shared memory map and returned.

[0020] In response to a write request from an external Modbus master, data is written to the output area of ​​the shared memory mapping table, and an EtherCAT communication task is triggered to report the updated data to the EtherCAT master. Specifically, when the industrial I / O module receives a write request to a single register, it writes the data to the corresponding address in the output area of ​​the shared memory mapping table and triggers an EtherCAT task to report the updated data to the EtherCAT master.

[0021] This invention is mainly achieved through the following technical solutions:

[0022] A multi-bus communication method, based on the aforementioned industrial I / O module supporting dual-protocol stack parallel communication, includes the following steps:

[0023] Step S1: Initialize the real-time operating system and create parallel EtherCAT and Modbus communication tasks;

[0024] Step S2: Based on the output area of ​​the shared memory mapping table, implement the data exchange between the EtherCAT master station and the Modbus slave station device;

[0025] Step S21: When the EtherCAT master station sends out PDO data, the EtherCAT communication task receives the PDO and writes the PDO data into the output area of ​​the shared memory mapping table.

[0026] Step S22: In response to an update event or the arrival of a polling cycle, the Modbus communication task reads data from the output area of ​​the shared memory mapping table and forwards it to the Modbus slave device via the Modbus RTU protocol, and the slave device executes control actions;

[0027] Step S3: Based on the input area of ​​the shared memory mapping table, implement the data exchange between Modbus slave devices and EtherCAT master station;

[0028] Step S31: The Modbus communication task polls the slave device and writes the response data returned by the slave device into the input area of ​​the shared memory mapping table;

[0029] Step S32: In the next PDO cycle, the EtherCAT communication task reports the input area data as input PDO to the EtherCAT master station.

[0030] The beneficial effects of this invention are as follows:

[0031] (1) The industrial I / O module of this invention, while performing digital I / O acquisition and control functions, has built-in protocol conversion capabilities, eliminating the need for a separate gateway device. This invention embeds the protocol conversion function within the I / O module, enabling parallel operation of dual protocol stacks without mutual blocking, and features a standardized data mapping mechanism. Specifically, this invention embeds dual protocol stacks within a single microcontroller, achieving data interoperability between EtherCAT and Modbus RTU heterogeneous bus protocols through shared memory mapping. This invention solves the problems of existing EtherCAT to Modbus RTU conversion schemes, which require a separate gateway device leading to high costs, single MCU serial processing causing protocol mutual blocking, and lack of a standardized data mapping mechanism.

[0032] (2) This invention eliminates the need for a separate gateway: The EtherCAT to Modbus RTU protocol conversion function is embedded inside the IO module. The module has built-in protocol conversion capability while completing digital IO acquisition and control, eliminating the need for additional deployment of a separate gateway device, which significantly reduces system hardware costs, installation space, and wiring workload. Compared with the independent gateway solution, each IO node saves the cost of one gateway device.

[0033] (3) Dual protocol stack parallel non-blocking: Based on the FreeRTOS multi-task architecture, EtherCAT and Modbus communication tasks are triggered independently by different hardware interrupts (ESC external interrupt and UART receive interrupt), and are scheduled to run in parallel without blocking each other. Compared with the existing single-task serial processing scheme, the real-time performance of both protocols is guaranteed.

[0034] (4) Shared memory decoupling: Two communication tasks exchange data indirectly through a shared memory mapping table, eliminating the need for direct communication and thus removing coupling between tasks. The shared memory mapping table address is configured online via SDO, supporting flexible adjustment of the mapping relationship and adapting to different application scenarios without modifying the code.

[0035] (5) The present invention shortens the communication link: the data completes the protocol conversion directly inside the module, and only one conversion is needed to realize the data communication between EtherCAT and Modbus devices. Compared with the two conversions and two physical transmissions of the independent gateway solution, the communication delay is lower and the real-time performance is better.

[0036] (6) Unified configuration management: All configurations are managed uniformly through EtherCAT SDO, eliminating the need to configure EtherCAT network and Modbus network separately, thus reducing the complexity of system configuration and maintenance.

[0037] (7) Flexible protocol configuration: Supports RTU / ASCII dual mode, online switching between master / slave mode, and configurable baud rate and data format to meet the needs of different Modbus devices.

[0038] (8) State machine linkage protection: EtherCAT and Modbus communication state linkage ensures bus state consistency and avoids invalid communication in abnormal state. Attached Figure Description

[0039] Figure 1 This is a system architecture diagram of the industrial I / O module supporting dual protocol stack parallel communication according to the present invention;

[0040] Figure 2 A block diagram illustrating the principle of parallel operation of dual protocol stacks;

[0041] Figure 3 A flowchart illustrating the bidirectional data mapping between EtherCAT and Modbus;

[0042] Figure 4 This is the timing diagram for RS485 automatic directional control. Detailed Implementation

[0043] Example 1:

[0044] An industrial I / O module supporting dual-protocol stack parallel communication includes a microcontroller (MCU), an EtherCAT slave controller (ESC chip), an RS485 transceiver, and digital I / O circuitry.

[0045] (1) Dual protocol stack parallel operation architecture;

[0046] Multiple parallel tasks are created within the MCU based on the FreeRTOS real-time operating system. Among them, the EtherCAT communication task (priority +1, stack 1024 words) communicates with the ESC chip through the SPI interface to handle the PDO process data transmission and reception and SDO service data interaction of the EtherCAT protocol stack.

[0047] The Modbus communication task (priority +1, stack 1280 words) communicates with the RS485 transceiver via the UART interface, handling message parsing and responses for the Modbus RTU / ASCII protocol.

[0048] The two tasks are scheduled in parallel by the FreeRTOS scheduler, without blocking each other, ensuring the real-time performance of both bus protocols. The EtherCAT communication task is triggered by the ESC external interrupt semaphore, while the Modbus communication task is triggered by the UART receive interrupt semaphore, with independent interrupt responses.

[0049] Preferably, the ESC chip is a CF1106A, which communicates with the MCU via an SPI interface. The MCU is an HC32F452KETB (ARM Cortex-M4, 168MHz, 512KB Flash, 192KB RAM). The RS485 transceiver is connected to the MCU via a UART interface, and the UART is configured in DMA mode to reduce CPU usage.

[0050] (2) Shared memory mapping mechanism;

[0051] A shared memory mapping table is established in the MCU memory to map EtherCAT PDO process data to Modbus register data. The shared memory mapping table is divided into an input area (Modbus slave device data → EtherCAT master) and an output area (EtherCAT master → Modbus slave device). The two communication tasks exchange data by reading and writing to the corresponding areas of the shared memory mapping table, eliminating the need for direct communication and thus removing coupling between tasks. The address of the shared memory mapping table is configured online via SDO parameters, supporting flexible adjustment of the mapping relationship.

[0052] A multi-bus communication method, based on the aforementioned industrial I / O module, includes the following steps:

[0053] Step 1: Create parallel EtherCAT and Modbus communication tasks based on the FreeRTOS real-time operating system.

[0054] Step 2: Convert EtherCAT to Modbus downlink data stream;

[0055] When the EtherCAT master writes output PDO data, the EtherCAT communication task writes the data to the output area of ​​the shared memory mapping table; the Modbus communication task reads the data from the output area of ​​the shared memory mapping table in the next polling cycle and forwards it to the Modbus slave device through the Modbus RTU protocol (function code 0x06 write single register or 0x10 write multiple registers).

[0056] Step 3. Convert Modbus to EtherCAT uplink data stream;

[0057] The Modbus communication task polls the slave device (function code 0x03 read holding register) and writes the response data into the input area of ​​the shared memory mapping table; the EtherCAT communication task reports the input area data as input PDO to the EtherCAT master in the next PDO cycle.

[0058] Preferably, it features Modbus RTU / ASCII dual-mode adaptive operation;

[0059] Modbus communication supports both RTU and ASCII serial transmission modes, which can be switched via SDO configuration parameters. RTU mode uses CRC16 checksum (implemented using a lookup table, 256 bytes), while ASCII mode uses LRC checksum. The baud rate is configurable from 9600 to 115200 bps, and the data format supports 8N1 / 8E1 / 8O1 selectable.

[0060] Preferably, RS485 automatic direction control is used;

[0061] Since RS485 is a half-duplex communication, the MCU controls the DE / RE pins of the RS485 transceiver via GPIO pins to achieve direction switching. When transmitting data, the DE pin is pulled high to enable transmission and initiate UART DMA transmission. After transmission is complete, a timer precisely delays for 50 microseconds to ensure the last bit of data is transmitted completely, then the DE pin is pulled low to switch to receive mode, waiting for a response from the slave station. The direction switching timing is precisely controlled by a hardware timer.

[0062] Preferably, Modbus master-slave mode switching is performed online;

[0063] The module supports configuration as a Modbus master or slave. When acting as a master, the module actively polls Modbus slave devices, supporting function codes 0x01-0x17; when acting as a slave, the module responds to requests from external Modbus masters. Master / slave modes can be switched online via EtherCAT SDO configuration parameters without requiring a restart.

[0064] Preferably, the EtherCAT state machine is linked;

[0065] The Modbus communication state of the module is linked to the EtherCAT state machine. When EtherCAT enters the Operational state, the Modbus communication task is started; when EtherCAT enters the Safe-Operational state or a lower state, Modbus communication is paused to ensure consistency between the two bus protocols.

[0066] Example 2:

[0067] An industrial I / O module that supports parallel communication with dual protocol stacks, such as Figure 1 As shown, the MCU (HC32F452KETB, 168MHz, 512KB Flash, 192KB RAM) is connected to the EtherCAT slave controller (ESC chip, CF1106A) via an SPI interface. The CF1106A is connected to the EtherCAT network via a PHY chip (LY1210). The MCU is connected to an RS485 transceiver via a UART interface (DMA mode), and the RS485 transceiver is connected to a Modbus RTU bus. The MCU's GPIO pins are connected to digital I / O circuits (DI is extended via SPI, DO is extended via I2C).

[0068] A multi-bus communication method, based on the aforementioned industrial I / O module, uses EtherCAT to Modbus RTU master mode, such as... Figure 3 As shown, it includes the following steps:

[0069] Step 1: As Figure 2 As shown, FreeRTOS creates an EtherCAT communication task (InterBus_task, priority +1, stack 1024 words) and a Modbus communication task (Configuration_Task, priority +1, stack 1280 words). The two tasks exchange data through a shared memory mapping table.

[0070] The EtherCAT task handles PDO / SDO / FOE protocols and is triggered by an external ESC interrupt; the Modbus task handles Modbus RTU message transmission and reception and is triggered by a UART receive interrupt; and the LED task (priority +2) is responsible for status indication. The three tasks are scheduled in parallel without blocking each other.

[0071] Step 2: Downlink data flow: EtherCAT master sends out PDO data → EtherCAT communication task receives PDO → writes to the output area of ​​the shared memory mapping table (address 0x2000-0x20FF) → Modbus master task reads the output area → sends to the Modbus slave device via Modbus RTU function code 0x10 (write multiple registers) → slave executes control actions.

[0072] Step 3: Uplink data flow: The Modbus master task polls the slave device via function code 0x03 (read holding register) → the Modbus slave device returns response data → writes it to the input area of ​​the shared memory mapping table (address 0x2100-0x21FF) → the EtherCAT communication task reads the input area → reports it to the EtherCAT master as input PDO.

[0073] Preferably, such as Figure 4 As shown, the RS485 direction control is as follows: before sending a Modbus message, pull the DE pin of GPIO high to enable RS485 transmission and start UART DMA transmission; after transmission is completed, the hardware timer precisely delays for 50 microseconds to ensure that the last bit of data is sent completely (to avoid data truncation), and then pulls the DE pin low to switch to receive mode and waits for the slave station's response.

[0074] Preferably, EtherCAT to Modbus slave mode;

[0075] When the module is configured as a Modbus slave via SDO, it passively waits for requests from an external Modbus master. Upon receiving a read holding register request (function code 0x03), it reads data from the corresponding address in the input area of ​​the shared memory map and returns it. Upon receiving a write single register request (function code 0x06), it writes data to the corresponding address in the output area of ​​the shared memory map and triggers an EtherCAT task to report the updated data to the EtherCAT master. Master-slave mode switching is completed online via SDO write operations without requiring a module restart.

[0076] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications or equivalent changes made to the above embodiments based on the technical essence of the present invention shall fall within the protection scope of the present invention.

Claims

1. An industrial IO module supporting dual protocol stack parallel communication, characterized in that, It includes a microcontroller, an EtherCAT slave controller, an RS485 transceiver, and digital I / O circuitry; the microcontroller is connected to the EtherCAT slave controller, the RS485 transceiver, and the digital I / O circuitry respectively; the EtherCAT slave controller is used to connect to the EtherCAT master station, and the RS485 transceiver is connected to the Modbus RTU slave device. The microcontroller has a built-in real-time operating system, which is used to create independently scheduled EtherCAT communication tasks and Modbus communication tasks; the microcontroller also includes a shared memory mapping table, through which EtherCAT communication tasks and Modbus communication tasks exchange data. The EtherCAT communication task is used to process EtherCAT protocol data and write or read the data into the shared memory mapping table; the Modbus communication task is used to process Modbus protocol data and send requests to Modbus RTU slave devices or return responses based on the data in the shared memory mapping table.

2. The industrial IO module of claim 1, wherein, The microcontroller is connected to the EtherCAT slave controller via the SPI interface; the microcontroller communicates with the RS485 transceiver via the UART interface; and the microcontroller controls the DE / RE pins of the RS485 transceiver via the GPIO pins to control the switching of RS485 communication direction.

3. The industrial IO module of claim 1, wherein, The EtherCAT slave controller is CF1106A, and the microcontroller is HC32F452KETB.

4. The industrial IO module of any one of claims 1-3, wherein, The shared memory mapping table is divided into an input area and an output area; the input area is used to store the mapping data from Modbus slave devices to EtherCAT master devices; the output area is used to store the mapping data from EtherCAT master devices to Modbus slave devices.

5. The industrial IO module of claim 1, wherein, The microcontroller is also equipped with a state linkage module, which is used to monitor the state machine of the EtherCAT communication task and link the Modbus communication state with the EtherCAT state machine. When EtherCAT enters the Operational state, the Modbus communication task is started. When EtherCAT enters the Safe-Operational state or a lower state, the Modbus communication is paused to ensure the consistency of the states of the two bus protocols.

6. The industrial IO module of claim 1, wherein, The microcontroller is also configured to receive configuration commands via the EtherCAT SDO service to switch the operating mode of the Modbus communication task online; when switched to Modbus slave mode, the Modbus communication task performs the following operations: In response to a read request from an external Modbus master, read data from the input area of ​​the shared memory map table and return it; In response to a write request from an external Modbus master, data is written to the output area of ​​the shared memory mapping table, and an EtherCAT communication task is triggered to report the updated data to the EtherCAT master.

7. A multi-bus communication method based on the industrial IO module supporting parallel communication of double protocol stacks according to any one of claims 1-6, characterized in that, Includes the following steps: Step S1: Initialize the real-time operating system and create parallel EtherCAT and Modbus communication tasks; Step S2: Based on the output area of ​​the shared memory mapping table, implement the data exchange between the EtherCAT master station and the Modbus slave station device; Step S21: When the EtherCAT master station sends out PDO data, the EtherCAT communication task receives the PDO and writes the PDO data into the output area of ​​the shared memory mapping table. Step S22: In response to an update event or the arrival of a polling cycle, the Modbus communication task reads data from the output area of ​​the shared memory mapping table and forwards it to the Modbus slave device via the Modbus RTU protocol, and the slave device executes control actions; Step S3: Based on the input area of ​​the shared memory mapping table, implement the data exchange between Modbus slave devices and EtherCAT master station; Step S31: The Modbus communication task polls the slave device and writes the response data returned by the slave device into the input area of ​​the shared memory mapping table; Step S32: In the next PDO cycle, the EtherCAT communication task reports the input area data as input PDO to the EtherCAT master station.

Citation Information

Patent Citations

  • Gateway for EtherCAT (Ethernet for control and automation technology) and RS485 communication switching

    CN202353595U