Communication method, EtherCAT system, communication device and storage medium

The EtherCAT slaves extract equipment parameters and use preset communication protocols with higher fault tolerance, which solves the problem of misjudgment of communication faults caused by low fault tolerance of the EtherCAT protocol, ensuring the normal operation of functional equipment in automated production.

CN115913884BActive Publication Date: 2025-07-29DONGGUAN ANDA AUTOMATIC EQUIP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211463966.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-22
Publication Date
2025-07-29
Estimated Expiration
2042-11-22

AI Technical Summary

Technical Problem

The EtherCAT protocol has low fault tolerance in automated production, resulting in misjudgment of communication failures and affecting the normal operation of functional equipment.

Method used

The EtherCAT slave extracts device parameters, determines the target device according to the preset communication protocol and sends the target data. The fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol to avoid misjudgment.

Benefits of technology

Reduces the probability of misjudgment of communication failures and ensures that functional equipment can still operate normally when transient data reception is abnormal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115913884B_ABST
    Figure CN115913884B_ABST
Patent Text Reader

Abstract

The present application discloses a communication method, an EtherCAT system, a communication device and a storage medium, relating to the field of communication technologies. The EtherCAT slave station is communicatively connected to the EtherCAT master station, and the EtherCAT slave station is also respectively communicatively connected to a plurality of functional devices. The EtherCAT slave station extracts device parameters from the EtherCAT packets sent by the EtherCAT master station, determines a target device from the plurality of functional devices according to the device parameters, and determines target data corresponding to the target device, and then sends the target data to the target device according to a preset communication protocol. The communication between the EtherCAT slave station and the functional device is not based on the EtherCAT protocol, but on a preset communication protocol, and the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol. Therefore, when the functional device is temporarily unable to receive the data sent by the EtherCAT slave station, due to the high fault tolerance of the preset communication protocol, at this time, the EtherCAT slave station will not determine that the functional device is abnormal, thereby reducing the probability of misjudgment of communication faults.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to, but is not limited to, the field of communication technologies, and particularly relates to a communication method, an EtherCAT system, a communication device, and a storage medium. Background Art

[0002] In automated production, Ethernet for Control Automation Technology (EtherCAT) is usually used for industrial control. An industrial control system usually consists of a master station and multiple slave stations. The master station sends control instructions to each slave station and monitors the status of the slave stations for exception handling. For a slave station, each slave station can control multiple functional devices to complete the processing and production of a product, and the EtherCAT protocol is often used for communication between the slave station and the functional devices. However, due to the low fault tolerance of the EtherCAT protocol, that is, the fault duration corresponding to the determination of signal interruption or link failure is relatively short. For example, when the connection between the functional device and the slave station is abnormal, the functional device fails to respond in time within the fault duration set by EtherCAT. At this time, EtherCAT determines that the functional device is abnormal and enters the exception handling process. However, during actual operation, the functional device does not affect the normal function execution when the connection is abnormal, that is, it does not affect the processing and production of the product. Therefore, for the above situation, when using the EtherCAT protocol for interaction between the master station, slave stations, and functional devices, it is easy to misjudge communication faults due to the low fault tolerance of the EtherCAT protocol. Therefore, there is an urgent need for a communication method that can meet the requirements of industrial control timeliness and security while reducing misjudgment of communication faults. Summary of the Invention

[0003] This application aims to solve at least one of the technical problems existing in the prior art. For this purpose, this application provides a communication method, an EtherCAT system, a communication device, and a storage medium, which can reduce the probability of misjudgment of communication faults.

[0004] In a first aspect, an embodiment of this application provides a communication method, which is applied to an EtherCAT slave station of Ethernet for Control Automation Technology EtherCAT. The EtherCAT slave station is communicatively connected to the EtherCAT master station, and the EtherCAT slave station is also communicatively connected to multiple functional devices respectively. The method includes:

[0005] Receiving an EtherCAT message sent by an EtherCAT master station;

[0006] Extracting device parameters from the EtherCAT message;

[0007] Determine a target device from the multiple functional devices according to the device parameters and determine target data corresponding to the target device;

[0008] Send the target data to the target device according to a preset communication protocol; wherein, the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol.

[0009] In a second aspect, an embodiment of the present application provides an EtherCAT system, which is characterized in that it includes an EtherCAT master station, an EtherCAT slave station, and multiple functional devices. The EtherCAT master station is communicatively connected to the EtherCAT slave station, and the EtherCAT slave station is respectively communicatively connected to the multiple functional devices.

[0010] The EtherCAT master station is used to send EtherCAT messages to the EtherCAT slave station;

[0011] The EtherCAT slave station is used for:

[0012] Receive the EtherCAT message;

[0013] Extract device parameters from the EtherCAT message;

[0014] Determine a target device from the multiple functional devices according to the device parameters and determine target data corresponding to the target device;

[0015] Send the target data to the target device according to a preset communication protocol; wherein, the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol.

[0016] In a third aspect, an embodiment of the present application provides a communication device, which is applied to an EtherCAT slave station. The EtherCAT slave station is communicatively connected to an EtherCAT master station, and the EtherCAT slave station is also respectively communicatively connected to multiple functional devices. The communication device includes:

[0017] A receiving module, which is used to receive the EtherCAT message sent by the EtherCAT master station;

[0018] An extraction module, which is used to extract device parameters from the EtherCAT message;

[0019] A determination module, which is used to determine a target device from the multiple functional devices according to the device parameters and determine target data corresponding to the target device;

[0020] A sending module, which is configured to send the target data to the target device according to a preset communication protocol; wherein, the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol.

[0021] In a fourth aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the communication method described in any one of the first aspects is implemented.

[0022] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for implementing at least the communication method described in any one of the first aspects of the present application.

[0023] The above embodiments of the present application have at least the following beneficial effects: The EtherCAT slave station is communicatively connected to the EtherCAT master station, and the EtherCAT slave station is also respectively communicatively connected to a plurality of functional devices. The EtherCAT slave station extracts device parameters from the EtherCAT packets sent by the EtherCAT master station, determines the target device from the plurality of functional devices according to the device parameters, and determines the target data corresponding to the target device, and then sends the target data to the target device according to a preset communication protocol. The communication between the EtherCAT slave station and the functional device is not based on the EtherCAT protocol, but on a preset communication protocol, and the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol. Therefore, when the functional device has a situation where it cannot receive the data sent by the EtherCAT slave station temporarily, due to the high fault tolerance of the preset communication protocol, that is, the preset communication protocol determines that the fault duration corresponding to the signal interruption or link failure is longer. At this time, the slave station will not determine that the functional device is abnormal. Therefore, the master station can continue to communicate with the slave station normally, thereby reducing the probability of misjudgment of communication faults.

[0024] The additional aspects and advantages of the present application will be partly given in the following description, partly will become obvious from the following description, or will be understood through the practice of the present application. Description of the Drawings

[0025] The following will further illustrate the present application in conjunction with the drawings and embodiments, where:

[0026] Figure 1 is a schematic structural diagram of an EtherCAT system according to some embodiments of the present application;

[0027] Figure 2 is a schematic flowchart of a communication method according to some embodiments of the present application;

[0028] Figure 3Schematic flowchart of the communication method according to other embodiments of the present application;

[0029] Figure 4 Schematic flowchart of the communication method according to other embodiments of the present application;

[0030] Figure 5 Schematic flowchart of the communication method according to other embodiments of the present application;

[0031] Figure 6 Schematic structural diagram of the communication device according to some embodiments of the present application;

[0032] Figure 7 Schematic structural diagram of the electronic device according to some embodiments of the present application. Detailed implementation manners

[0033] The embodiments of the present application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary only for explaining the present application and should not be construed as limiting the present application.

[0034] In the description of the present application, it should be understood that the orientation or positional relationship indicated by terms such as up, down, front, back, left, right, etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for facilitating the description of the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present application.

[0035] In the description of the present application, the meaning of several is more than one, the meaning of multiple is more than two, greater than, less than, exceeding, etc. are understood as not including the recited number, and above, below, within, etc. are understood as including the recited number. If the first and second are described only for the purpose of distinguishing technical features, they should not be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features or implicitly indicating the sequence of the indicated technical features.

[0036] In the description of the present application, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and those skilled in the art can reasonably determine the specific meanings of the above terms in the present application in combination with the specific content of the technical solution.

[0037] In the description of this application, the description referring to terms such as "one embodiment", "some embodiments", "schematic embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this application. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.

[0038] In the automation production of related technologies, Ethernet for Control Automation Technology (EtherCAT) is usually used for industrial control. The master control module serves as an EtherCAT slave station. The EtherCAT slave station establishes a communication connection with the EtherCAT master station based on the EtherCAT protocol, and the EtherCAT slave station respectively establishes communication connections with multiple functional devices based on the EtherCAT protocol. The EtherCAT slave station sends messages to the functional devices, and the functional devices perform corresponding actions according to the messages. During the execution of the corresponding actions by the functional devices, there will be a situation where the messages sent by the EtherCAT slave station cannot be received temporarily, but this does not affect the operation of the functional devices. Due to the low fault tolerance of the EtherCAT protocol, when the functional devices have a situation where the messages sent by the control module cannot be received temporarily, the EtherCAT slave station will misjudge it as a failure. For example, for a functional device used for grasping, it is fixed on the transmission device by means of pins and moves with the transmission device. During the movement of the transmission device, there will inevitably be vibrations. At this time, the connection between the functional device and the transmission device causes temporary poor contact or loose wiring, resulting in the situation where the functional device cannot respond in time or cannot receive the messages sent by the EtherCAT slave station temporarily. At this time, the EtherCAT slave station misjudges that the functional device has failed, thereby triggering a fault response mechanism, which will cause a preset waiting time to be required before the functional device can communicate with the master station normally after the connection between the functional device and the slave station is normal. Based on this, the embodiments of this application provide a communication method, an EtherCAT system, a communication device, and a storage medium, which can reduce the probability of misjudgment of communication faults and can reduce the occurrence of situations where the functional devices cannot operate normally due to misjudgment of communication faults.

[0039] Refer to Figure 1 , Figure 1This is a schematic structural diagram of the EtherCAT system provided by the embodiments of the present application. The system includes an EtherCAT master station, an EtherCAT slave station, and multiple functional devices. The EtherCAT master station is communicatively connected to the EtherCAT slave station, and the EtherCAT slave station is respectively communicatively connected to multiple functional devices. The EtherCAT master station and the EtherCAT slave station establish a communication connection through the EtherCAT protocol, and the EtherCAT slave station and the functional devices establish a communication connection through a preset communication protocol.

[0040] It should be noted that EtherCAT is an open architecture fieldbus system based on Ethernet. EtherCAT is a deterministic industrial Ethernet. EtherCAT uses a full-duplex Ethernet physical layer, and a slave station may have two or more ports. If the slave station does not detect other devices downstream of it, the controller of the slave station will automatically close the corresponding port and send back an Ethernet frame. Due to the above characteristics, EtherCAT supports almost all network topologies, including bus, tree, or star, and the commonly used bus topology in fieldbuses can also be used in Ethernet.

[0041] It should be noted that Figure 1 1 EtherCAT slave station is shown in Figure 1 which is only an example and should not be construed as a limitation to the present application. Multiple EtherCAT slave stations can be provided, and each EtherCAT slave station is communicatively connected to the EtherCAT master station; Figure 1 It is also shown that 1 EtherCAT slave station is connected to 3 functional devices, which is only an example and should not be construed as a limitation to the present application. An EtherCAT slave station can be connected to more or fewer functional devices. Those skilled in the art can set the number of EtherCAT slave stations and the number of functional devices connected to an EtherCAT slave station according to actual needs. When the number of EtherCAT slave stations is more than 2, the number of functional devices connected to different EtherCAT slave stations can be the same or different.

[0042] It should be noted that a functional device can refer to a device that can complete some production processes. For example, a functional device can be a loading device that can complete a loading action according to the data sent by the EtherCAT slave station; or, a functional device can be an unloading device that can complete an unloading action according to the data sent by the EtherCAT slave station.

[0043] Referring to Figure 2 , the embodiments of the present application provide a communication method that can be applied to Figure 1 the EtherCAT slave station shown in, and the communication method can include but is not limited to the following steps:

[0044] Step S210: Receive an EtherCAT message sent by an EtherCAT master station;

[0045] Step S220: Extract device parameters from the EtherCAT message;

[0046] Step S230: Determine a target device from multiple functional devices according to the device parameters and determine target data corresponding to the target device;

[0047] Step S240: Send the target data to the target device according to a preset communication protocol; wherein, the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol.

[0048] In the communication method of the embodiment of the present application, the EtherCAT slave station is communicatively connected to the EtherCAT master station, and the EtherCAT slave station is also communicatively connected to multiple functional devices respectively. The EtherCAT slave station extracts device parameters from the EtherCAT message sent by the EtherCAT master station, determines a target device from multiple functional devices according to the device parameters and determines target data corresponding to the target device, and then sends the target data to the target device according to a preset communication protocol. The communication between the EtherCAT slave station and the functional device is not based on the EtherCAT protocol, but on a preset communication protocol, and the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol. Therefore, when the functional device is temporarily unable to receive the data sent by the EtherCAT slave station, since the fault tolerance of the preset communication protocol is relatively high, that is, the preset communication protocol determines that the fault duration corresponding to the signal interruption or link failure is longer. At this time, the EtherCAT slave station will not determine that the functional device is abnormal. Therefore, the EtherCAT master station can continue to communicate with the EtherCAT slave station normally, thereby reducing the probability of misjudgment of communication faults.

[0049] It should be noted that the preset communication protocol is different from the EtherCAT protocol, and those skilled in the art can set the preset communication protocol according to the actual situation, so that when the functional device is temporarily unable to receive the data sent by the EtherCAT slave station, the preset communication protocol will not be misjudged as a fault.

[0050] It is worth noting that in step S220 of some embodiments, the EtherCAT slave station determines whether the address in the address area of the EtherCAT message is the same as the local address. When the address in the address area of the EtherCAT message is the same as the local address, the data is read from the data area of the EtherCAT message to obtain the device parameters.

[0051] It can be understood that with reference to Figure 3, step S230 may include but is not limited to the following steps:

[0052] Step S310, determine a target device from multiple functional devices according to the address ranges and the first address corresponding to each functional device recorded in a preset address mapping conversion table, and determine a device offset corresponding to the target device; the first address is one of the parameters of the device parameters;

[0053] Step S320, obtain a second address by subtracting the device offset from the first address;

[0054] Step S330, obtain target data according to the second address and the functional parameters; the functional parameters are one of the parameters of the device parameters.

[0055] It should be noted that an address mapping conversion table is preset in the EtherCAT slave station. The address mapping conversion table is provided with multiple address ranges, each address range corresponds to the address of a functional device, and each address range corresponds to a device offset. When the first address falls within a certain address range, according to this address range, the functional device corresponding to the first address can be determined as the target device from the address mapping conversion table, and the device offset corresponding to the target device can be determined. Then, the second address is obtained by subtracting the device offset from the first address. Among them, the second address is the actual address used by the target device to set the functional parameters; the target data is obtained according to the second address and the functional parameters.

[0056] It should be noted that in step S310, the target device and the device offset corresponding to the target device can be determined simultaneously directly according to the address ranges and the first address corresponding to each functional device recorded in the preset address mapping conversion table. It can also be to determine the target device according to the address ranges and the first address corresponding to each functional device recorded in the preset address mapping conversion table, and then determine the device offset corresponding to the target device according to the target device. The embodiments of the present application do not limit how to determine the device offset.

[0057] It should be noted that when the traditional EtherCAT protocol is processed, in order to distinguish multiple device functions with the same function, an EtherCAT message carrying the device number is usually sent to the slave station first, and then the function parameters corresponding to the device number and the address for setting the function parameters are sent. In the method using the device offset, since the device offsets corresponding to different functional devices are different, the addresses corresponding to the same function are in different address ranges at this time. At this time, the device number information of the device is carried in the first address. Therefore, after receiving the first address, the slave station can determine the corresponding device number according to the corresponding address range, and correspondingly, it can also determine the address information (i.e., the second address) actually to be sent to the device number. Therefore, through steps S310 to S330, the communication efficiency between the EtherCAT slave station and the EtherCAT master station can be improved.

[0058] Exemplarily, in Figure 1 an EtherCAT master station establishes a communication connection with an EtherCAT slave station through the EtherCAT protocol; the EtherCAT slave station establishes communication connections with functional device 1, functional device 2, and functional device 3 through a preset communication protocol respectively. The address mapping conversion table records the address ranges corresponding to each functional device. The address range corresponding to functional device 1 is address range 1, the address range corresponding to functional device 2 is address range 2, and the address range corresponding to functional device 3 is address range 3; the address mapping conversion table also records the device offsets corresponding to each functional device. The device offset corresponding to functional device 1 is offset 1, the device offset corresponding to functional device 2 is offset 2, and the device offset corresponding to functional device 3 is offset 3. The EtherCAT master station sends an EtherCAT message to the EtherCAT slave station. The EtherCAT slave station extracts device parameters from the EtherCAT message. When the first address in the device parameters belongs to address range 2, it can be determined that the target device is functional device 2, and the device offset of the target device is determined to be offset 2. Then, on the basis of the first address, subtracting offset 2 obtains the second address. At this time, the second address is the actual address for functional device 2 to set function parameters. Then, according to the second address and the function parameters, target data is obtained. When the EtherCAT slave station sends the target data to functional device 2, after receiving the target data, functional device 2 writes the function parameters to the second address so that functional device 2 can perform corresponding actions according to the function parameters.

[0059] In some other embodiments, referring to Figure 4 the communication method of the present application further includes but is not limited to the following steps:

[0060] Step S410, storing the device parameters as cached data in a cache;

[0061] Step S420: Determine the execution period of each cached data in the cache through a preset periodic sending task;

[0062] Correspondingly, step S230 may include but is not limited to the following steps:

[0063] Within the execution period corresponding to the target data, determine the target device from multiple functional devices according to the device parameters and determine the target data corresponding to the target device.

[0064] In this embodiment, the device parameters are stored in the cache as cached data, and then the execution period of each cached data in the cache is determined through a preset periodic sending task. Within the execution period corresponding to the target data, the target device is determined from multiple functional devices according to the device parameters and the target data corresponding to the target device is determined. Moreover, the target data can be sent to the target device during the execution period. In this way, the target data is sent to the target device periodically, so that when the target device can communicate with the EtherCAT slave normally, it can receive the target data. Therefore, even if the target device has a situation where it cannot receive the message sent by the EtherCAT slave temporarily, it will not affect the normal operation of the target device.

[0065] It can be understood that the device parameters include the first address and the function parameters; referring to Figure 5 , step S410 may include but is not limited to the following steps:

[0066] Step S510: Determine the target cache from multiple first caches according to the first address and the address mapping conversion table, where the first caches correspond to the functional devices one by one;

[0067] Step S520: Store the device parameters in the target cache as cached data;

[0068] Correspondingly, step S420 may include but is not limited to the following steps:

[0069] Traverse each first cache in turn through the periodic sending task to determine the execution period of each cached data in each first cache.

[0070] It should be noted that since multiple functional devices are connected to the EtherCAT slave station, in order to facilitate sending corresponding target data to multiple functional devices, a corresponding first buffer is set for each functional device in the EtherCAT slave station. By traversing each first buffer, the target data corresponding to the target device is read from the first buffer. It should be noted that setting multiple first buffers enables the functional parameters corresponding to each functional device to be sent within one cycle, further ensuring the normal operation of each functional device. And each first buffer corresponds to a functional device. At this time, the device offset of the first buffer is determined. At this time, the relationship between the first buffer and the device offset can be established. When the buffer data is read, the second address can be quickly determined without having to look up the table again.

[0071] It can be understood that in some other embodiments, the communication method of the present application may further include but is not limited to the following steps:

[0072] Resend the target data to the target device according to the preset retransmission mechanism.

[0073] The communication method of the embodiment of the present application is provided with a retransmission mechanism, which can ensure the reliability of communication. Since the functional device may temporarily fail to receive the message sent by the EtherCAT slave station, therefore, according to the preset retransmission mechanism, the target data is sent to the target device so that when the target device can communicate with the EtherCAT slave station normally, it can receive the target data. Therefore, even if the target device temporarily fails to receive the message sent by the EtherCAT slave station, it will not affect the normal operation of the target device.

[0074] Specifically, resending the target data to the target device according to the preset retransmission mechanism may specifically include the following steps:

[0075] When the response instruction corresponding to the target data is not received within the first preset duration, the target data is repeatedly sent to the target device a preset number of times at a preset first time interval.

[0076] To ensure the reliability of communication, when the target device receives the target data, it needs to send a response instruction corresponding to the target data to the EtherCAT slave station according to the target data, so that the EtherCAT slave station can determine that the target device has received the target data based on the response instruction. When the EtherCAT slave station does not receive the response instruction corresponding to the target data within the first preset duration, the EtherCAT slave station repeats sending the target data to the target device a preset number of times at a preset first time interval. During the repeated sending process, when the EtherCAT slave station receives the response instruction, it confirms that the target device has received the target data, and thus the EtherCAT slave station stops resending the target data to the target device. When the number of times the EtherCAT slave station repeats sending the target data reaches the preset number and still no response instruction is received, the EtherCAT slave station confirms that there is a fault in the communication connection between the EtherCAT slave station and the target device, and thus the EtherCAT slave station sends a fault message to the EtherCAT master station, so that relevant personnel can learn the fault message through the EtherCAT master station and take corresponding measures.

[0077] It should be noted that this application does not limit the first preset duration, the first time interval, and the preset number of times. Those skilled in the art can set the first preset duration, the first time interval, and the preset number of times according to the actual situation.

[0078] The embodiment of this application also provides an EtherCAT system, including an EtherCAT master station, an EtherCAT slave station, and multiple functional devices. The EtherCAT master station is communicatively connected to the EtherCAT slave station, and the EtherCAT slave station is communicatively connected to the multiple functional devices respectively.

[0079] The EtherCAT master station is used to send EtherCAT messages to the EtherCAT slave station;

[0080] The EtherCAT slave station is used for:

[0081] Receiving EtherCAT messages;

[0082] Extracting device parameters from the EtherCAT messages;

[0083] Determining the target device from the multiple functional devices according to the device parameters and determining the target data corresponding to the target device;

[0084] Sending the target data to the target device according to a preset communication protocol; wherein, the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol.

[0085] The EtherCAT system of this embodiment can be Figure 1The EtherCAT system shown. The EtherCAT master station sends an EtherCAT message to the EtherCAT slave station. The EtherCAT slave station receives the EtherCAT message, extracts device parameters from the EtherCAT message, determines a target device from multiple functional devices according to the device parameters, determines target data corresponding to the target device, and then sends the target data to the target device according to a preset communication protocol. The communication between the EtherCAT slave station and the functional device is not based on the EtherCAT protocol, but on a preset communication protocol, and the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol. Therefore, when the functional device has a situation where it cannot receive the data sent by the EtherCAT slave station temporarily, due to the higher fault tolerance of the preset communication protocol, that is, the preset communication protocol determines that the fault duration corresponding to the signal interruption or link failure is longer. At this time, the EtherCAT slave station will not determine that the functional device is abnormal. Therefore, the EtherCAT master station can continue to communicate with the EtherCAT slave station normally, thereby reducing the probability of misjudging faults.

[0086] It should be noted that, in some embodiments, the functional device is installed on the control board of the EtherCAT slave station in a way of pin insertion, so as to realize the communication connection between the functional device and the EtherCAT slave station. Since the pin insertion method belongs to a detachable connection and the stability is low, when the functional device performs corresponding actions, the pin insertion between the functional device and the EtherCAT slave station may become loose. Therefore, the functional device may have a situation where it cannot communicate with the EtherCAT slave station temporarily.

[0087] Refer to Figure 6 , an embodiment of the present application provides a communication device 600, which is applied to an EtherCAT slave station. The EtherCAT slave station is communicatively connected to an EtherCAT master station, and the EtherCAT slave station is also communicatively connected to multiple functional devices respectively. The communication device 600 includes:

[0088] A receiving module 610, which is used to receive the EtherCAT message sent by the EtherCAT master station;

[0089] An extraction module 620, which is used to extract device parameters from the EtherCAT message;

[0090] A determination module 630, which is used to determine a target device from multiple functional devices according to the device parameters and determine target data corresponding to the target device;

[0091] A sending module 640 is configured to send target data to a target device according to a preset communication protocol, where the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol.

[0092] The communication device 600 receives an EtherCAT message sent by an EtherCAT master through a receiving module 610, then extracts device parameters from the EtherCAT message through an extraction module 620, determines a target device from multiple functional devices according to the device parameters through a determination module 630, and determines target data corresponding to the target device, and then sends the target data to the target device according to a preset communication protocol through the sending module 640. Since the communication between the EtherCAT slave and the functional device is not based on the EtherCAT protocol but on a preset communication protocol, and the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol, when the functional device is transiently unable to receive the data sent by the EtherCAT slave, due to the higher fault tolerance of the preset communication protocol, that is, the preset communication protocol determines that the fault duration corresponding to a signal interruption or a link failure is longer. At this time, the EtherCAT slave does not determine that the functional device is abnormal. Therefore, the EtherCAT master can continue to communicate with the EtherCAT slave normally, thereby reducing the probability of misjudging communication faults.

[0093] It should be noted that the communication device 600 in the above-mentioned embodiments is based on the same inventive concept as the communication method in the above-mentioned embodiments. Therefore, the corresponding content of the communication method in the above-mentioned embodiments also applies to the communication device 600 in the above-mentioned embodiments, and has the same implementation principle and technical effects. To avoid redundant description content, it will not be described in detail here.

[0094] In addition, an embodiment of the present application further provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the communication method in the first aspect when executing the computer program.

[0095] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely provided with respect to the processor, and these remote memories may be connected to the processor through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0096] Next, in combination withFigure 7 Describe in detail the hardware structure of the computer device. The electronic device includes: a processor 710, a memory 720, an input / output interface 730, a communication interface 740, and a bus 750.

[0097] The processor 710 can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present application;

[0098] The memory 720 can be implemented in the form of a ROM (Read Only Memory), a static storage device, a dynamic storage device, or a RAM (Random Access Memory), etc. The memory 720 can store an operating system and other application programs. When implementing the technical solutions provided by the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 720 and are called by the processor 710 to execute the communication method of the embodiments of the present application;

[0099] The input / output interface 730 is used to implement information input and output;

[0100] The communication interface 740 is used to implement communication interaction between this device and other devices, and can implement communication through a wired method (such as USB, network cable, etc.) or through a wireless method (such as a mobile network, WIFI, Bluetooth, etc.); and the bus 750 is used to transmit information between various components of the device (such as the processor 710, the memory 720, the input / output interface 730, and the communication interface 740);

[0101] Among them, the processor 710, the memory 720, the input / output interface 730, and the communication interface 740 are communicatively connected to each other inside the device through the bus 750.

[0102] It can be understood that the present application also provides a computer-readable storage medium storing computer-executable instructions for implementing the communication method of any item in the first aspect.

[0103] Those of ordinary skill in the art will appreciate that all or some of the steps and systems disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically includes computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery media.

[0104] The embodiments of the present application have been described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the above embodiments. Various changes can be made without departing from the spirit of the present application within the scope of knowledge possessed by those of ordinary skill in the art. In addition, the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

Claims

1. A communication method, characterized in that, Applied to an EtherCAT slave in Ethernet Control Automation Technology, the EtherCAT slave is communicatively connected to the EtherCAT master, and the EtherCAT slave is also respectively communicatively connected to a plurality of functional devices. The method includes: Receiving an EtherCAT message sent by the EtherCAT master; Extracting device parameters from the EtherCAT message; Determining a target device from the plurality of functional devices according to the device parameters and determining target data corresponding to the target device; Sending the target data to the target device according to a preset communication protocol; wherein, the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol; the fault duration corresponding to the signal interruption or link failure determined by the preset communication protocol is greater than the fault duration corresponding to the signal interruption or link failure determined by the EtherCAT protocol; The determining a target device from the plurality of functional devices according to the device parameters and determining target data corresponding to the target device includes: Determining the target device from the plurality of functional devices according to the address ranges and the first address corresponding to each of the functional devices recorded in a preset address mapping conversion table, and determining a device offset corresponding to the target device; the first address is one of the parameters of the device parameters; Obtaining a second address by subtracting the device offset from the first address; Obtaining target data according to the second address and functional parameters; the functional parameters are one of the parameters of the device parameters.

2. The communication method according to claim 1, characterized in that The method further includes: Storing the device parameters as cache data in a cache; Determining the execution period of each piece of cache data in the cache through a preset periodic sending task; Correspondingly, the determining a target device from the plurality of functional devices according to the device parameters and determining target data corresponding to the target device includes: During the execution period corresponding to the target data, determining the target device from the plurality of functional devices according to the device parameters and determining target data corresponding to the target device.

3. The communication method according to claim 2, characterized in that, The device parameters include a first address and functional parameters; the storing the device parameters as cache data in a cache includes: Determining a target cache from a plurality of first caches according to the first address and the address mapping conversion table, wherein the first caches correspond to the functional devices one by one; Storing the device parameters as cache data in the target cache; Correspondingly, the determining the execution period of each piece of cache data in the cache through a preset periodic sending task includes: Sequentially traversing each of the first caches through the periodic sending task to determine the execution period of each piece of cache data in each of the first caches.

4. The communication method according to claim 1, wherein Further includes: Retransmitting the target data to the target device according to a preset retransmission mechanism.

5. The communication method according to claim 4, wherein The retransmitting the target data to the target device according to a preset retransmission mechanism includes: When no response instruction corresponding to the target data is received within the first preset duration, the target data is repeatedly sent to the target device a preset number of times at a preset first time interval.

6. An EtherCAT system, characterized in that, It includes an EtherCAT master station, an EtherCAT slave station, and multiple functional devices. The EtherCAT master station is communicatively connected to the EtherCAT slave station, and the EtherCAT slave station is respectively communicatively connected to multiple functional devices. The EtherCAT master station is used to send EtherCAT messages to the EtherCAT slave station. The EtherCAT slave station is used for: Receiving the EtherCAT message; Extracting device parameters from the EtherCAT message; Determining a target device from multiple functional devices according to the device parameters and determining target data corresponding to the target device; Sending the target data to the target device according to a preset communication protocol; wherein, the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol; The fault duration corresponding to the signal interruption or link failure determined by the preset communication protocol is greater than the fault duration corresponding to the signal interruption or link failure determined by the EtherCAT protocol; The determining a target device from multiple functional devices according to the device parameters and determining target data corresponding to the target device includes: Determining the target device from multiple functional devices according to the address ranges and the first address corresponding to each functional device recorded in a preset address mapping conversion table, and determining a device offset corresponding to the target device; the first address is one of the parameters of the device parameters; Obtaining a second address by subtracting the device offset from the first address; Obtaining target data according to the second address and functional parameters; the functional parameters are one of the parameters of the device parameters.

7. A communication device, characterized in that, Applied to an EtherCAT slave station, the EtherCAT slave station is communicatively connected to an EtherCAT master station, and the EtherCAT slave station is also respectively communicatively connected to multiple functional devices. The communication device includes: A receiving module, which is used to receive the EtherCAT message sent by the EtherCAT master station; An extracting module, which is used to extract device parameters from the EtherCAT message; A determining module, which is used to determine a target device from multiple functional devices according to the device parameters and determine target data corresponding to the target device; A sending module, which is used to send the target data to the target device according to a preset communication protocol; wherein, the fault tolerance of the preset communication protocol is higher than that of the EtherCAT protocol; The fault duration corresponding to the signal interruption or link failure determined by the preset communication protocol is greater than the fault duration corresponding to the signal interruption or link failure determined by the EtherCAT protocol; The determining a target device from multiple functional devices according to the device parameters and determining target data corresponding to the target device includes: Determine the target device from multiple function devices according to the address ranges and the first address corresponding to each of the function devices recorded in a preset address mapping conversion table, and determine a device offset corresponding to the target device; the first address is one of the parameters of the device parameters; Obtain a second address by subtracting the device offset from the first address; Obtain target data according to the second address and function parameters; the function parameters are one of the parameters of the device parameters.

8. An electronic device, characterized in that, Include: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the communication method described in any one of claims 1 to 5 is implemented.

9. A computer-readable storage medium, characterized in that, Store computer-executable instructions for implementing at least the communication method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Industrial control network slave station communication method and device based on EtherCAT protocol

    CN105187283A

  • Control frame pre-compression method based on AS6802 protocol

    CN110460597A

  • Communication method, device and system, upper computer and lower computer

    CN114095363A

  • Industrial communication multi-protocol conversion system

    CN114222009A