Data transmission method and system of EtherCAT coupled slave station

Through the combination of private protocol and serial peripheral interface, EtherCAT slave devices conduct efficient data transmission with different types of IO modules, solving the problems of low data transmission efficiency and high cost in the prior art, and realizing processing within an EtherCAT cycle The efficiency and low cost of various types of data.

CN119011331BActive Publication Date: 2024-12-20HIGERMAN CNC TECH SHENZHEN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411483029.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2024-12-20
Estimated Expiration
2044-10-23

AI Technical Summary

Technical Problem

Existing EtherCAT slave devices cannot efficiently and at low cost to transmit data with different types of IO modules, resulting in high cost and low efficiency.

Method used

Through the use of a private protocol and two sets of serial peripheral interfaces between the main IO module and the EtherCAT slave module, the main IO module sends and receives data in number order according to the predefined slave module information, and the EtherCAT slave module updates the module object Dictionary and data transmission is carried out through the EtherCAT bus, realizing data reading and writing of multiple IO modules of different types.

Benefits of technology

It realizes the processing of multiple different types of IO module data simultaneously in one EtherCAT processing cycle, which improves processing efficiency and reduces cost requirements, and avoids the need to use multiple EtherCAT slave devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119011331B_ABST
    Figure CN119011331B_ABST
Patent Text Reader

Abstract

The invention discloses a data transmission method and system for an EtherCAT coupled slave station. The invention connects a plurality of slave IO modules of different types to a master IO module through a private protocol, and the master IO module aggregates the data of the plurality of slave IO modules, and communicates with the EtherCAT slave station module through two groups of serial peripheral interfaces. After the EtherCAT master station completes data processing, the master IO module divides the data of different types so as to subsequently forward the data to different slave IO modules, so that the EtherCAT master station can process the data of a plurality of IO modules of different types in one EtherCAT processing cycle at the same time, which has high processing efficiency and low cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial control, and in particular to a data transmission method and system for an EtherCAT coupled slave station. Background Art

[0002] With the development of industry and Ethernet technology, the industrial control industry has higher and higher requirements for the responsiveness of system control, and EtherCAT technology has been widely used in industrial Ethernet solutions. Among them, EtherCAT slave devices must rely on the high-cost slave chip "ESC", so how to couple other types of device modules to the same slave device is a popular research direction. At present, there is an official MDP model as a reference for coupling multiple module data to the EtherCAT bus, but because the E-BUS protocol used between Beckhoff's slave coupling device and the module is not open, the existing EtherCAT bus needs to be connected to multiple different types of IO modules through EtherCAT slave devices, but the existing EtherCAT slave devices are set to communicate only with the same type of IO modules. Therefore, if the EtherCAT bus needs to be used to process multiple IO module data, multiple EtherCAT slave devices need to be configured accordingly, which is not only costly, but also has low data transmission efficiency. Therefore, how to achieve efficient and low-cost data transmission between EtherCAT slave devices and other modules has become an objective demand. Summary of the invention

[0003] The invention provides a data transmission method of an EtherCAT coupled slave station, which is used to solve the problems of non-open protocols, low data transmission efficiency and high cost between existing EtherCAT slave station devices and IO modules of different protocol types.

[0004] The invention also provides a data transmission system of an EtherCAT coupled slave station.

[0005] To achieve the purpose of the present invention, the present invention provides a data transmission method of an EtherCAT coupled slave station, the method comprising the following steps:

[0006] When the master IO module receives the EtherCAT slave module read command, the master IO module sends the slave module information to the EtherCAT slave module through the second serial peripheral interface according to the predefined slave module information of each slave IO module and in the order of numbering;

[0007] The EtherCAT slave module receives the slave module information and updates the module object dictionary in the sequence of numbers;

[0008] The master IO module sends the data of each slave IO module to the EtherCAT slave module through the first serial peripheral interface;

[0009] The EtherCAT slave module sends the received data to the EtherCAT master module;

[0010] When the EtherCAT master module sends a write command to the multiple slave IO modules, the EtherCAT master module sends the data to the EtherCAT slave modules;

[0011] The EtherCAT slave module generates write data for each slave IO module according to the numbering sequence in the updated module object dictionary, and sends the write data to the master IO module through the first serial peripheral interface;

[0012] The master IO module writes each data into each slave IO module according to a preset serial number sequence.

[0013] In some embodiments, when the master IO module receives the EtherCAT slave module read command, the master IO module sends the slave module information to the EtherCAT slave module through the second serial peripheral interface in the order of numbers according to the predefined slave module information of each slave IO module.

[0014] The slave module information of the slave IO module includes a module type, an output byte length, and an input byte length of the slave IO module.

[0015] Furthermore, the data length of the slave module information of the slave IO module consists of the number of bytes, and the input byte length and / or output byte length of slave IO modules of different module types are different.

[0016] Furthermore, if the output byte length is smaller than the input byte length, the output byte length is padded with 0; if the input byte length is smaller than the output byte length, the input byte length is padded with 0.

[0017] In some embodiments, the step of the master IO module sending the data of each slave IO module to the EtherCAT slave module through the first serial peripheral interface includes:

[0018] The master IO module obtains the data of each slave IO module to be read through a private protocol, and sends the data to the EtherCAT slave module through the first serial peripheral interface in the order of numbers.

[0019] In some embodiments, the EtherCAT slave module generates write data for each slave IO module according to the order of numbers in the updated module object dictionary, and sends the write data to the master IO module through the first serial peripheral interface, comprising:

[0020] The EtherCAT slave module receives data sent by the EtherCAT master module through the EtherCAT bus, generates write data for each slave IO module according to the numbering sequence in the updated module object dictionary, and then sends the generated write data to the master IO module through the first serial peripheral interface in the numbering sequence.

[0021] Furthermore, the EtherCAT slave module completes data transmission and reception of the serial peripheral interface through direct memory storage.

[0022] In some embodiments, the step of the master IO module writing each data into each slave IO module according to a preset serial number sequence includes:

[0023] The master IO module obtains data sent by the EtherCAT slave module through the first serial peripheral interface, and writes the received data into each slave IO module according to a preset numbering sequence.

[0024] The present invention also provides a data transmission system for EtherCAT coupled slave stations, the system comprising a main IO module and an EtherCAT slave station module communicating through two sets of serial peripheral interfaces,

[0025] The master IO module is connected to multiple slave IO modules through a private protocol, and communicates with the EtherCAT slave module through two sets of serial peripheral interfaces. The master IO module predefines slave module information of multiple slave IO modules, and sends the slave module information to the EtherCAT slave module through the second serial peripheral interface in a numbered order; at the same time, according to the instruction sent by the EtherCAT slave module, the master IO module transmits data with the EtherCAT slave module through the first serial peripheral interface to realize data reading or writing of multiple slave IO modules;

[0026] The EtherCAT slave module is connected to the EtherCAT master module via an EtherCAT bus, receives slave module information of each slave IO module sent by the master IO module via the second serial peripheral interface and updates the module object dictionary in numerical order; sends a read or write instruction to the master IO module via the first serial peripheral interface, obtains data of multiple slave IO modules via the master IO module or sends data to multiple slave IO modules, and simultaneously receives data from the EtherCAT master module and sends data to the EtherCAT master module.

[0027] Furthermore, the slave module information of the plurality of slave IO modules predefined by the master IO module includes a module type, an output byte length, and an input byte length of the slave IO module.

[0028] The beneficial effects of the present invention are as follows: the present invention connects a plurality of slave IO modules of different protocol types to a master IO module through a private protocol, the master IO module aggregates the data of the plurality of slave IO modules, and communicates with the EtherCAT slave module through two sets of serial peripheral interfaces, and after the EtherCAT master station completes data processing, the master IO module divides the data of different types so as to subsequently forward them to different slave IO modules, so that the EtherCAT master station can simultaneously process the data of a plurality of different types of IO modules in one EtherCAT processing cycle, which has high processing efficiency and low cost.

[0029] On the other hand, the present invention predefines the slave module information of slave IO modules of different module types through the main IO module and sets numbers, and the slave module information of each slave IO module is set with corresponding input and output byte lengths, so that the corresponding input content and output content can be directly obtained based on the number, further improving the efficiency of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a flow chart of the method of embodiment 1 of the present invention.

[0031] Figure 2 It is a communication timing diagram of the present invention.

[0032] Figure 3 It is a system block diagram of embodiment 2 of the present invention.

[0033] Figure 4 It is a schematic diagram of the hardware structure of embodiment 2 of the present invention. DETAILED DESCRIPTION

[0034] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0035] Example 1

[0036] See also Figure 1 The data transmission method of the EtherCAT coupled slave station of the present invention is used for transmitting data between a plurality of different types of slave IO modules and an EtherCAT master station module, and comprises the following steps:

[0037] S10. When the master IO module receives the EtherCAT slave module read command, the master IO module sends the slave module information to the EtherCAT slave module through the second serial peripheral interface according to the predefined slave module information of each slave IO module and in the order of numbering.

[0038] In this step, the master IO module and the slave IO module are connected through a private protocol. The master IO module can detect the module type (protocol type) and sequence of each slave IO module through the private protocol, that is, the data of multiple slave IO modules can be directly sent and received with one master IO module through the private protocol. Figure 2 As shown, the master IO module communicates with the EtherCAT slave module through two sets of serial peripheral interfaces, wherein the first serial peripheral interface is used for data exchange, and the second serial peripheral interface is used for updating the order of the slave IO module and establishing a channel command. In this embodiment, the EtherCAT slave module is the host and the master IO module is the slave. When the master IO module receives the read command of the EtherCAT slave module, the master IO module predefines the slave module information of the slave IO module to be read according to the read command, and sends the slave module information to the EtherCAT slave module through the second serial peripheral interface in the order of numbering.

[0039] Specifically, the slave module information of the slave IO module defined by the master IO module includes the module type, output byte length, and input byte length of the slave IO module. Among them, the data length of the slave module information of the slave IO module consists of the number of bytes, and the input byte length and / or output byte length of the slave IO modules of different module types are different. Therefore, the type of the corresponding slave IO module and the read data and write data of each type can be directly obtained based on the number. For example, the slave module information of the slave IO module can be defined as:

[0040]

[0041] In this embodiment, the slave IO module that reads the 4832 digital module, the 2416 digital module and the 4*DA analog module is taken as an example. After receiving the read command, the master IO module generates numbers 02.01.04 respectively, and generates the input and output byte numbers of each type accordingly. Among them, the input byte number of the 4832 digital module numbered 02 is 6 bytes, and the output byte number is 4 bytes. The master IO module then sends the number 02.01.04 to the EtherCAT slave module through the second serial peripheral interface.

[0042] S20, the EtherCAT slave module receives the slave module information sent by the master IO module, and updates the module object dictionary in numerical order.

[0043] In this step, the EtherCAT slave module receives the slave module information and numbering sequence sent by the master IO module through the second serial peripheral interface, and after confirming that it is normal with the master IO module, updates the module object dictionary in the numbering sequence. Among them, the number in the slave module information updated by the EtherCAT slave module is the same as the type and name of the number generated by the master IO module to ensure the consistency of data transmission. For example: when the EtherCAT slave module receives the slave module information numbered 02.01.04, the updated slave module information is:

[0044]

[0045] Since the full-duplex communication of the serial peripheral interface requires length alignment, that is, when reading a byte of data, a byte of data must be sent at the same time. Therefore, if the output byte length is greater than the input byte length, the input data needs to be padded with 0 to the output byte length; similarly, if the input byte length is greater than the output byte length, the output data needs to be padded with 0 to the input byte length to meet the communication requirements of the full-duplex serial peripheral interface.

[0046] S30. The master IO module sends the data of each slave IO module to the EtherCAT slave module through the first serial peripheral interface.

[0047] In this step, the master IO module obtains the data of each slave IO module to be read through a private protocol, and sends the obtained data to the EtherCAT slave module through the first serial peripheral interface in the order of numbers. For example, the master IO module sends the data of each slave IO module to the EtherCAT slave module in the order of numbers 02.01.04, and the byte numbers are 6 bytes, 4 bytes, and 0 bytes respectively.

[0048] S40, the EtherCAT slave module sends the received data to the EtherCAT master module.

[0049] In this step, if Figure 2 As shown, the EtherCAT slave module receives data sent by the main IO module through the first serial peripheral interface, wherein the master control of the EtherCAT slave module completes the sending and receiving of serial peripheral interface data through direct memory storage, and its core only consumes the time of data copying, which can better improve the utilization rate of dual channels compared with the chip select one-to-many serial peripheral interface. When the EtherCAT slave module receives the data, it uses the standard EtherCAT protocol to send the data to the EtherCAT master module through the EtherCAT bus for processing.

[0050] S50. When the EtherCAT master module sends a write command to the multiple slave IO modules, the EtherCAT master module sends the data to the EtherCAT slave modules.

[0051] In this step, after the EtherCAT master module processes the data, it sends the processed data to the EtherCAT slave module through the EtherCAT bus. At this time, the EtherCAT master module regards the EtherCAT slave module, the main IO module connected to the EtherCAT slave module, and multiple slave IO modules as a whole.

[0052] S60, the EtherCAT slave module generates write data for each slave IO module and sends the write data to the master IO module.

[0053] In this step, if Figure 2 As shown, the EtherCAT slave module receives the data sent by the EtherCAT master module, generates write data for each slave IO module according to the numbering sequence in the updated module object dictionary, and then sends the generated write data to the master IO module through the first serial peripheral interface. For example, the EtherCAT slave module generates write data in the order of numbering 02.01.04, and the byte counts are 4 bytes, 2 bytes, and 8 bytes, respectively.

[0054] S70. The master IO module writes each data into each slave IO module according to a preset serial number sequence.

[0055] In this step, if Figure 2 As shown, the master IO module obtains the data sent by the EtherCAT slave module through the first serial peripheral interface, and writes the received data into each slave IO module according to the preset numbering sequence, so as to realize processing of multiple different types of data in one EtherCAT processing cycle, thereby completing an EtherCAT bus data transmission cycle. At the same time, the master IO module generates the number of the next batch of communication data, and repeats the cycle to realize processing of multiple different types of slave IO module data in one EtherCAT processing cycle.

[0056] In this embodiment, the EtherCAT slave module communicates with the master IO module through two sets of serial peripheral interfaces, wherein the clock rate of the two serial peripheral interfaces can reach 20Mbits / s. Assuming that the master IO module is connected to 100 4832 digital modules, the serial peripheral interface needs to exchange 6*100 bytes of data, and the time taken is (600*8 / 20000000) = 0.24ms, which can fully meet the real-time requirements for most EtherCAT cycle buses of 1ms.

[0057] Example 2

[0058] See also Figure 3 The data transmission system of the EtherCAT coupled slave station of this embodiment is used for transmitting data between multiple different types of slave IO modules and the EtherCAT master station module. The system includes a master IO module 10 and an EtherCAT slave station module 20.

[0059] like Figure 3 As shown, the master IO module 10 is connected to multiple slave IO modules 30. In this embodiment, the master IO module 10 communicates with multiple slave IO modules 30 through a private protocol, that is, the data of multiple slave IO modules 30 can be directly sent and received with one master IO module 10 through a private protocol. The master IO module 10 obtains the module type and order of each slave IO module 30 through a private protocol, and predefines the slave module information and number of each slave IO module 30. Specifically, the slave module information of each slave IO module 30 defined by the master IO module 10 includes the module type, output byte length and input byte length of the slave IO module. The data length of the slave module information consists of the number of bytes, and the input byte length and / or output byte length of slave IO modules of different module types are different. Therefore, the module type of the corresponding slave IO module 30 and the read data and write data of each module type can be directly obtained based on the number. The master IO module 10 is also used to send data to each slave IO module 30.

[0060] The EtherCAT slave module 20 is connected to the EtherCAT master module 40 via the EtherCAT bus, and is used to receive data sent by the EtherCAT master module 40 or send data to the EtherCAT master module 40. The EtherCAT slave module 20 communicates with the main IO module 10 via two sets of serial peripheral interfaces. Figure 4 As shown, the main IO module 10 is provided with a master FPGA, and the EtherCAT slave module 20 is provided with a master ARM. The FPGA and the ARM are connected through two sets of serial peripheral interfaces, and the ARM is the host and the FPGA is the slave. The ARM uses a direct memory storage method to complete the data transmission and reception of the serial peripheral interface. Its core only consumes the time of data copying, which can better improve the utilization rate of the dual channels compared to the one-to-many serial peripheral interface of the chip selection. Among them, in the two sets of serial peripheral interfaces, the first serial peripheral interface is used for data exchange, and the second serial peripheral interface is used for sequential updates and channel establishment commands from the IO module 30.

[0061] like Figure 2As shown, when the EtherCAT master module 40 needs to read the data of multiple slave IO modules 30, the EtherCAT master module 40 sends a read data command to the master IO module 10 through the EtherCAT slave module 20. When the master IO module 10 receives the read data command, it predefines the slave module information of each slave IO module 30, and then sends the slave module information to the EtherCAT slave module 20 through the second serial peripheral interface in the order of numbers. After receiving the slave module information, the EtherCAT slave module 20 stores the slave module information in the order of numbers and updates the module object dictionary. The master IO module 10 sends the data of each slave IO module to the EtherCAT slave module 20 through the first serial peripheral interface in the order of numbers. The EtherCAT slave module 20 then sends the received data to the EtherCAT master module 40, and the EtherCAT master module 40 completes the reading of the data of multiple slave IO modules 30.

[0062] When the EtherCAT master station module 40 needs to write data to multiple slave IO modules 30, the EtherCAT master station module 40 sends the write data to the EtherCAT slave station module 20. After receiving the data, the EtherCAT slave station module 20 generates write data for each slave IO module according to the numbering sequence in the updated module object dictionary, and sends the generated write data to the master IO module through the first serial peripheral interface in the numbering sequence. After receiving the data, the master IO module 10 writes each data to each slave IO module 30 according to the preset numbering sequence, thereby completing the EtherCAT master station module 40 writing data to multiple slave IO modules 30.

[0063] In summary, the data transmission system of the EtherCAT coupled slave station of the present embodiment connects multiple different types of slave IO modules 30 to the master IO module 10 through a private protocol, and the master IO module 10 aggregates the data of the multiple slave IO modules 30. After the EtherCAT master station module 40 has processed the data, the master IO module 10 divides the different types of data and sends them to different slave IO modules 30, thereby realizing the simultaneous processing of multiple different types of data in one EtherCAT processing cycle, which not only has high processing efficiency, but also does not require the use of multiple EtherCAT slave station devices, greatly reducing costs.

[0064] On the other hand, this embodiment predefines the slave module information of the slave IO modules 30 of different module types through the main IO module 10, and the device number, and the slave module information of each slave IO module is set with the corresponding input and output byte length, so that the corresponding input content and output content can be directly obtained based on the number, further improving the efficiency of data transmission.

[0065] Although the present invention is disclosed through the above embodiments, the protection scope of the present invention is not limited thereto. Without departing from the concept of the present invention, any deformation, replacement, etc. made to the above components shall fall within the scope of the claims of the present invention.

Claims

1. A data transmission method for an EtherCAT coupled slave station, characterized in that: The method comprises the following steps: When the master IO module receives the EtherCAT slave module read command, the master IO module sends the slave module information to the EtherCAT slave module through the second serial peripheral interface according to the predefined slave module information of each slave IO module and in the order of numbering; The EtherCAT slave module receives the slave module information and updates the module object dictionary in the sequence of numbers; The master IO module sends the data of each slave IO module to the EtherCAT slave module through the first serial peripheral interface; The EtherCAT slave module sends the received data to the EtherCAT master module; When the EtherCAT master module sends a write command to the multiple slave IO modules, the EtherCAT master module sends the data to the EtherCAT slave modules; The EtherCAT slave module generates write data for each slave IO module according to the numbering sequence in the updated module object dictionary, and sends the write data to the master IO module through the first serial peripheral interface; The master IO module writes each data into each slave IO module according to a preset serial number sequence.

2. The method according to claim 1, characterized in that When the master IO module receives the EtherCAT slave module read command, the master IO module sends the slave module information to the EtherCAT slave module through the second serial peripheral interface according to the predefined slave module information of each slave IO module and in the order of numbering, The slave module information of the slave IO module includes a module type, an output byte length, and an input byte length of the slave IO module.

3. The method according to claim 2, characterized in that The data length of the slave module information of the slave IO module consists of the number of bytes, and the input byte length and / or output byte length of slave IO modules of different module types are different.

4. The method according to claim 3, characterized in that If the output byte length is less than the input byte length, the output byte length is padded with 0; if the input byte length is less than the output byte length, the input byte length is padded with 0.

5. The method according to claim 1, characterized in that The step of the master IO module sending the data of each slave IO module to the EtherCAT slave module through the first serial peripheral interface includes: The master IO module obtains the data of each slave IO module to be read through a private protocol, and sends the data to the EtherCAT slave module through the first serial peripheral interface in the order of numbers.

6. The method according to claim 1, characterized in that The steps of the EtherCAT slave module generating write data for each slave IO module according to the numbering sequence in the updated module object dictionary and sending the write data to the master IO module through the first serial peripheral interface include: The EtherCAT slave module receives data sent by the EtherCAT master module through the EtherCAT bus, generates write data for each slave IO module according to the numbering sequence in the updated module object dictionary, and then sends the generated write data to the master IO module through the first serial peripheral interface in the numbering sequence.

7. The method according to claim 6, characterized in that The EtherCAT slave module completes the data transmission and reception of the serial peripheral interface through direct memory storage.

8. The method according to claim 1, characterized in that The step of the master IO module writing each data into each slave IO module according to a preset serial number sequence comprises: The master IO module obtains data sent by the EtherCAT slave module through the first serial peripheral interface, and writes the received data into each slave IO module according to a preset numbering sequence.

9. A data transmission system for EtherCAT coupled slave stations, characterized in that: The system includes a master IO module and an EtherCAT slave module that communicate through two sets of serial peripheral interfaces. The master IO module is connected to multiple slave IO modules through a private protocol, and communicates with the EtherCAT slave module through two sets of serial peripheral interfaces. The master IO module predefines slave module information of multiple slave IO modules, and sends the slave module information to the EtherCAT slave module through the second serial peripheral interface in a numbered order; at the same time, according to the instruction sent by the EtherCAT slave module, the master IO module transmits data with the EtherCAT slave module through the first serial peripheral interface to realize data reading or writing of multiple slave IO modules; The EtherCAT slave module is connected to the EtherCAT master module via an EtherCAT bus, receives slave module information of each slave IO module sent by the master IO module via the second serial peripheral interface and updates the module object dictionary in numerical order; sends a read or write instruction to the master IO module via the first serial peripheral interface, obtains data of multiple slave IO modules via the master IO module or sends data to multiple slave IO modules, and simultaneously receives data from the EtherCAT master module and sends data to the EtherCAT master module.

10. The data transmission system of the EtherCAT coupled slave station according to claim 9, characterized in that: The slave module information of the plurality of slave IO modules predefined by the master IO module includes the module type, output byte length and input byte length of the slave IO module.