Dual-port redundant EtherCAT master station data transmission method, device, equipment and storage medium
By setting up dual network ports on the EtherCAT master station and detecting the status and counting the number of statistical data packets to determine the redundant transmission mode, the data transmission problem of the EtherCAT master-slave station system in the event of a link failure is solved, reducing costs and improving flexibility and intelligence.
Patent Information
- Application Number
- CN202411717125.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-11-27
AI Technical Summary
Traditional EtherCAT master-slave systems cannot transmit data normally when a single point failure occurs in the link, and adding a backup master station increases costs.
A dual-port redundant EtherCAT master station data transmission method is adopted. By setting the first network and the second network port on the EtherCAT master station, the network port status is detected and the number of data packets is counted. The redundant transmission mode is determined based on the comparison results to realize data transmission and reception, avoiding the need to add an additional backup master station.
When there is a single point of failure in the link, normal communication is achieved through the cooperation of the first network port and the second network port, which reduces the cost of the EtherCAT master-slave system and improves the flexibility and intelligence of data transmission.
Smart Images

Figure CN119544600B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Ethernet automatic control technology, and in particular to a dual-port redundant EtherCAT master station data transmission method, apparatus, device, and storage medium. Background Art
[0002] With the rapid development of industrial automation, the stability and real-time performance of Industrial Ethernet are crucial to the continuous operation of the entire production line. As a high-performance Industrial Ethernet technology, EtherCAT, through its unique real-time Ethernet protocol, is able to provide low-latency and highly deterministic communication.
[0003] Traditional EtherCAT master-slave systems operate with a single master station in a dual-link ring network for redundancy. While this improves reliability to a certain extent, a single point of failure in the link can prevent the entire system from completing normal data transmission. To address this issue, a backup master station is added to control the flow of master station data based on the presence of a single point of failure in the link, enabling the EtherCAT system to quickly recover from link failures. However, this approach requires additional hardware (i.e., a backup master station), which increases costs. Summary of the Invention
[0004] The embodiments of the present application provide a dual-network-port redundant EtherCAT master station data transmission method, apparatus, device, and storage medium, which can solve the technical problem of high cost of EtherCAT master-slave station systems with normal EtherCAT master station data transmission, and reduce the cost of EtherCAT master-slave station systems with normal EtherCAT master station data transmission.
[0005] In a first aspect, an embodiment of the present application provides a dual-network-port redundant EtherCAT master station data transmission method, which is used for an EtherCAT master station. The EtherCAT master station is used to form an EtherCAT master-slave system with multiple EtherCAT slaves. The EtherCAT master station includes a first network port and a second network port. The first network port includes a first sending network port and a first receiving network port. The second network port includes a second sending network port and a second receiving network port. Multiple EtherCAT slaves are connected one by one to form a slave link. The first sending network port is connected to the first EtherCAT slave at the first end of the slave link, and the second EtherCAT slave at the second end of the slave link is connected to the second receiving network port. The first sending network port, the slave link, and the second receiving network port form a first network link; the second sending network port is connected to the second EtherCAT slave at the second end of the slave link, and the first EtherCAT slave at the first end of the slave link is connected to the first receiving network port. The second sending network port, the slave link, and the first receiving network port form a second network link.
[0006] The dual-network-port redundant EtherCAT master station data transmission method includes:
[0007] Receiving a first enable signal, and detecting a first network port status and a second network port status in response to the first enable signal, wherein the first network port status is a communication connection status between the first network port and the first EtherCAT slave station, and the second network port status is a communication connection status between the second network port and the second EtherCAT slave station;
[0008] When the first network port state and the second network port state are both in a connected state, controlling the first sending network port to send data to the first EtherCAT slave station, and receiving corresponding data through the first receiving network port or the second receiving network port;
[0009] When the second receiving network port receives the corresponding data, the EtherCAT master station forwards the data to the second sending network port, and sends the data to the second EtherCAT slave station through the second sending network port, and receives the data through the first receiving network port;
[0010] Counting a first number of data packets received by the first receiving network port and a second number of data packets received by the second receiving network port;
[0011] A redundant transmission mode is determined according to a comparison result of the first quantity and the second quantity, and data is sent and received according to the redundant transmission mode.
[0012] In one embodiment, determining a redundant transmission mode based on a comparison result of the first quantity and the second quantity, and transmitting and receiving data based on the redundant transmission mode includes:
[0013] When the comparison result shows that the first number is less than or equal to the second number, determining that the redundant transmission mode is the first redundant mode;
[0014] According to the first redundant mode, controlling the first transmitting network port to transmit data to the first EtherCAT slave station, and receiving corresponding data from the second EtherCAT slave station through the second receiving network port, wherein the data is transmitted from the first EtherCAT slave station to the second EtherCAT slave station based on the first network link;
[0015] In the EtherCAT master station, the data received by the second receiving network port is forwarded to the second sending network port;
[0016] Sending data to the second EtherCAT slave station through the second sending network port, and receiving corresponding data from the first EtherCAT slave station through the first receiving network port, wherein the data is transmitted from the second EtherCAT slave station to the first EtherCAT slave station based on the second network link;
[0017] Data analysis and processing are performed based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0018] In one embodiment, determining a redundant transmission mode based on a comparison result of the first quantity and the second quantity, and transmitting and receiving data based on the redundant transmission mode includes:
[0019] When the comparison result shows that the first number is greater than the second number, determining that the redundant transmission mode is the second redundant mode;
[0020] In the second redundant mode, determining that there are a first target slave station and a second target slave station with communication disconnected in the slave link, where the first target slave station and the second target slave station are two adjacent EtherCAT slave stations at corresponding communication disconnected positions;
[0021] Controlling the first sending network port to send data based on the first network link and to receive returned data through the first receiving network port, wherein the data is transmitted to the first target slave station based on the first network link and is returned to the first receiving network port through the first target slave station based on the second network link;
[0022] In the EtherCAT master station, the data received by the first receiving network port is forwarded to the second sending network port;
[0023] Sending data via the second sending network port based on the second network link, and receiving returned data via the second receiving network port, wherein the data is transmitted to the second target slave station based on the second network link, and is returned to the second receiving network port via the second target slave station based on the first network link;
[0024] Data analysis and processing are performed based on the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0025] In one embodiment, after receiving the first enable signal and detecting the first network port status and the second network port status in response to the first enable signal, the method includes:
[0026] When the first network port state is a disconnected state and the second network port state is a connected state, determining that the redundant transmission mode is a third redundant mode;
[0027] In the third redundant mode, data is sent to the second EtherCAT slave station through the second sending network port, and returned data is received from the second EtherCAT slave station through the second receiving network port, wherein the data is transmitted to the first EtherCAT slave station based on the second network link, and is returned to the second EtherCAT slave station through the first EtherCAT slave station based on the first network link;
[0028] Data analysis and processing are performed based on the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0029] In one embodiment, after receiving the first enable signal and detecting the first network port status and the second network port status in response to the first enable signal, the method includes:
[0030] When the first network port state is a connected state and the second network port state is a disconnected state, determining that the redundant transmission mode is a third redundant mode;
[0031] In the third redundant mode, data is sent to the first EtherCAT slave station through the first transmitting network port, and data returned by the first EtherCAT slave station is received through the first receiving network port, wherein the data is transmitted to the second EtherCAT slave station based on the first network link, and is returned to the first EtherCAT slave station through the second EtherCAT slave station based on the second network link;
[0032] Data analysis and processing are performed based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0033] In one embodiment, the EtherCAT master station further includes a first PHY transceiver and a second PHY transceiver, wherein the first PHY transceiver is connected to the first network port, and the second PHY transceiver is connected to the second network port;
[0034] Detecting the status of the first network port and the second network port includes:
[0035] detecting a first link signal state of the first PHY transceiver, and detecting a second link signal state of the second PHY transceiver;
[0036] When the first link signal state is in a high level state, determining that the first network port state is a disconnected state;
[0037] When the first link signal state is in a low level state, determining that the first network port state is in a connected state;
[0038] When the second link signal state is in a high level state, determining that the second network port state is in a disconnected state;
[0039] When the second link signal state is in a low level state, it is determined that the second network port state is in a connected state.
[0040] In one embodiment, the dual-port redundant EtherCAT master station data method further includes:
[0041] receiving a second enable signal, and determining, in response to the second enable signal, that the operating mode is a redundancy off mode;
[0042] In redundancy shutdown mode, the first transmitting network port is controlled to send data to the first EtherCAT slave station, and the data transmitted back by the first EtherCAT slave station is received through the first receiving network port, wherein the data is transmitted to the second EtherCAT slave station based on the first network link, and is transmitted back to the first EtherCAT slave station through the second EtherCAT slave station based on the second network link;
[0043] Data analysis and processing are performed based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0044] In one embodiment, the dual-port redundant EtherCAT master station data method further includes:
[0045] In the corresponding redundant transmission mode, when it is detected that the first network port status and the second network port status are both disconnected, the working mode is determined to be the redundant closed mode, and data is sent and received according to the redundant closed mode.
[0046] In a second aspect, an embodiment of the present application provides a dual-network-port redundant EtherCAT master station data transmission device, which is used for an EtherCAT master station. The EtherCAT master station is used to form an EtherCAT master-slave system with multiple EtherCAT slave stations. The EtherCAT master station includes a first network port and a second network port. The first network port includes a first sending network port and a first receiving network port. The second network port includes a second sending network port and a second receiving network port. Multiple EtherCAT slave stations are connected one by one to form a slave link. The first sending network port is connected to the first EtherCAT slave station at the first end of the slave link, and the second EtherCAT slave station at the second end of the slave link is connected to the second receiving network port. The first sending network port, the slave link, and the second receiving network port form a first network link; the second sending network port is connected to the second EtherCAT slave station at the second end of the slave link, and the first EtherCAT slave station at the first end of the slave link is connected to the first receiving network port. The second sending network port, the slave link, and the first receiving network port form a second network link.
[0047] The dual-port redundant EtherCAT master station data transmission device includes:
[0048] A first enable response module is configured to receive a first enable signal and, in response to the first enable signal, detect a first network port status and a second network port status, wherein the first network port status is a communication connection status between the first network port and the first EtherCAT slave station, and the second network port status is a communication connection status between the second network port and the second EtherCAT slave station;
[0049] A first transceiver control module is configured to control the first transmitting network port to transmit data to the first EtherCAT slave station and receive corresponding data through the first receiving network port or the second receiving network port when both the first network port state and the second network port state are connected;
[0050] A second transceiver control module is configured to, upon receiving corresponding data at the second receiving network port, forward the data to the second sending network port within the EtherCAT master station, and send the data to the second EtherCAT slave station via the second sending network port, and receive the data via the first receiving network port;
[0051] A quantity statistics module, configured to count a first quantity of data packets received by the first receiving network port and a second quantity of data packets received by the second receiving network port;
[0052] The first working mode determination module is configured to determine a redundant transmission mode according to a comparison result between the first quantity and the second quantity, and transmit and receive data according to the redundant transmission mode.
[0053] In a third aspect, an embodiment of the present application provides a dual-port redundant EtherCAT master station data transmission device, comprising:
[0054] memory and one or more processors;
[0055] The memory is used to store one or more programs;
[0056] When the one or more programs are executed by the one or more processors, the one or more processors implement the dual-network-port redundant EtherCAT master station data transmission method as described in the first aspect.
[0057] In a fourth aspect, an embodiment of the present application provides a storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to execute the dual-port redundant EtherCAT master station data transmission method as described in the first aspect.
[0058] In an embodiment of the present application, when transmitting data at an EtherCAT master station, a first network and a second network port are set at the EtherCAT master station. When the first network port status corresponding to the first network port and the second network port status corresponding to the second network port are both in a connected state, the first sending network port in the first network port is controlled to send data to the first EtherCAT slave station, and the corresponding data is received through the first receiving network port or the second receiving network port; when the second receiving network port receives the corresponding data, the data is forwarded to the second sending network port in the EtherCAT master station, and the data is sent to the second EtherCAT slave station through the second sending network port, and the data is received through the first receiving network port or the second receiving network port; a first number of data packets received by the first receiving network port and a second number of data packets received by the second receiving network port are counted; a redundant transmission mode is determined according to a comparison result of the first number and the second number, and data is sent and received according to the redundant transmission mode. By adopting the above technical means, there is no need to add an additional backup master station. The corresponding redundant transmission mode can be performed through the first network port and the second network port based on the statistical results of the number of data packets. When there is a single point failure in the link, normal communication can be achieved through the cooperation of the first network port and the second network port. In this way, the technical problem of high cost caused by the additional addition of a backup master station in the EtherCAT master-slave station system can be avoided. Normal data transmission can be achieved based on the cooperation of the first network port and the second network port of the EtherCAT master station, thereby reducing the cost of the EtherCAT master-slave station system with normal data transmission of the EtherCAT master station.
[0059] The beneficial effects of the dual-port redundant EtherCAT master station data transmission device, dual-port redundant EtherCAT master station data transmission equipment, and storage medium provided above can refer to the beneficial effects of the dual-port redundant EtherCAT master station data transmission method. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 This is a first structural diagram of an EtherCAT master-slave system provided in an embodiment of the present application;
[0061] Figure 2 This is a flow chart of a dual-port redundant EtherCAT master station data transmission method provided by an embodiment of the present application;
[0062] Figure 3 This is a first structural diagram of an EtherCAT master station provided in an embodiment of the present application;
[0063] Figure 4 This is a first transmission schematic diagram of EtherCAT master station data transmission provided by an embodiment of the present application;
[0064] Figure 5This is a second transmission schematic diagram of EtherCAT master station data transmission provided by an embodiment of the present application;
[0065] Figure 6 This is a third transmission schematic diagram of EtherCAT master station data transmission provided by an embodiment of the present application;
[0066] Figure 7 This is a transmission diagram of a first redundancy mode provided in an embodiment of the present application;
[0067] Figure 8 This is a second structural diagram of an EtherCAT master station provided in an embodiment of the present application;
[0068] Figure 9 This is a transmission diagram of a second redundancy mode provided in an embodiment of the present application;
[0069] Figure 10 This is a first transmission schematic diagram of a third redundancy mode provided in an embodiment of the present application;
[0070] Figure 11 This is a second transmission schematic diagram of a third redundancy mode provided in an embodiment of the present application;
[0071] Figure 12 This is a structural diagram of a dual-port redundant EtherCAT master station data transmission device provided in an embodiment of the present application;
[0072] Figure 13 This is a structural diagram of a dual-port redundant EtherCAT master station data transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solutions and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. It should also be noted that, for ease of description, only parts related to the present application, not all of the contents, are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0074] Traditional EtherCAT master-slave systems operate with a single master station in a dual-link ring network for redundancy. While this improves reliability to a certain extent, a single point of failure in the link can prevent the entire system from completing normal data transmission. To address this issue, a backup master station is added to control the flow of master station data based on the presence of a single point of failure in the link, enabling the EtherCAT system to quickly recover from link failures. However, this approach requires additional hardware (i.e., a backup master station), which increases costs.
[0075] Based on this, a dual-network-port redundant EtherCAT master station data transmission method, apparatus, equipment and storage medium of an embodiment of the present application are provided, which are intended to, when the EtherCAT master station transmits data, by setting a first network and a second network port in the EtherCAT master station, when the first network port status corresponding to the first network port and the second network port status corresponding to the second network port are both connected, control the first sending network port in the first network port to send data to the first EtherCAT slave station, and receive the corresponding data through the first receiving network port or the second receiving network port; when the second receiving network port receives the corresponding data, forward the data to the second sending network port in the EtherCAT master station, and send the data to the second EtherCAT slave station through the second sending network port, and receive the data through the first receiving network port or the second receiving network port; count the first number of data packets received by the first receiving network port and the second number of data packets received by the second receiving network port; determine the redundant transmission mode according to the comparison result of the first number and the second number, and send and receive data according to the redundant transmission mode. By adopting the above technical means, there is no need to add an additional backup master station. The corresponding redundant transmission mode can be performed through the first network port and the second network port based on the statistical results of the number of data packets. When there is a single point failure in the link, normal communication can be achieved through the cooperation of the first network port and the second network port. In this way, the technical problem of high cost caused by the additional addition of a backup master station in the EtherCAT master-slave station system can be avoided. Normal data transmission can be achieved based on the cooperation of the first network port and the second network port of the EtherCAT master station, thereby reducing the cost of the EtherCAT master-slave station system with normal data transmission of the EtherCAT master station.
[0076] Figure 11 is a first structural diagram of an EtherCAT master-slave system provided in an embodiment of the present application. The EtherCAT master-slave system 1 includes an EtherCAT master 11 and an EtherCAT slave 12 . The EtherCAT master station 11 is used to form an EtherCAT master-slave system 1 with multiple EtherCAT slave stations 12. The EtherCAT master station 11 includes a first network port 111 and a second network port 112. The first network port 111 includes a first transmitting network port TX1 and a first receiving network port RX1. The second network port 112 includes a second transmitting network port TX2 and a second receiving network port RX2. Multiple EtherCAT slave stations 12 are connected one by one to form a slave link. The first transmitting network port TX1 is connected to the first EtherCAT slave station 121 at the first end of the slave link, and the second EtherCAT slave station 122 at the second end of the slave link is connected to the second receiving network port RX2. The first transmitting network port TX1, the slave link, and the second receiving network port RX2 form a first network link; the second transmitting network port TX2 is connected to the second EtherCAT slave station 122 at the second end of the slave link, the first EtherCAT slave station 121 at the first end of the slave link is connected to the first receiving network port RX1, and the second transmitting network port TX2, the slave link, and the first receiving network port RX1 form a second network link.
[0077] The first network port 111 and the second network port 112 are respectively connected to a PHY transceiver circuit.
[0078] It should be noted that different EtherCAT slave stations 12 are connected via a network cable that allows bidirectional transmission, forming the aforementioned first network link and second network link. Therefore, when communication between EtherCAT slave stations 12 is disconnected, the communication connection between the first network link and the second network link corresponding to the disconnected position is also disconnected.
[0079] Figure 2 A flowchart of a dual-port redundant EtherCAT master station data transmission method provided in an embodiment of the present application is provided. The dual-port redundant EtherCAT master station data transmission method provided in this embodiment can be performed by a dual-port redundant EtherCAT master station data transmission device. The dual-port redundant EtherCAT master station data transmission device can be implemented via software and / or hardware. The dual-port redundant EtherCAT master station data transmission device can be composed of two or more physical entities or a single physical entity. Generally speaking, the dual-port redundant EtherCAT master station data transmission device can be an Ethernet communication device.
[0080] The following describes the method of data transmission using Ethernet communication equipment as the main body of the dual-port redundant EtherCAT master station. Figure 2The dual-port redundant EtherCAT master station data transmission method is used for the aforementioned EtherCAT master station, and the dual-port redundant EtherCAT master station data transmission method specifically includes:
[0081] S101. Receive a first enable signal, and in response to the first enable signal, detect a first network port status and a second network port status, where the first network port status is a communication connection status between the first network port and a first EtherCAT slave station, and the second network port status is a communication connection status between the second network port and a second EtherCAT slave station.
[0082] The first enable signal is a redundancy enable signal. When the redundancy enable function is enabled, the second network port functions as a redundant network port to implement the redundancy function. When the user enables redundancy, the EtherCAT master receives the first enable signal and, in response to the first enable signal, detects the status of the first network port and the status of the second network port. The first network port status is the communication connection status between the first network port and the first EtherCAT slave, and the second network port status is the communication connection status between the second network port and the second EtherCAT slave. The first network port status is used to determine whether the communication connection between the first network port and the first EtherCAT slave is normal, and the second network port status is used to determine whether the communication connection between the second network port and the second EtherCAT slave is normal. Subsequently, a corresponding data packet quantity test and / or a corresponding redundant transmission mode are performed based on the first network port status and the second network port status.
[0083] Figure 3 This is a first structural diagram of an EtherCAT master station provided in an embodiment of the present application, referring to Figure 3The EtherCAT master station 11 further includes a first PHY transceiver 113 and a second PHY transceiver 114, wherein the first PHY transceiver 113 is connected to the first network port 111, and the second PHY transceiver 114 is connected to the second network port 112. When detecting the status of the first network port 111 and the second network port 112, the first link signal status of the first PHY transceiver 113 is detected, and the second link signal status of the second PHY transceiver 114 is detected. When the first link signal status is a high level state, it is determined that the status of the first network port 111 is a disconnected state, that is, the first network port 111 and the first EtherCAT slave station 121 are in a communication disconnected state; when the first link signal status is a low level state, it is determined that the status of the first network port 111 is a connected state, that is, the first network port 111 and the first EtherCAT slave station 121 are in a communication connected state. When the second link signal state is in a high level state, the state of the second network port 112 is determined to be a disconnected state, that is, the second network port 112 and the second EtherCAT slave station 122 are in a communication disconnected state; when the second link signal state is in a low level state, the state of the second network port 112 is determined to be a connected state, that is, the second network port 112 and the second EtherCAT slave station 122 are in a communication connected state.
[0084] Subsequently, a corresponding data transmission mode may be determined according to the status of the first network port and the status of the second network port.
[0085] S102 : When both the first network port status and the second network port status are connected, control the first sending network port to send data to the first EtherCAT slave station, and receive corresponding data through the first receiving network port or the second receiving network port.
[0086] When the first network port status is connected, it means that the communication connection between the first network port and the first EtherCAT slave is normal. When the second network port status is connected, it means that the communication connection between the second network port and the second EtherCAT slave is normal. Therefore, when the first network port status and the second network port status are both connected, data transmission can be used to test whether there is a communication disconnection in the slave link. Therefore, when the first network port status and the second network port status are both connected, the first sending network port is controlled to send data to the first EtherCAT slave, and the corresponding data is received through the first receiving network port or the second receiving network port. Subsequently, it can be determined whether there is a communication disconnection in the slave link based on the number of data packets received by the first receiving network port and the second receiving network port, as well as the corresponding disconnection position point when a communication disconnection occurs.
[0087] Exemplarily, when both the first network port and the second network port are connected, after controlling the first transmitting network port to send data to the first EtherCAT slave, if the slave link communication is normal, that is, there is no communication disconnection between the first network link and the second network link, then the data is transmitted based on the transmission of the first network link to the second EtherCAT slave at the second end of the slave link, and then transmitted to the second receiving network port through the second EtherCAT slave, and received by the second receiving network port. At this time, the number of data packets received by the second receiving network port is greater than the number of data packets received by the first receiving network port. Figure 4 This is a first transmission diagram of an EtherCAT master station data transmission provided by an embodiment of the present application, referring to Figure 4 When the first network link is communicating normally, the first transmitting network port TX1 is controlled to send data to the first EtherCAT slave 121. The data is then transmitted via the first network link to the second EtherCAT slave 122 at the second end of the slave link. Furthermore, the data is transmitted via the second EtherCAT slave 122 to the second receiving network port RX2, where it is received by the second receiving network port RX2. At this point, the number of data packets received by the second receiving network port RX2 is greater than the number of data packets received by the first receiving network port RX1.
[0088] If the slave link communication is abnormal, that is, there is an abnormality in the network cable between two EtherCAT slaves, then the first network link and the second network link at this location are both disconnected. The two EtherCAT slaves close to the first network port are defined as the first target slave, and the one close to the second network port is defined as the second target slave. After controlling the first sending network port to send data to the first EtherCAT slave, after the corresponding data is transmitted to the EtherCAT slave with disconnected communication (i.e., the first target slave), the EtherCAT slave (i.e., the first target slave) will return the corresponding data through the second network link, so that the data is returned to the first EtherCAT slave, and then returned to the first receiving network port through the first EtherCAT slave. At this time, the number of data packets received by the first receiving network port is greater than the number of data packets received by the second receiving network port. Figure 5 This is a second transmission diagram of an EtherCAT master station data transmission provided by an embodiment of the present application, referring to Figure 5, there is an abnormality in the slave link communication, for example, there is a communication disconnection between the third EtherCAT slave station 123 and the second EtherCAT slave station 122, that is, there is a communication disconnection between the network cable of the third EtherCAT slave station 123 and the second EtherCAT slave station 122, and the third EtherCAT slave station 123 and the second EtherCAT slave station 122 cannot communicate through the first network link and the second network link. When controlling the first transmitting network port TX1 to send data to the first EtherCAT slave station 121, the data is transmitted to the third EtherCAT slave station 123 of the slave link through the first network link. Because the communication disconnection between the third EtherCAT slave station 123 and the second EtherCAT slave station 122 exists, the data cannot be transmitted to the second EtherCAT slave station 122. Then, the third EtherCAT slave station 123 transmits the corresponding data back to the first EtherCAT slave station 121 based on the second network link, and transmits it back to the first receiving network port RX1 through the first EtherCAT slave station 121. At this time, the number of data packets received by the first receiving network port RX1 is greater than the number of data packets received by the second receiving network port RX2.
[0089] S103. When the second receiving network port receives the corresponding data, the EtherCAT master station forwards the data to the second sending network port, and sends the data to the second EtherCAT slave station through the second sending network port, and receives the data through the first receiving network port.
[0090] When the second receiving network port receives the corresponding data, it indicates that the communication of the slave link is normal, that is, the communication between the first network link and the second network link is normal. At this time, the EtherCAT master forwards the data to the second sending network port, and then sends the data to the second EtherCAT slave through the second sending network port, and receives the data through the first receiving network port. Subsequently, based on the number of data packets received by the first receiving network port and the second receiving network port, it can be determined whether there is a communication disconnection in the slave link, and the corresponding disconnection point when a communication disconnection occurs.
[0091] Exemplarily, when the second receiving network port receives corresponding data, the EtherCAT master forwards the data to the second sending network port, and after the data is sent to the second EtherCAT slave via the second sending network port, if the slave link communication is normal, that is, there is no communication disconnection between the first network link and the second network link, then the data is transmitted to the first EtherCAT slave at the first end of the slave link based on the transmission of the second network link, and is transmitted to the first receiving network port via the first EtherCAT slave, and is received by the first receiving network port. At this time, the number of data packets received by the first receiving network port is equal to the number of data packets received by the second receiving network port. Figure 6 This is a third transmission diagram of an EtherCAT master station data transmission provided by an embodiment of the present application, referring to Figure 4 and Figure 6 , when the slave link communication is normal, based on Figure 4 When the second receiving network port RX2 receives the corresponding data, the EtherCAT master 11 forwards the data to the second transmitting network port TX2 and sends the data to the second EtherCAT slave 122 via the second transmitting network port TX2. The data is then transmitted via the second network link to the first EtherCAT slave 121 at the first end of the slave link, and then to the first receiving network port RX1 via the first EtherCAT slave 121. At this point, the number of data packets received by the first receiving network port RX1 is equal to the number of data packets received by the second receiving network port RX2.
[0092] In summary, through the aforementioned data transmission, when the slave link communication connection is normal, the number of data packets received by the first receiving network port is less than or equal to the number of data packets received by the second receiving network port. When a communication anomaly exists in the slave link, the number of data packets received by the first receiving network port is greater than the number of data packets received by the second receiving network port. Therefore, the number of data packets received by the first receiving network port can be compared with the number of data packets received by the second network port to determine whether there is a communication anomaly in the slave link.
[0093] S104: Count a first number of data packets received by the first receiving network port and a second number of data packets received by the second receiving network port.
[0094] Through the aforementioned data transmission, a first number of data packets received by the first network port is counted, and a second number of data packets received by the second receiving network port is counted. Subsequently, based on the first number and the second number, it is determined whether a slave link is disconnected and which redundant transmission mode to execute to ensure normal data transmission of the EtherCAT master-slave system.
[0095] S105 : Determine a redundant transmission mode according to a comparison result between the first quantity and the second quantity, and send and receive data according to the redundant transmission mode.
[0096] Through the aforementioned data transmission, when the slave link communication connection is normal, if the first number of data packets received by the first receiving network port is less than or equal to the second number of data packets received by the second receiving network port, the redundant transmission mode can be determined to be the first redundant mode. The first redundant mode can be understood as the data transmission mode when the first network port status and the second network port status are both connected and the slave link communication is normal, in which case the second network port serves as a redundant network port of the EtherCAT master. When there is a communication anomaly in the slave link, if the first number of data packets received by the first receiving network port is greater than the second number of data packets received by the second receiving network port, the redundant transmission mode is determined to be the second redundant mode. The second redundant mode can be understood as the data transmission mode when the first network port status and the second network port status are both connected and the slave link communication is abnormal.
[0097] A redundant transmission mode is determined according to a comparison result of the first quantity and the second quantity, and data is sent and received according to the redundant transmission mode.
[0098] Figure 7 This is a transmission diagram of a first redundancy mode provided in an embodiment of the present application, referring to Figure 7 According to the first redundant mode, that is, when the first network port status and the second network port status are both connected and the slave link communication is normal, the EtherCAT master station 11 controls the first transmitting network port TX1 to transmit data to the first EtherCAT slave station 121, which is then transmitted to the second EtherCAT slave station 122 via the first network link, and the corresponding data is received from the second EtherCAT slave station 122 via the second receiving network port RX2. Within the EtherCAT master station 11, the data received by the second receiving network port RX2 is forwarded to the second transmitting network port TX2. The data is sent to the second EtherCAT slave station 122 via the second transmitting network port TX2, which is then transmitted to the first EtherCAT slave station 121 via the second network link, and the corresponding data is received from the first EtherCAT slave station 121 via the first receiving network port RX1. The EtherCAT master station 11 performs data analysis and processing based on the data received by the first receiving network port RX1 to determine the corresponding operating status of each EtherCAT slave station 12.
[0099] Figure 8 This is a second structural diagram of an EtherCAT master station provided in an embodiment of the present application, referring to Figure 8The EtherCAT master station 11 also includes an FPGA chip 115, wherein the FPGA chip 115 includes a PS module 1151 and a PL module 1152. The PS (Processing system) module 1151 is the ARM processor part in the FPGA chip 115, and the PL (Programmable Logic) module 1152 is the programmable logic part in the FPGA chip 115. The switching logic of the transmission mode in this example is implemented by the PL module 1152 and is not processed by the PS module 1151. Among them, the first network port 111 and the second network port 112 are both connected to the PL module 1152, and the first network port 111 and the second network port 112 are also connected to the PS module 1151. Based on the ARM processor function of the PS module 1151, data analysis and processing can be performed. Therefore, the EtherCAT master station 11 can perform data analysis and processing based on the data received by the first receiving network port RX1 to determine the corresponding operating status of each EtherCAT slave station 12.
[0100] In one embodiment, in the second redundancy mode, i.e., when both the first and second network ports are connected and slave link communication is abnormal, a first target slave and a second target slave are determined to be disconnected in the slave link, where the first and second target slaves are adjacent EtherCAT slaves at the corresponding disconnected locations. The first transmitting network port is controlled to transmit data via the first network link and receive returned data via the first receiving network port. The data is transmitted to the first target slave via the first network link and then transmitted back to the first receiving network port via the first target slave via the second network link. Within the EtherCAT master, the data received by the first receiving network port is forwarded to the second transmitting network port. The data is transmitted via the second transmitting network port via the second network link and then received back via the second receiving network port. The data is transmitted to the second target slave via the second network link and then transmitted back to the second receiving network port via the second target slave via the first network link. The EtherCAT master analyzes and processes the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave.
[0101] Figure 9 This is a transmission diagram of a second redundancy mode provided in an embodiment of the present application, referring to Figure 9In the second redundant mode, that is, when the first network port status and the second network port status are both connected and the slave link communication is abnormal, it is assumed that there is a communication disconnection between the third EtherCAT slave station 123 and the second EtherCAT slave station 122, and the third EtherCAT slave station 123 is determined to be the first target slave station and the second EtherCAT slave station 122 is determined to be the second target slave station. The first transmitting network port TX1 is controlled to send data to the first EtherCAT slave station 121, and the data is transmitted to the third EtherCAT slave station 123 (i.e., the first target slave station) through the transmission of the first network link. Because the communication between the third EtherCAT slave station 123 and the second EtherCAT slave station 122 is disconnected, the data cannot be transmitted to the second EtherCAT slave station 122. Therefore, the third EtherCAT slave station 123 returns the corresponding data and returns it to the first EtherCAT slave station 121 based on the second network link, and receives the returned data from the first EtherCAT slave station 121 through the first receiving network port RX1. Within the EtherCAT master 11, data received by the first receiving network port RX1 is forwarded to the second transmitting network port TX1. Data is then transmitted via the second transmitting network port TX1 to the second EtherCAT slave 122, and then transmitted to the corresponding second target slave via the second network link. Since the second EtherCAT slave 122 is now the second target slave, data is then returned via the second EtherCAT slave 122 and received via the second receiving network port RX2. The EtherCAT master 11 analyzes and processes the data received via the second receiving network port RX2 to determine the corresponding operating status of each EtherCAT slave 12.
[0102] As described above, when both the first and second network ports of the EtherCAT master are connected, i.e., the communication connection between the first network port and the first EtherCAT slave is normal, and the communication connection between the second network port and the second EtherCAT slave is also normal, a comparison is made between the first number of data packets received by the first receiving network port and the second number of data packets received by the second receiving network port to determine whether there is a communication anomaly in the slave link. When it is determined that the communication in the slave link is normal, data transmission is performed based on the first redundant mode to achieve normal data transmission in the EtherCAT master-slave system. When it is determined that there is a communication anomaly in the slave link, data transmission is performed based on the second redundant mode to achieve normal data transmission in the EtherCAT master-slave system. The dual-network-port EtherCAT master performs data transmission in different redundant transmission modes according to different communication connection conditions to ensure normal data transmission in the EtherCAT master-slave system. Compared to existing methods that require the addition of a backup master station or backup node, this embodiment does not require additional hardware equipment, thereby reducing the cost of the EtherCAT master-slave system. Furthermore, different redundant transmission modes can be switched based on the actual communication connection conditions, improving the flexibility and intelligence of EtherCAT master data.
[0103] When detecting the status of the first network port and the second network port, if only one network port has normal communication, the redundant transmission mode is determined to be the third redundant mode. The third redundant mode can be understood as a data transmission mode when only one network port has a communication anomaly. For example, when the first network port is disconnected and the second network port is connected, or when the first network port is connected and the second network port is disconnected, the redundant transmission mode is determined to be the third redundant mode. In the third redundant mode, data is transmitted via the network port that is connected.
[0104] Figure 10 This is a first transmission diagram of a third redundancy mode provided in an embodiment of the present application, referring to Figure 10When the first network port is in a connected state and the second network port is in a disconnected state, the redundant transmission mode is determined to be the third redundant mode. In this case, data is transmitted and received only through the first network port 11. In the third redundant mode, data is sent to the first EtherCAT slave 121 through the first transmitting network port TX1. Based on the transmission of the first network link, the data is transmitted to the second EtherCAT slave 122. The data is then returned by the second EtherCAT slave 122. Based on the transmission of the second network link, the data is transmitted to the first EtherCAT slave 121. The data returned by the first EtherCAT slave 121 is received through the first receiving network port RX1. Data analysis and processing are performed based on the data received by the first receiving network port RX1 to determine the corresponding operating status of each EtherCAT slave 12.
[0105] Figure 11 This is a second transmission diagram of a third redundancy mode provided in an embodiment of the present application, referring to Figure 11 When the first network port is disconnected and the second network port is connected, the redundant transmission mode is determined to be the third redundant mode. In this case, data is only transmitted and received through the second network port 12. In the third redundant mode, data is sent to the second EtherCAT slave 122 via the second transmitting network port TX2. Based on the transmission of the second network link, the data is transmitted to the first EtherCAT slave 121. Because the first network port is disconnected, the data is returned through the first EtherCAT slave 121, and the data is returned to the second EtherCAT slave 122 via the first network link. The returned data is then received from the second EtherCAT slave 122 via the second receiving network port RX2. The EtherCAT master 11 performs data analysis and processing based on the data received by the second receiving network port RX2 to determine the corresponding operating status of each EtherCAT slave 12.
[0106] The above is a data transmission method when the redundant enabling function is performed based on the first enable signal. In addition, there is also a redundant shutdown mode. When the EtherCAT master station receives the second enable signal, it responds to the second enable signal and determines that the working mode is the redundant shutdown mode. The redundant shutdown mode can be understood as data transmission only through the first network port or data transmission only through the second network port. Exemplarily, taking data transmission only through the first network port as an example, in the redundant shutdown mode, the first sending network port is controlled to send data to the first EtherCAT slave station, and the data returned by the first EtherCAT slave station is received through the first receiving network port, wherein the data is transmitted to the second EtherCAT slave station based on the first network link, and is returned to the first EtherCAT slave station based on the second network link through the second EtherCAT slave station; data analysis and processing are performed based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0107] In one embodiment, during the aforementioned data transmission based on the first enable signal, when it is detected that the first network port status and the second network port status are both disconnected, the operating mode is determined to be the redundant closed mode, and data transmission and reception are performed in accordance with the redundant closed mode. It should be noted that, in this case, due to the fact that the first network port status and the second network port status are both disconnected, data transmission to the EtherCAT slave may not be possible. The determination of the operating mode as the redundant closed mode is merely an internal mode switch, and corresponding data transmission cannot be performed until the first network port status becomes connected.
[0108] As described above, a redundancy function is integrated into the EtherCAT master station. By setting two network ports, namely the first network port and the second network port, the link status of the PHY transceiver and the number of data packets sent and received are used to determine the data flow direction (i.e., the working mode), thereby improving the fault recovery function of the EtherCAT network without increasing cost and complexity, thereby improving the data transmission reliability of the EtherCAT network.
[0109] As described above, compared with the existing method that requires additional redundant nodes or backup master stations, this embodiment does not require additional redundant nodes and hardware equipment, and can implement simple functions within the EtherCAT master station. Through the FPGA chip in the EtherCAT master station, the flow direction of the master station data (i.e., the working mode) is automatically switched according to the network status, and it can quickly recover from link failures, thereby reducing the cost of adding redundant nodes or backup master stations, and reducing the complexity of the system, facilitating future maintenance, and thus improving the stability of the system.
[0110] In the above, by setting the first network and the second network port at the EtherCAT master station, when the first network port status corresponding to the first network port and the second network port status corresponding to the second network port are both in the connected state, the first sending network port in the first network port is controlled to send data to the first EtherCAT slave station, and the corresponding data is received through the first receiving network port or the second receiving network port; when the second receiving network port receives the corresponding data, the data is forwarded to the second sending network port in the EtherCAT master station, and the data is sent to the second EtherCAT slave station through the second sending network port, and the data is received through the first receiving network port or the second receiving network port; a first number of data packets received by the first receiving network port and a second number of data packets received by the second receiving network port are counted; a redundant transmission mode is determined according to a comparison result of the first number and the second number, and data is sent and received according to the redundant transmission mode. By adopting the above technical means, there is no need to add an additional backup master station. The corresponding redundant transmission mode can be performed through the first network port and the second network port based on the statistical results of the number of data packets. When there is a single point failure in the link, normal communication can be achieved through the cooperation of the first network port and the second network port. In this way, the technical problem of high cost caused by the additional addition of a backup master station in the EtherCAT master-slave station system can be avoided. Normal data transmission can be achieved based on the cooperation of the first network port and the second network port of the EtherCAT master station, thereby reducing the cost of the EtherCAT master-slave station system with normal data transmission of the EtherCAT master station.
[0111] Based on the above embodiments, Figure 12 This is a structural diagram of a dual-port redundant EtherCAT master station data transmission device provided in an embodiment of the present application. Figure 12The dual-network-port redundant EtherCAT master station data transmission device provided in this embodiment is used for an EtherCAT master station. The EtherCAT master station is used to form an EtherCAT master-slave system with multiple EtherCAT slave stations. The EtherCAT master station includes a first network port and a second network port. The first network port includes a first sending network port and a first receiving network port. The second network port includes a second sending network port and a second receiving network port. Multiple EtherCAT slave stations are connected one by one to form a slave station link. The first sending network port is connected to the first EtherCAT slave station at the first end of the slave station link, and the second EtherCAT slave station at the second end of the slave station link is connected to the second receiving network port. The first sending network port, the slave station link, and the second receiving network port form a first network link; the second sending network port is connected to the second EtherCAT slave station at the second end of the slave station link, and the first EtherCAT slave station at the first end of the slave station link is connected to the first receiving network port. The second sending network port, the slave station link, and the first receiving network port form a second network link. The dual-port redundant EtherCAT master station data transmission device specifically includes: a first enabling response module 21 , a first transceiver control module 22 , a second transceiver control module 23 , a quantity counting module 24 and a first working mode determining module 25 .
[0112] Among them, the first enable response module 21 is used to receive a first enable signal, and in response to the first enable signal, detect the first network port status and the second network port status, the first network port status is the communication connection status between the first network port and the first EtherCAT slave station, and the second network port status is the communication connection status between the second network port and the second EtherCAT slave station;
[0113] The first transceiver control module 22 is configured to control the first transmitting network port to transmit data to the first EtherCAT slave station and receive corresponding data through the first receiving network port or the second receiving network port when both the first network port state and the second network port state are connected;
[0114] The second transceiver control module 23 is configured to forward the data to the second sending network port within the EtherCAT master station when the second receiving network port receives the corresponding data, and send the data to the second EtherCAT slave station through the second sending network port, and receive the data through the first receiving network port;
[0115] A quantity counting module 24 is configured to count a first quantity of data packets received by the first receiving network port and a second quantity of data packets received by the second receiving network port;
[0116] The first working mode determining module 25 is configured to determine a redundant transmission mode according to a comparison result between the first quantity and the second quantity, and transmit and receive data according to the redundant transmission mode.
[0117] In one embodiment, the first working mode determination module 25 includes: a first mode determination submodule, a first sending submodule, a first forwarding submodule, a second sending submodule and a first data processing submodule;
[0118] A first mode determination submodule, configured to determine that the redundant transmission mode is the first redundant mode when the comparison result shows that the first number is less than or equal to the second number;
[0119] A first sending submodule is configured to control the first sending network port to send data to the first EtherCAT slave station and receive corresponding data from the second EtherCAT slave station through the second receiving network port according to the first redundant mode, wherein the data is transmitted from the first EtherCAT slave station to the second EtherCAT slave station based on the first network link;
[0120] The first forwarding submodule is used to forward the data received by the second receiving network port to the second sending network port in the EtherCAT master station;
[0121] a second sending submodule, configured to send data to the second EtherCAT slave station through the second sending network port, and receive corresponding data from the first EtherCAT slave station through the first receiving network port, wherein the data is transmitted from the second EtherCAT slave station to the first EtherCAT slave station based on the second network link;
[0122] The first data processing submodule is used to perform data analysis and processing based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0123] In one embodiment, the first working mode determination module 25 includes: a second mode determination submodule, a target slave station determination submodule, a third sending submodule, a second forwarding submodule, a fourth sending submodule, and a second data processing submodule;
[0124] A second mode determination submodule, configured to determine that the redundant transmission mode is the second redundant mode when the comparison result shows that the first number is greater than the second number;
[0125] A target slave station determination submodule is used to determine, in the second redundant mode, a first target slave station and a second target slave station that have communication disconnection in the slave station link, where the first target slave station and the second target slave station are two adjacent EtherCAT slave stations at corresponding communication disconnection positions;
[0126] a third sending submodule, configured to control the first sending network port to send data based on the first network link, and to receive returned data through the first receiving network port, wherein the data is transmitted to the first target slave station based on the first network link, and is returned to the first receiving network port through the first target slave station based on the second network link;
[0127] The second forwarding submodule is used to forward the data received by the first receiving network port to the second sending network port in the EtherCAT master station;
[0128] a fourth sending submodule, configured to send data via the second sending network port based on the second network link, and receive returned data via the second receiving network port, wherein the data is transmitted to the second target slave station based on the second network link, and is returned to the second receiving network port via the second target slave station based on the first network link;
[0129] The second data processing submodule is used to perform data analysis and processing based on the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0130] In one embodiment, the first working mode determination module 25 further includes: a third mode determination submodule, a fifth sending submodule and a third data processing submodule;
[0131] A third mode determination submodule, configured to determine that the redundant transmission mode is a third redundant mode when the first network port state is a disconnected state and the second network port state is a connected state;
[0132] a fifth sending submodule, configured to, in a third redundant mode, send data to the second EtherCAT slave station through the second sending network port, and receive returned data from the second EtherCAT slave station through the second receiving network port, wherein the data is transmitted to the first EtherCAT slave station based on the second network link, and is returned to the second EtherCAT slave station through the first EtherCAT slave station based on the first network link;
[0133] The third data processing submodule is used to perform data analysis and processing based on the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0134] In one embodiment, the first working mode determination module 25 further includes: a fourth mode determination submodule, a sixth sending submodule and a fourth data processing submodule;
[0135] a fourth mode determination submodule, configured to determine that the redundant transmission mode is a third redundant mode when the first network port is in a connected state and the second network port is in a disconnected state;
[0136] a sixth sending submodule, configured to, in a third redundant mode, send data to the first EtherCAT slave station through the first sending network port, and receive data returned by the first EtherCAT slave station through the first receiving network port, wherein the data is transmitted to the second EtherCAT slave station based on the first network link, and is returned to the first EtherCAT slave station through the second EtherCAT slave station based on the second network link;
[0137] The fourth data processing submodule is used to perform data analysis and processing based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0138] In one embodiment, the EtherCAT master station further includes a first PHY transceiver and a second PHY transceiver, wherein the first PHY transceiver is connected to the first network port, and the second PHY transceiver is connected to the second network port;
[0139] The first enabling response module 21 includes: a signal detection submodule, a first state determination submodule, a second state determination submodule, a third state determination submodule and a fourth state determination submodule;
[0140] a signal detection submodule, configured to detect a first link signal state of the first PHY transceiver and a second link signal state of the second PHY transceiver;
[0141] A first state determination submodule, configured to determine that the first network port state is a disconnected state when the first link signal state is a high level state;
[0142] A second state determination submodule is configured to determine that the first network port state is a connected state when the first link signal state is a low level state;
[0143] A third state determination submodule is used to determine that the second network port state is a disconnected state when the second link signal state is a high level state;
[0144] The fourth state determination submodule is configured to determine that the second network port state is a connected state when the second link signal state is a low level state.
[0145] In one embodiment, the dual-port redundant EtherCAT master station data transmission device further includes: a second enabling response module, a third transceiver control module and a first data analysis module;
[0146] A second enable response module is configured to receive a second enable signal and determine that the operating mode is a redundant shutdown mode in response to the second enable signal;
[0147] a third transceiver control module, configured to, in a redundancy-off mode, control the first transmitting network port to transmit data to the first EtherCAT slave station, and receive data returned by the first EtherCAT slave station through the first receiving network port, wherein the data is transmitted to the second EtherCAT slave station based on the first network link, and is returned to the first EtherCAT slave station through the second EtherCAT slave station based on the second network link;
[0148] The first data analysis module is used to perform data analysis and processing based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0149] In one embodiment, the dual-port redundant EtherCAT master data device further includes: a redundancy shutdown control module;
[0150] The redundant shutdown control module is used to determine the working mode as redundant shutdown mode when detecting that the first network port state and the second network port state are both disconnected in the corresponding redundant transmission mode, and to send and receive data according to the redundant shutdown mode.
[0151] The dual-port redundant EtherCAT master station data transmission device provided in the embodiment of the present application can be used to execute the dual-port redundant EtherCAT master station data transmission method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0152] The present invention provides a dual-port redundant EtherCAT master station data transmission device. Figure 13 The dual-port redundant EtherCAT master station data transmission device includes a processor 31, a memory 32, a communication module 33, an input device 34, and an output device 35. The dual-port redundant EtherCAT master station data transmission device may include one or more processors, and one or more memories. The processor, memory, communication module, input device, and output device of the dual-port redundant EtherCAT master station data transmission device may be connected via a bus or other means.
[0153] The memory 32 is a computer-readable storage medium that can be used to store software programs, computer executable programs, and modules, such as the program instructions / modules corresponding to the dual-port redundant EtherCAT master station data transmission method of any embodiment of the present application (for example, the first enable response module, the first transceiver control module, the second transceiver control module, the quantity statistics module, and the first working mode determination module in the dual-port redundant EtherCAT master station data transmission device). The memory may mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required for a function; the data storage area can store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory may further include a memory remotely located relative to the processor, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0154] The communication module 33 is used for data transmission.
[0155] The processor 31 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory, that is, realizes the above-mentioned dual-port redundant EtherCAT master station data transmission method.
[0156] The input device 34 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 35 may include a display device such as a display screen.
[0157] The dual-network-port redundant EtherCAT master station data transmission device provided above can be used to execute the dual-network-port redundant EtherCAT master station data transmission method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0158] The embodiment of the present application also provides a storage medium storing computer executable instructions, which are used to execute a dual-network-port redundant EtherCAT master station data transmission method when executed by a computer processor. The dual-network-port redundant EtherCAT master station data transmission method includes: receiving a first enable signal, responding to the first enable signal, detecting a first network port state and a second network port state, the first network port state being a communication connection state between the first network port and the first EtherCAT slave station, and the second network port state being a communication connection state between the second network port and the second EtherCAT slave station; when the first network port state and the second network port state are both connected When in the state, the first sending network port is controlled to send data to the first EtherCAT slave station, and the corresponding data is received through the first receiving network port or the second receiving network port; when the second receiving network port receives the corresponding data, the EtherCAT master station forwards the data to the second sending network port, and sends the data to the second EtherCAT slave station through the second sending network port, and receives the data through the first receiving network port; counts a first number of data packets received by the first receiving network port and a second number of data packets received by the second receiving network port; determines a redundant transmission mode according to a comparison result of the first number and the second number, and sends and receives data according to the redundant transmission mode.
[0159] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROMs, floppy disks, or tape drives; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disks or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or it may be located in a different second computer system that is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). The storage medium may store program instructions (e.g., embodied as a computer program) that can be executed by one or more processors.
[0160] Of course, the computer executable instructions of the storage medium storing computer executable instructions provided in the embodiment of the present application are not limited to the above dual-network-port redundant EtherCAT master station data transmission method, and can also execute the relevant operations in the dual-network-port redundant EtherCAT master station data transmission method provided in any embodiment of the present application.
[0161] The dual-network-port redundant EtherCAT master station data transmission device, storage medium, and dual-network-port redundant EtherCAT master station data transmission equipment provided in the above embodiments can execute the dual-network-port redundant EtherCAT master station data transmission method provided in any embodiment of the present application. For technical details not fully described in the above embodiments, please refer to the dual-network-port redundant EtherCAT master station data transmission method provided in any embodiment of the present application.
[0162] The above are only preferred embodiments of the present application and the technical principles employed. The present application is not limited to the specific embodiments described herein, and any obvious changes, readjustments, and substitutions that are apparent to those skilled in the art will not depart from the scope of protection of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of the present application. The scope of the present application is determined by the scope of the claims.
Claims
1. A dual-port redundant EtherCAT master station data transmission method, characterized in that: Used for an EtherCAT master station, the EtherCAT master station is used to form an EtherCAT master-slave system with multiple EtherCAT slave stations, the EtherCAT master station includes a first network port and a second network port, the first network port includes a first sending network port and a first receiving network port, the second network port includes a second sending network port and a second receiving network port, the multiple EtherCAT slave stations are connected one by one to form a slave link, the first sending network port is connected to the first EtherCAT slave station at the first end of the slave link, the second EtherCAT slave station at the second end of the slave link is connected to the second receiving network port, the first sending network port, the slave link and the second receiving network port form a first network link; the second sending network port is connected to the second EtherCAT slave station at the second end of the slave link, the first EtherCAT slave station at the first end of the slave link is connected to the first receiving network port, the second sending network port, the slave link and the first receiving network port form a second network link; The method comprises: receiving a first enable signal, and detecting a first network port status and a second network port status in response to the first enable signal, wherein the first network port status is a communication connection status between the first network port and the first EtherCAT slave station, and the second network port status is a communication connection status between the second network port and the second EtherCAT slave station; When both the first network port state and the second network port state are connected, controlling the first sending network port to send data to the first EtherCAT slave station, and receiving corresponding data through the first receiving network port or the second receiving network port; When the second receiving network port receives corresponding data, the EtherCAT master station forwards the data to the second sending network port, and sends the data to the second EtherCAT slave station through the second sending network port, and receives the data through the first receiving network port; Counting a first number of data packets received by the first receiving network port and a second number of data packets received by the second receiving network port; A redundant transmission mode is determined according to a comparison result of the first quantity and the second quantity, and data is sent and received according to the redundant transmission mode.
2. The method according to claim 1, characterized in that The determining of a redundant transmission mode according to a comparison result of the first quantity and the second quantity, and sending and receiving data according to the redundant transmission mode, includes: When the comparison result shows that the first number is less than or equal to the second number, determining that the redundant transmission mode is the first redundant mode; According to the first redundant mode, controlling the first transmitting network port to transmit data to the first EtherCAT slave station, and receiving corresponding data from the second EtherCAT slave station through the second receiving network port, wherein the data is transmitted from the first EtherCAT slave station to the second EtherCAT slave station based on the first network link; In the EtherCAT master station, forwarding the data received by the second receiving network port to the second sending network port; sending the data to the second EtherCAT slave station through the second sending network port, and receiving corresponding data from the first EtherCAT slave station through the first receiving network port, wherein the data is transmitted from the second EtherCAT slave station to the first EtherCAT slave station based on the second network link; Data analysis and processing are performed based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
3. The method according to claim 1, characterized in that The determining of a redundant transmission mode according to a comparison result of the first quantity and the second quantity, and sending and receiving data according to the redundant transmission mode, includes: When the comparison result shows that the first number is greater than the second number, determining that the redundant transmission mode is the second redundant mode; In the second redundancy mode, determining that there are a first target slave station and a second target slave station with communication disconnected in the slave station link, the first target slave station and the second target slave station being two adjacent EtherCAT slave stations at corresponding communication disconnected positions; Controlling the first sending network port to send data based on the first network link, and to receive returned data through the first receiving network port, wherein the data is transmitted to the first target slave station based on the first network link, and is returned to the first receiving network port through the first target slave station based on the second network link; In the EtherCAT master station, forwarding the data received by the first receiving network port to the second sending network port; sending the data through the second sending network port based on the second network link, and receiving the returned data through the second receiving network port, wherein the data is transmitted to the second target slave station based on the second network link, and is returned to the second receiving network port through the second target slave station based on the first network link; Data analysis and processing are performed based on the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave station.
4. The method according to claim 1, wherein After receiving the first enable signal and detecting the first network port status and the second network port status in response to the first enable signal, the method includes: When the first network port state is a disconnected state and the second network port state is a connected state, determining that the redundant transmission mode is a third redundant mode; In the third redundant mode, data is sent to the second EtherCAT slave station through the second sending network port, and returned data is received from the second EtherCAT slave station through the second receiving network port, wherein the data is transmitted to the first EtherCAT slave station based on the second network link, and is returned to the second EtherCAT slave station based on the first network link through the first EtherCAT slave station; Data analysis and processing are performed based on the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave station.
5. The method according to claim 1, wherein After receiving the first enable signal and detecting the first network port status and the second network port status in response to the first enable signal, the method includes: When the first network port state is a connected state and the second network port state is a disconnected state, determining that the redundant transmission mode is a third redundant mode; In the third redundancy mode, data is sent to the first EtherCAT slave through the first sending network port, and data returned by the first EtherCAT slave is received through the first receiving network port, wherein the data is transmitted to the second EtherCAT slave based on the first network link, and is returned to the first EtherCAT slave through the second EtherCAT slave based on the second network link; Data analysis and processing are performed based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
6. The method according to claim 1, characterized in that The EtherCAT master station further includes a first PHY transceiver and a second PHY transceiver, wherein the first PHY transceiver is connected to the first network port, and the second PHY transceiver is connected to the second network port; Detecting the first network port status and the second network port status includes: detecting a first link signal state of the first PHY transceiver, and detecting a second link signal state of the second PHY transceiver; When the first link signal state is in a high level state, determining that the first network port state is a disconnected state; When the first link signal state is in a low level state, determining that the first network port state is a connected state; When the second link signal state is in a high level state, determining that the second network port state is a disconnected state; When the second link signal state is in a low level state, it is determined that the second network port state is in a connected state.
7. The method according to claim 1, characterized in that The method further comprises: receiving a second enable signal, and determining, in response to the second enable signal, that the operating mode is a redundancy off mode; In the redundancy shutdown mode, controlling the first transmitting network port to send data to the first EtherCAT slave station, and receiving data returned by the first EtherCAT slave station through the first receiving network port, wherein the data is transmitted to the second EtherCAT slave station based on the first network link, and is returned to the first EtherCAT slave station through the second EtherCAT slave station based on the second network link; Data analysis and processing are performed based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: In the corresponding redundant transmission mode, when it is detected that the first network port status and the second network port status are both disconnected, the working mode is determined to be the redundant closed mode, and data is sent and received according to the redundant closed mode.
9. A dual-port redundant EtherCAT master station data transmission device, characterized in that: Used for an EtherCAT master station, the EtherCAT master station is used to form an EtherCAT master-slave system with multiple EtherCAT slave stations, the EtherCAT master station includes a first network port and a second network port, the first network port includes a first sending network port and a first receiving network port, the second network port includes a second sending network port and a second receiving network port, the multiple EtherCAT slave stations are connected one by one to form a slave link, the first sending network port is connected to the first EtherCAT slave station at the first end of the slave link, the second EtherCAT slave station at the second end of the slave link is connected to the second receiving network port, the first sending network port, the slave link and the second receiving network port form a first network link; the second sending network port is connected to the second EtherCAT slave station at the second end of the slave link, the first EtherCAT slave station at the first end of the slave link is connected to the first receiving network port, the second sending network port, the slave link and the first receiving network port form a second network link; The device comprises: a first enable response module, configured to receive a first enable signal and, in response to the first enable signal, detect a first network port status and a second network port status, wherein the first network port status is a communication connection status between the first network port and the first EtherCAT slave station, and the second network port status is a communication connection status between the second network port and the second EtherCAT slave station; A first transceiver control module is configured to control the first transmitting network port to transmit data to the first EtherCAT slave station and receive corresponding data through the first receiving network port or the second receiving network port when both the first network port and the second network port are in a connected state; A second transceiver control module is configured to, when the second receiving network port receives corresponding data, forward the data to the second sending network port in the EtherCAT master station, and send the data to the second EtherCAT slave station through the second sending network port, and receive the data through the first receiving network port; a quantity counting module, configured to count a first quantity of data packets received by the first receiving network port and a second quantity of data packets received by the second receiving network port; The first working mode determination module is configured to determine a redundant transmission mode according to a comparison result between the first quantity and the second quantity, and transmit and receive data according to the redundant transmission mode.
10. A dual-port redundant EtherCAT master station data transmission device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
11. A storage medium storing computer executable instructions, characterized in that: The computer executable instructions, when executed by a processor, are for performing the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
FPGA-based Ethercat annular dual-redundancy link switching method and system
CN115442218A
EtherCAT master station redundancy architecture system based on adaptive control
CN220173264U