Method and device for real-time network communication between Power master station and EtherCAT slave station, medium and product
Through clock synchronization and data message conversion, the problem of poor interoperability between Powerlink and EtherCAT protocols is solved, seamless data transmission between the two networks in the industrial automation system is achieved, and the real-time performance and compatibility of the system are improved.
Patent Information
- Application Number
- CN202411177104.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-10-29
AI Technical Summary
Limited interoperability between the two industrial Ethernet protocols, Powerlink and EtherCAT, makes data conversion and communication difficult in different network environments.
By obtaining and converting clock synchronization messages between protocols, clock synchronization between Powerlink and EtherCAT networks is achieved, and data messages are converted according to the format of the respective protocols to ensure seamless data transmission between the two networks.
It realizes real-time data exchange between Powerlink and EtherCAT networks, reduces data loss and retransmission caused by delay, improves message transmission rate and system efficiency, and ensures data reliability and compatibility.
Smart Images

Figure CN118869174A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication protocol technology, and in particular to a method, device, medium, and product for real-time network communication between a Powelink master station and an EtherCAT slave station. Background Art
[0002] With the rapid development of industrial automation, real-time Ethernet communication protocols have become the key to achieving efficient and precise control. As two leading industrial Ethernet protocols, Powerlink and EtherCAT are widely used in automation control systems with their excellent performance. Powerlink is suitable for high-demand synchronization control scenarios with its high real-time performance and strong synchronization capabilities. EtherCAT is suitable for large-scale distributed control systems with its ultra-low latency and high efficiency.
[0003] However, although both protocols provide efficient communication solutions, their interoperability is limited by their respective protocol specifications and implementation methods. When the two protocols run in different network environments, that is, a network using the Powerlink protocol and a network using the EtherCAT protocol, it is difficult to convert and communicate data between the two networks. Summary of the invention
[0004] In view of this, the embodiments of the present disclosure provide a method, device, medium, and product for real-time network communication between a Powerlink master station and an EtherCAT slave station, which can achieve clock synchronization between the Powerlink and EtherCAT networks, and then complete the message intercommunication between the two networks, realizing YY+242211P
[0005] Cross-network transmission of current messages.
[0006] In a first aspect, the embodiment of the present disclosure provides a method for real-time network communication between a Powelink master station and an EtherCAT slave station, using the following technical solution:
[0007] Obtaining a synchronization message that complies with the Powerlink protocol and is sent by a first master station, where the first master station is a master station of the Powerlink network;
[0008] Transmitting the content in the synchronization message to the first slave station, performing clock synchronization on the first master station and the first slave station, wherein the first slave station is a slave station of the EtherCAT network;
[0009] After the clock synchronization is completed, obtaining a first data message that complies with the Powerlink protocol and is sent by the first master station;
[0010] Convert the first data message into a second data message that complies with the EtherCAT protocol and send it to the first slave station;
[0011] Obtaining a third data message compliant with the EtherCAT protocol sent by the first slave station;
[0012] The third data message is converted into a fourth data message that complies with the Powerlink protocol and sent to the first master station.
[0013] Optionally, transmitting the content in the synchronization message to the first slave station includes:
[0014] Each second slave station corresponds to a number of first slave stations, and the second slave stations are slave stations of the Powerlink network;
[0015] The synchronization message is sent to each second slave station, and each second slave station converts the received synchronization message into a calibration message that complies with the EtherCAT protocol, and sends the calibration message to the corresponding first slave station.
[0016] Optionally, the performing clock synchronization on the first master station and the first slave station includes:
[0017] Calculating a clock deviation based on the clock time of the first master station included in the calibration message;
[0018] Clock synchronization is performed on the first master station and the first slave station based on the clock deviation.
[0019] Optionally, converting the first data message into a second data message that complies with the EtherCAT protocol includes:
[0020] The byte length of the first data message is N, and the N bytes consist of N1 specified length bytes, N2 valid bytes and N3 null bytes;
[0021] Based on the N1 bytes of specified length, obtaining the length of valid data of the second data message;
[0022] Extracting valid data of the second data message from the N2 valid bytes based on the length of the valid data of the second data message;
[0023] An EtherCAT protocol message is created, and valid data of the second data message is mapped to a valid load area of the EtherCAT protocol message to generate the second data message.
[0024] Optionally, converting the third data message into a fourth data message that complies with the Powerlink protocol includes:
[0025] The total length of the third data message is the same as the total length of the second data message;
[0026] Acquire valid data of the third data message, where the length of the valid data of the third data message is less than the byte length of the first data message;
[0027] A Powerlink protocol message is created, and valid data of the third data message is mapped to a valid load area of the Powerlink protocol message to generate the fourth data message.
[0028] Optionally, the method for real-time network communication between the Powelink master station and the EtherCAT slave station further includes:
[0029] The total value of the hardware dial switch is used to control the byte length of the first data message, and the corresponding relationship between the total value of the dial switch and the byte length of the first data message is:
[0030] Z = (N - Lo) / L;
[0031] Among them, Z is the total toggle value of the hardware toggle switch; N is the byte length of the first data message; Lo is the corresponding first data message length value when the toggle value of the hardware toggle switch is 0; L is the number of bytes increased by the length of the first data message when the toggle value of the hardware toggle switch increases by 1.
[0032] Optionally, the method for real-time network communication between the Powelink master station and the EtherCAT slave station further includes:
[0033] The second slave station communicates using an FPGA mechanism;
[0034] The network port controlled by the ARM CPU is used as the message transmission interface between the Powerlink network and the EtherCAT network.
[0035] In a second aspect, the disclosed embodiment further provides a system for real-time network communication between a Powelink master station and an EtherCAT slave station, which adopts the following technical solution:
[0036] A synchronization message acquisition module, used to acquire a synchronization message compliant with the Powerlink protocol sent by a first master station, wherein the first master station is a master station of the Powerlink network;
[0037] A network clock synchronization module, used for transmitting the content in the synchronization message to the first slave station, and performing clock synchronization on the first master station and the first slave station, wherein the first slave station is a slave station of the EtherCAT network;
[0038] A first data message acquisition module, used for acquiring a first data message compliant with the Powerlink protocol sent by the first master station after clock synchronization is completed;
[0039] A first data message conversion module is used to convert the first data message into a second data message that complies with the YY+242211PEtherCAT protocol and send it to the first slave station;
[0040] A third data message acquisition module, used to acquire a third data message compliant with the EtherCAT protocol sent by the first slave station;
[0041] The third data message conversion module is used to convert the third data message into a fourth data message that complies with the Powerlink protocol and send it to the first master station.
[0042] In a third aspect, the embodiments of the present disclosure further provide a computer device, which adopts the following technical solution:
[0043] The computer device comprises:
[0044] at least one processor; and,
[0045] a memory communicatively connected to the at least one processor; wherein,
[0046] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the above-mentioned methods for real-time network communication between a Powelink master station and an EtherCAT slave station.
[0047] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute any of the above-mentioned methods for real-time network communication between a Powelink master station and an EtherCAT slave station.
[0048] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program / instruction, which implements the steps of any of the above methods when executed by a processor.
[0049] The method for real-time network communication between the Powerlink master station and the EtherCAT slave station provided in the embodiment of the present disclosure ensures that the message exchange between the Powerlink and EtherCAT networks can be carried out in real time through precise clock synchronization, meeting the real-time requirements of industrial automation, and effectively reducing data loss and retransmission caused by delays, improving the effective transmission rate of messages and the overall efficiency of the system. The synchronized network clock can reduce data inconsistency caused by clock drift, which helps to improve data reliability. By converting the first data message that complies with the Powerlink protocol into the second data message that complies with the EtherCAT protocol, the message transmission from the Powerlink network to the EtherCAT network is completed. After the EtherCAT network responds, the message transmission from the EtherCAT network to the Powerlink network is completed by converting the third data message that complies with the EtherCAT protocol into the fourth data message that complies with the Powerlink protocol. This method allows seamless transmission of messages between networks with two different protocols, Powerlink and EtherCAT, breaking the data exchange barriers between traditional networks.
[0050] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0052] Figure 1 A flow chart of a method for real-time network communication between a Powelink master station and an EtherCAT slave station provided in an embodiment of the present disclosure;
[0053] Figure 2 A schematic diagram of a gateway system provided in an embodiment of the present disclosure;
[0054] Figure 3 A schematic diagram of a message transmission path provided in an embodiment of the present disclosure;
[0055] Figure 4 A schematic diagram of a process of converting a Powerlink protocol message into an EtherCAT protocol message provided in an embodiment of the present disclosure;
[0056] Figure 5 A schematic diagram of a process of converting an EtherCAT protocol message into a Powerlink protocol message provided in an embodiment of the present disclosure;
[0057] Figure 6 A principle block diagram of a system for real-time network communication between a Powelink master station and an EtherCAT slave station provided in an embodiment of the present disclosure;
[0058] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0059] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0060] It should be clear that the following embodiments of the present disclosure are described by specific specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other in the absence of conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0061] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0062] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0063] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0064] Reference Figure 1 The present invention provides a method for real-time network communication between a Powelink master station and an EtherCAT slave station, comprising the following steps:
[0065] S1: Obtain the synchronization message compliant with the Powerlink protocol sent by the first master station.
[0066] Among them, the first master station is the master station of the Powerlink network.
[0067] S2: Transmit the content in the timing message to the first slave station, and synchronize the clocks of the first master station and the first slave station.
[0068] The first slave station is a slave station of the EtherCAT network.
[0069] S3: After the clock synchronization is completed, a first data message compliant with the Powerlink protocol and sent by the first master station is obtained.
[0070] S4: Convert the first data message into a second data message that complies with the EtherCAT protocol and send it to the first slave station.
[0071] YY+242211P
[0072] S5: Acquire a third data message that complies with the EtherCAT protocol and is sent by the first slave station.
[0073] S6: Convert the third data message into a fourth data message that complies with the Powerlink protocol and send it to the first master station.
[0074] The disclosed method of real-time network communication between the Powerlink master station and the EtherCAT slave station ensures that the message exchange between the Powerlink and EtherCAT networks can be carried out in real time through precise clock synchronization, meeting the real-time requirements of industrial automation, and effectively reducing data loss and retransmission due to time delays, thereby improving the effective transmission rate of messages and the overall efficiency of the system. The synchronized network clock can reduce data inconsistency caused by clock drift, which helps to improve data reliability.
[0075] The message transmission from the Powerlink network to the EtherCAT network is completed by converting the first data message conforming to the Powerlink protocol into the second data message conforming to the EtherCAT protocol. After the EtherCAT network responds, the message transmission from the EtherCAT network to the Powerlink network is completed by converting the third data message conforming to the EtherCAT protocol into the fourth data message conforming to the Powerlink protocol. This method allows seamless transmission of messages between networks with different protocols, Powerlink and EtherCAT, breaking the data exchange barriers between traditional networks.
[0076] In summary, this method supports the intercommunication of two different protocols, Powerlink and EtherCAT, and expands the compatibility of the system, enabling seamless data transmission between heterogeneous networks. Through the integrated synchronization and data conversion mechanism, the maintenance complexity between different network protocols can be reduced, the system operation and maintenance can be simplified, and the overall performance of this network system can be improved.
[0077] In S1, the slave station of the Powerlink network is called the second slave station, and the second slave station is regarded as a gateway. The first master station sends a synchronization message to the second slave station. The synchronization message is a broadcast (BWR) message that complies with the Powerlink protocol. The clock time of the first master station is embedded in the synchronization message.
[0078] Reference Figure 2 The gateway system scheme diagram is shown. FPGA stands for field programmable gate array. Altera is Altera, Xilinx is Xilinx. Altera and Xilinx are two types of FPGA respectively. PCP stands for parallel cache port. Avalon / AXI refers to two different bus protocols that can be selected inside the FPGA. 16 / 8 opening stands for 16-bit / 8-bit interface, which refers to the data bus width. AP stands for application processor. DSP stands for digital signal processor. ARM stands for advanced reduced instruction set machine. X86 is a CPU architecture commonly found in personal computers. The o, p, e, n, M, A, and C on the far left of the figure represent a series of components related to FPGA functions. o stands for output, p stands for pin, e stands for input, n stands for "and" logic gate, M stands for interface with the first master station, A stands for address, and C stands for counter.
[0079] Optionally, the timing message includes multiple sub-messages, one of which contains the clock time of the first master station.
[0080] In S2, when the number of second slave stations is equal to 1, it is regarded as that there is only one gateway, which manages the message conversion and transmission between the first master station and all the first slave stations. Specifically, the second slave station converts the synchronization message into a calibration message that complies with the EtherCAT protocol, and then sends the calibration message to all the first slave stations at the same time.
[0081] When the number of second slave stations is greater than 1, each second slave station is regarded as a gateway, each second slave station corresponds to several first slave stations, and each second slave station manages message conversion and transmission between the corresponding several first slave stations and the first master station.
[0082] The first master station sends the synchronization message to each second slave station at the same time. Each second slave station converts the received synchronization message into a calibration message that complies with the EtherCAT protocol and sends the calibration message YY+242211P
[0083] The document is sent to the corresponding first slave station.
[0084] After the first slave receives the calibration message, the clock adjustment mechanism is started, the clock deviation is automatically calculated according to the clock time of the first master, and the clocks of the first master and the first slave are synchronized according to the clock deviation. This is a characteristic of the first slave, which is completed by the ESC chip of the first slave in accordance with the method specified by the EtherCAT protocol. Among them, the method for the ESC (EtherCAT Slave Controller) chip to synchronize the clock according to the EtherCAT protocol includes: the ESC chip measures the transmission delay of the data frame between the slaves and the initial clock offset. Each slave supporting distributed clocks (DC slaves) has a local clock with a period of 10 nanoseconds embedded. During system startup and periodic operation, the slave saves the time when the frame is received by broadcasting the write command data frame and calculates the offset with the reference clock. Subsequently, the ESC chip dynamically adjusts the local clock according to the transmission delay and offset to achieve synchronization with the reference clock. This mechanism ensures that even under the influence of crystal frequency differences and environmental changes, the slaves in the entire EtherCAT network can maintain highly accurate clock synchronization, meeting the strict requirements of industrial automation for synchronization accuracy.
[0085] To fully synchronize the clocks of the two networks, hundreds of synchronization message transmissions and clock adjustments are required, but the overall time required for this process is very short, less than one second. In addition, the second slave station uses the FPGA mechanism for communication, and uses the network port controlled by the ARMCPU as the message transmission interface between the Powerlink network and the EtherCAT network. The second slave station sends the calibration message to the EtherCAT network through the message transmission interface, and then the calibration message reaches the first slave station.
[0086] In order to ensure that multiple second slave stations can send calibration messages to the corresponding first slave stations at the same time, the first master station sends the first synchronization message to multiple second slave stations. The first synchronization message is set according to the SOC mechanism of the Powerlink network and is a broadcast message as well as a SOC message. When multiple second slave stations receive the first synchronization message, they simultaneously send the converted calibration message to the corresponding first slave station. In this way, all first slave stations must follow the clock of the first master station instead of the clock of the first first slave station, which changes the traditional EtherCAT network that uses the clock of the first first slave station as the benchmark, thereby ensuring that the clocks of multiple first slave stations across the gateway are consistent, which helps the Powerlink network and the EtherCAT network to quickly complete clock synchronization.
[0087] Reference Figure 3 The schematic diagram of the message transmission path is shown. In S3, after the clock synchronization is completed, the transmission of the message containing the actual data can be started. At this time, if the number of the second slave stations is equal to 1, the first master station sends the first data message that complies with the Powerlink protocol to the second slave station. If the number of the second slave stations is greater than 1, the first master station sends the first data message to each second slave station at the same time.
[0088] In S4, the second slave station converts the first data message into a second data message that complies with the EtherCAT protocol, and then sends the second data message to the corresponding first slave station.
[0089] In order to ensure that multiple second slave stations can send second data messages to the corresponding first slave stations at the same time, the first master station sends a second synchronization message to the multiple second slave stations. The second synchronization message is set according to the SOC mechanism of the Powerlink network and is a broadcast message as well as a SOC message. When multiple second slave stations receive the second synchronization message, they simultaneously send the converted second data message to the corresponding first slave station. In this way, the transmission of messages containing actual data can be ensured to be consistent and synchronous, network transmission confusion can be avoided, and message management is facilitated.
[0090] Further, refer to Figure 4 The flow chart of converting a Powerlink protocol message into an EtherCAT protocol message is shown. The byte length of the first data message is N, and the N bytes are composed of N1 bytes of specified length, N2 valid bytes, and N3 empty bytes. Converting the first data message into a second data message that complies with the EtherCAT protocol includes the following steps:
[0091] S41: Based on N1 bytes of specified length, obtain the length of valid data of the second data message.
[0092] In S41, N1 designated length bytes store the length of the valid data of the second data message.
[0093] S42: Based on the length of the valid data of the second data message, extract the valid data of the second data message from the N2 valid bytes.
[0094] S43: Create an EtherCAT protocol message, map the valid data of the second data message to the effective load area of the EtherCAT protocol message, and generate a second data message.
[0095] The principle of the method for converting the synchronization message into the calibration message conforming to the EtherCAT protocol is the same as the principle of the method for converting the first data message into the second data message conforming to the EtherCAT protocol, and will not be repeated here.
[0096] In S5, due to the characteristics of the EtherCAT network for message transmission, the several first slave stations corresponding to the second slave station are sequential. In order, the second data message is transmitted in sequence among the several first slave stations. After the first first slave station receives the second data message, it responds to the second data message, generates a third data message, and embeds its own write data in the third data message. Then, the second data message and the third data message are sequentially transmitted to the next first slave station. The next first slave station responds to the second data message, embeds its own write data in the third data message, and so on, until the last first slave station completes the response, obtains the final third data message, and sends the final third data message to the corresponding second slave station.
[0097] In S6, the second slave station converts the third data message into a fourth data message that complies with the Powerlink protocol, and sends the fourth data message to the first master station. The gateway is not responsible for processing the data parsing of the EtherCAT message, including the fourth data message. This work is implemented by the software library running on the first master station.
[0098] Reference Figure 5 The flow chart of converting the EtherCAT protocol message into the Powerlink protocol message shown in the figure, converting the third data message into the fourth data message conforming to the Powerlink protocol, includes the following steps:
[0099] S61: The total length of the third data message is the same as the total length of the second data message.
[0100] In S61, the total length of the message of the EtherCAT network remains unchanged during the transmission process, just like a train, the length when it departs and the length when it returns are the same. Although the content of the message is obtained or filled by each slave station, the total length remains unchanged. Therefore, the total length of the third data message is the same as the total length of the second data message.
[0101] S62: Acquire valid data of the third data message, where the length of the valid data of the third data message is smaller than the byte length of the first data message.
[0102] In S62, since the first data message has empty bytes, the total length of the second data message will be less than N, and accordingly, the length of the effective data of the third data message will also be less than N. Moreover, the length of the effective data of the EtherCAT network message in the message sent by the Powerlink network is controlled by the software library of the EtherCAT network master station running on the first master station, including N2 effective bytes of the first data message, so that the effective data length of the EtherCAT network message (referring to the length of the data content excluding the EtherCATb message header) is less than N during the entire transmission process.
[0103] S63: Create a Powerlink protocol message and map the valid data of the third data message to YY+242211P
[0104] To the payload area of the Powerlink protocol message, a fourth data message is generated.
[0105] In S63, similar to the design of the first data message, the fourth data message also has empty bytes.
[0106] The synchronization message, the first data message, and the fourth data message are all messages of the Powerlink network, and the calibration message, the second data message, and the third data message are all messages of the EtherCAT network. Since the message of the Powerlink network is of fixed length and the message of the EtherCAT network is of variable length, it is necessary to control the effective data length of the message of the EtherCAT network to be less than the fixed length of the message of the Powerlink network. For this reason, when the present disclosure sets the first data message, the fourth data message, and the synchronization message, empty bytes are left, which can not only control the message of the Powerlink network to maintain a fixed length through empty bytes, but also combine the characteristics of the total length of the message of the EtherCAT network remaining unchanged during the transmission process, and can control the effective data length of the message responded by the EtherCAT network to be less than the fixed length of the message of the Powerlink network. Moreover, through the setting of effective bytes, the effective data part of the EtherCAT message can be directly sent and received as the communication data of a slave station of the Powerlink network.
[0107] Furthermore, the total value of the hardware dial is used to control the fixed length of the message of the Powerlink network, including the byte length of the first data message. The corresponding relationship between the total value of the dial and the byte length of the first data message is:
[0108] Z = (N - Lo) / L;
[0109] Among them, Z is the total toggle value of the hardware toggle; N is the byte length of the first data message; Lo is the corresponding first data message length value when the toggle value of the hardware toggle is 0; L is the number of bytes increased by the first data message length when the toggle value of the hardware toggle increases by 1.
[0110] For example, N is 1280, Lo is 512, L is 256, and Z is 3. When the dial value of the hardware dial is 0, the corresponding first data message length value is 512 bytes. When the dial value of the hardware dial increases by 1, the length of the first data message increases by 256 bytes. The total dial value of the hardware dial is set to 3, so that the byte length of the first data message is equal to 1280. In addition, the maximum length of the valid data of the first data message is 1490Bytes. The message length of 1280 is sufficient to meet the data communication needs of 32 first slave stations. If the number of first slave stations exceeds 32, the first slave stations can be further expanded by adding a gateway.
[0111] The principle of the method of using the total value of the hardware dial to control the byte length of the synchronization message is the same as the principle of the method of controlling the byte length of the first data message, which will not be repeated here.
[0112] Furthermore, whether converting the synchronization message into a calibration message, or converting the first data message into the second data message, or converting the third data message into the fourth data message, the interrupt program will be triggered first, and the message protocol transfer will be completed through the interrupt program, so that the time of sending the message can be synchronized with the two networks and the delay can be reduced, especially the clock time of the first master station can be sent to the first slave station with minimal delay.
[0113] In summary, by performing protocol conversion and transmission on the messages of the two networks, data can be crossed across the network, and during the message transmission process, the operating characteristics of the Powerlink network and the EtherCAT network are always followed.
[0114] For EtherCAT network, messages are transmitted in sequence between multiple first slave stations, but for Powerlink network, the first master station needs to send a request (Preq) message to multiple second slave stations, and multiple second slave stations then send a response (Pres) message to the first master station. It can be seen that the operating cycle of the Powerlink network is very different from that of the EtherCAT network.
[0115] However, this application makes the operation cycle of the Powerlink network equal to the operation cycle of the EtherCAT network and the operation cycle of the integrated system network through the periodic forwarding of messages, which solves the problem that the message is difficult to transmit across networks due to the difference between the operation cycle of the Powerlink network and the operation cycle of the EtherCAT network, ensures the consistency of the message format and timing transmitted in different networks, and simplifies the complexity of cross-network communication. Moreover, through the expansion capability of the gateway, it supports the addition of more first slave stations and second slave stations, which helps to build a large-scale distributed control system, allows the existing Powerlink network to be integrated with the emerging EtherCAT network, reduces the cost of system upgrades and replacements, and the unified clock synchronization and data conversion method simplifies system design and later maintenance work, reducing technical difficulty.
[0116] At present, the real-time network communication method of the Powelink master station and the EtherCAT slave station disclosed in the present invention has realized the position synchronization mode control of more than 24 servos in the project. In addition to servo drives, the supported slave station types also include IO, valve island, stepper motor, etc., and it runs stably in actual projects.
[0117] Reference Figure 6 The present disclosure provides a system for real-time network communication between a Powelink master station and an EtherCAT slave station, comprising:
[0118] A synchronization message acquisition module 101 is used to acquire a synchronization message that complies with the Powerlink protocol and is sent by a first master station, where the first master station is a master station of the Powerlink network;
[0119] The network clock synchronization module 102 is used to transmit the content in the clock message to the first slave station, and perform clock synchronization on the first master station and the first slave station, where the first slave station is a slave station of the EtherCAT network;
[0120] A first data message acquisition module 103, configured to acquire a first data message compliant with the Powerlink protocol and sent by the first master station after clock synchronization is completed;
[0121] A first data message conversion module 104, used to convert the first data message into a second data message that complies with the EtherCAT protocol and send it to the first slave station;
[0122] A third data message acquisition module 105, used to acquire a third data message compliant with the EtherCAT protocol sent by the first slave station;
[0123] The third data message conversion module 106 is used to convert the third data message into a fourth data message that complies with the Powerlink protocol and send the fourth data message to the first master station.
[0124] Furthermore, the system for real-time network communication between the Powelink master and the EtherCAT slave also includes a hardware dial module;
[0125] The hardware dial module is used to control the byte length of the first data message by using the total dial value of the hardware dial. The corresponding relationship between the total dial value and the byte length of the first data message is:
[0126] Z = (N - Lo) / L;
[0127] Among them, Z is the total toggle value of the hardware toggle; N is the byte length of the first data message; Lo is the corresponding first data message length value when the toggle value of the hardware toggle is 0; L is the number of bytes increased by the first data message length when the toggle value of the hardware toggle increases by 1.
[0128] The various variations and specific examples of the method for real-time network communication between the Powelink master station and the EtherCAT slave station provided above are also applicable to the system for real-time network communication between the Powelink master station and the EtherCAT slave station provided in the present invention. Through the above detailed description of the method for real-time network communication between the Powelink master station and the EtherCAT slave station, those skilled in the art can clearly know the implementation method of the system for real-time network communication between the Powelink master station and the EtherCAT slave station. For the sake of brevity of the specification, it will not be described in detail here.
[0129] The computer device according to the embodiment of the present disclosure includes a memory and a processor. The memory is used to store non-temporary computer-readable instructions. Specifically, the memory may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may, for example, include a read-only memory (ROM), a hard disk, a flash memory, etc.
[0130] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the computer device to perform desired functions. In one embodiment of the present disclosure, the processor is used to run the computer-readable instructions stored in the memory, so that the computer device executes all or part of the steps of the method for real-time network communication between the Powelink master station and the EtherCAT slave station of each embodiment of the present disclosure.
[0131] Those skilled in the art should be able to understand that in order to solve the technical problem of how to obtain a good user experience, the present embodiment may also include well-known structures such as a communication bus and an interface, and these well-known structures should also be included in the protection scope of the present disclosure.
[0132] like Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure is shown, which is a schematic diagram of the structure of a computer device suitable for implementing the embodiment of the present disclosure. Figure 7 The computer device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0133] like Figure 7 As shown, the computer device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the computer device are also stored. The processor, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0134] Typically, the following devices can be connected to the I / O interface: input devices such as sensors or visual information acquisition devices; output devices such as display screens; storage devices such as tapes, hard disks, etc.; and communication devices. The communication device can allow the computer device to communicate with other devices (such as edge computing devices) wirelessly or by wire to exchange data. Figure 7 A computer device having various devices is shown, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0135] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processor, all or part of the steps of the method for real-time network communication between the Powelink master station and the EtherCAT slave station of the embodiment of the present disclosure are executed.
[0136] For detailed description of this embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0137] According to the computer-readable storage medium of the embodiment of the present disclosure, non-transitory computer-readable instructions are stored thereon. When the non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the method for real-time network communication between a Powelink master station and an EtherCAT slave station of each embodiment of the present disclosure are executed.
[0138] The above-mentioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or mobile hard disk), media with built-in rewritable non-volatile memory (e.g., memory card) and media with built-in ROM (e.g., ROM box).
[0139] For detailed description of this embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0140] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0141] In the present disclosure, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. The block diagrams of the devices, devices, equipment, and systems involved in the present disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.
[0142] YY+242211P
[0143] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a separate list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.
[0144] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0145] Various changes, substitutions, and modifications of the techniques described herein may be made without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of the present disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of events, means, methods, and actions described above. Currently existing or later to be developed processes, machines, manufactures, compositions of events, means, methods, or actions that perform substantially the same functions or achieve substantially the same results as the corresponding aspects described herein may be utilized. Thus, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or actions within their scope.
[0146] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0147] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein.
[0148] Although the present invention has been described hereinbefore, there have been described several example aspects and embodiments, but those skilled in the art will recognize certain variations, modifications, changes, additions, and sub-combinations thereof.
Claims
1. A method for real-time network communication between a Powelink master station and an EtherCAT slave station, characterized in that: include: Obtaining a synchronization message that complies with the Powerlink protocol and is sent by a first master station, where the first master station is a master station of the Powerlink network; Transmitting the content in the synchronization message to the first slave station, performing clock synchronization on the first master station and the first slave station, wherein the first slave station is a slave station of the EtherCAT network; After the clock synchronization is completed, obtaining a first data message that complies with the Powerlink protocol and is sent by the first master station; Convert the first data message into a second data message that complies with the EtherCAT protocol and send it to the first slave station; Obtaining a third data message compliant with the EtherCAT protocol sent by the first slave station; The third data message is converted into a fourth data message that complies with the Powerlink protocol and sent to the first master station.
2. The method for real-time network communication between a Powelink master station and an EtherCAT slave station according to claim 1, characterized in that: The transmitting the content in the synchronization message to the first slave station includes: Each second slave station corresponds to a number of first slave stations, and the second slave stations are slave stations of the Powerlink network; The synchronization message is sent to each second slave station, and each second slave station converts the received synchronization message into a calibration message that complies with the EtherCAT protocol, and sends the calibration message to the corresponding first slave station.
3. The method for real-time network communication between a Powelink master station and an EtherCAT slave station according to claim 2, characterized in that: The performing clock synchronization on the first master station and the first slave station comprises: Calculating a clock deviation based on the clock time of the first master station included in the calibration message; Clock synchronization is performed on the first master station and the first slave station based on the clock deviation.
4. The method for real-time network communication between a Powelink master station and an EtherCAT slave station according to claim 1, characterized in that: The converting the first data message into a second data message that complies with the EtherCAT protocol includes: The byte length of the first data message is N, and the N bytes consist of N1 specified length bytes, N2 valid bytes and N3 null bytes; Based on the N1 bytes of specified length, obtaining the length of valid data of the second data message; Extracting valid data of the second data message from the N2 valid bytes based on the length of the valid data of the second data message; An EtherCAT protocol message is created, and valid data of the second data message is mapped to a valid load area of the EtherCAT protocol message to generate the second data message.
5. The method for real-time network communication between a Powelink master station and an EtherCAT slave station according to claim 1, characterized in that: The converting the third data message into a fourth data message that complies with the Powerlink protocol includes: The total length of the third data message is the same as the total length of the second data message; Acquire valid data of the third data message, where the length of the valid data of the third data message is less than the byte length of the first data message; A Powerlink protocol message is created, and valid data of the third data message is mapped to a valid load area of the Powerlink protocol message to generate the fourth data message.
6. The method for real-time network communication between a Powelink master station and an EtherCAT slave station according to claim 1, characterized in that: Also includes: The total value of the hardware dial switch is used to control the byte length of the first data message, and the corresponding relationship between the total value of the dial switch and the byte length of the first data message is: Z = (N - Lo) / L; Among them, Z is the total toggle value of the hardware toggle switch; N is the byte length of the first data message; Lo is the corresponding first data message length value when the toggle value of the hardware toggle switch is 0; L is the number of bytes increased by the length of the first data message when the toggle value of the hardware toggle switch increases by 1.
7. The method for real-time network communication between a Powelink master station and an EtherCAT slave station according to claim 1, characterized in that: Also includes: The second slave station communicates using an FPGA mechanism; The network port controlled by the ARM CPU is used as the message transmission interface between the Powerlink network and the EtherCAT network.
8. A computer device, characterized in that: The computer device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for real-time network communication between a Powelink master station and an EtherCAT slave station as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which are used to enable a computer to execute the method for real-time network communication between a Powelink master station and an EtherCAT slave station as described in any one of claims 1-7.
10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
