CN117749559A - Communication method, device and system based on EtherCAT and computing equipment - Google Patents

Communication method, device and system based on EtherCAT and computing equipment Download PDF

Info

Publication number
CN117749559A
CN117749559A CN202311640149.1A CN202311640149A CN117749559A CN 117749559 A CN117749559 A CN 117749559A CN 202311640149 A CN202311640149 A CN 202311640149A CN 117749559 A CN117749559 A CN 117749559A
Authority
CN
China
Prior art keywords
ethercat
slave station
state
pdo
ethercat slave
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311640149.1A
Other languages
Chinese (zh)
Inventor
高洁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kyland Technology Co Ltd
Original Assignee
Kyland Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kyland Technology Co Ltd filed Critical Kyland Technology Co Ltd
Priority to CN202311640149.1A priority Critical patent/CN117749559A/en
Publication of CN117749559A publication Critical patent/CN117749559A/en
Pending legal-status Critical Current

Links

Abstract

The present application relates to the field of communications technologies, and in particular, to a communications method, apparatus, system, computing device and readable storage medium based on EtherCAT, where the method includes: performing PDO data communication through a real-time task; performing SDO data communications via non-real-time tasks when the PDO data communications are idle, the performing SDO data communications including: the online state of each EtherCAT slave station and the state of each EtherCAT slave station for processing PDO data are monitored. In the method, the data information and the state information are acquired through the SDO service, the EtherCAT bus equipment is monitored, the bandwidth of the PDO service is not occupied, the resources of the real-time task are not preempted, and the instantaneity of the PDO service is not affected. In addition, when the EtherCAT bus equipment is monitored, the state of the ESC port register is not continuously detected in the PDO high-speed exchange process, the instantaneity of PDO data processing is not affected, and the burden of a master station side is reduced.

Description

Communication method, device and system based on EtherCAT and computing equipment
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a communication method, device, system, and computing device based on EtherCAT.
Background
EtherCAT is an open real-time Ethernet communication protocol, has the advantages of good universality, low cost, high efficiency, high reliability and stability, and is widely applied to daily information life and various commercial neighborhoods.
At present, the hot connection function is not supported in the open source EtherCAT scheme. When the user needs to debug equipment or a slave station in the field fails, the EtherCAT link is inevitably disconnected, and the real-time performance of data processing and receiving and transmitting is not facilitated.
Disclosure of Invention
In view of the above problems in the prior art, the present application provides a communication method, device, system and computing device based on EtherCAT, which can realize EtherCAT bus thermal connection without affecting the real-time performance of data transceiving, and can debug a specific slave station and its controlled device without affecting the communication of other slave stations.
To achieve the above object, a first aspect of the present application provides an EtherCAT-based communication method, including:
performing PDO data communication through a real-time task;
performing SDO data communications via non-real-time tasks when the PDO data communications are idle, the performing SDO data communications including: the online state of each EtherCAT slave station and the state of each EtherCAT slave station for processing PDO data are monitored.
In the embodiment, the data information and the state information are acquired through the SDO service, the EtherCAT bus equipment is monitored, the bandwidth of the PDO service is not occupied, the resources of the real-time task are not preempted, and the instantaneity of the PDO service is not affected. In addition, when the EtherCAT bus equipment is monitored, the state of the ESC port register is not continuously detected in the PDO high-speed exchange process, the instantaneity of PDO data processing is not affected, and the burden of a master station side is reduced.
As a possible implementation manner of the first aspect, monitoring an online state of each EtherCAT slave station and a state of each EtherCAT slave station for processing PDO data includes:
broadcasting a first instruction;
receiving the working state parameters and the working count value of at least one EtherCAT slave station sent by the EtherCAT slave station in response to the first instruction;
and determining the online state of the corresponding EtherCAT slave station according to the working state parameter, and determining the state of the corresponding EtherCAT slave station for processing PDO data according to the working count value.
In this embodiment, the working state parameters and the working count values of all the secondary stations are obtained through the broadcast instruction to determine whether the secondary stations are abnormal, and all the secondary stations are not independently polled, so that the resource occupation can be reduced, and the reaction speed of the primary station can be improved.
As a possible implementation manner of the first aspect, the method further includes:
the monitoring of the online state of each EtherCAT slave station and the state stage of each EtherCAT slave station for processing PDO data, and when abnormality is determined, the state of each EtherCAT slave station is polled and processed correspondingly;
if the working state parameter of the polled current EtherCAT slave station indicates that the current EtherCAT slave station is removed from the EtherCAT bus, marking the current EtherCAT slave station as off-line;
and if the polled working state parameter of the current EtherCAT slave station indicates that the current EtherCAT slave station works in an abnormal state, executing abnormal state processing.
As a possible implementation manner of the first aspect, the abnormal state processing includes: if the current EtherCAT slave station is marked to be in an off-line state, the current EtherCAT slave station is reinserted into an EtherCAT bus, initialization of the current EtherCAT slave station is executed, and a working instruction is sent to the current EtherCAT slave station so that the current EtherCAT slave station works normally; and if the current EtherCAT slave station is not marked in an offline state, indicating that the working state of the current EtherCAT slave station is wrong, executing the error clearing of the current EtherCAT slave station, and sending a working instruction to the current EtherCAT slave station so as to enable the current EtherCAT slave station to work in a normal state.
As a possible implementation manner of the first aspect, the method further includes:
and sending setting information to each EtherCAT slave station, wherein the setting information is used for enabling the EtherCAT slave station to be configured into an automatic mode, and when the EtherCAT slave station in the automatic mode detects that a certain port of the EtherCAT slave station is not externally connected, the port is automatically closed.
As a possible implementation manner of the first aspect, sending a command to the abnormal secondary station includes:
the data packet for performing PDO data communication is different from the data packet for performing SDO data communication.
In this embodiment, the SDO data and the PDO data are sent by different data packets, so that the SDO does not occupy the bandwidth of the PDO and occupy the resources of the real-time task, so that resource contention does not occur and the real-time performance of task processing is not affected.
The second aspect of the present application provides a communication device based on EtherCAT, for an EtherCAT master station, including:
the PDO module is used for executing PDO data communication through a real-time task;
a monitoring module, configured to perform SDO data communication through a non-real-time task when the PDO data communication is idle, where performing the SDO data communication includes: the online state of each EtherCAT slave station and the state of each EtherCAT slave station for processing PDO data are monitored.
As a possible implementation manner of the first aspect, the method further includes:
and the configuration module is used for providing setting information, wherein the setting information comprises a setting for enabling the EtherCAT slave station to be configured into an automatic mode.
A third aspect of the present application provides an EtherCAT-based communication system, comprising:
an EtherCAT master station for executing the EtherCAT-based communication method as described above;
an EtherCAT slave station for communicating with the EtherCAT master station via an EtherCAT bus.
A fourth aspect of the present application provides a computing device comprising:
processor and method for controlling the same
A memory having stored thereon program instructions that, when executed by the processor, cause the processor to perform the EtherCAT-based communication method as described above.
These and other aspects of the invention will be apparent from and elucidated with reference to the embodiment(s) described hereinafter.
Drawings
The various features of the invention and the connections between the various features are further described below with reference to the figures. The figures are exemplary, some features are not shown in actual scale, and some features that are conventional in the art to which this application pertains and are not essential to the application may be omitted from some figures, or features that are not essential to the application may be additionally shown, and combinations of the various features shown in the figures are not meant to limit the application. In addition, throughout the specification, the same reference numerals refer to the same. The specific drawings are as follows:
Fig. 1 is a schematic flow chart of a communication method based on EtherCAT according to a first embodiment of the present application;
fig. 2 is a schematic flow chart of a communication method based on EtherCAT according to a second embodiment of the present application;
FIG. 3 is a flow diagram of configuration settings provided by an embodiment of the present application;
fig. 4 is a schematic working diagram of an EtherCAT bus device provided in an embodiment of the present application;
fig. 5 is a schematic diagram of data transceiving performed by a PDO service provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of an EtherCAT-based communication device provided in an embodiment of the present application;
fig. 7 is a schematic workflow diagram of an EtherCAT-based communication device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an EtherCAT-based communication system provided in an embodiment of the present application;
fig. 9 is a schematic structural diagram of a computing device provided in an embodiment of the present application.
Detailed Description
The technical scheme provided by the application is further described below by referring to the accompanying drawings and examples. It should be understood that the system structures and service scenarios provided in the embodiments of the present application are mainly for illustrating possible implementations of the technical solutions of the present application, and should not be construed as the only limitation of the technical solutions of the present application. As one of ordinary skill in the art can know, with the evolution of the system structure and the appearance of new service scenarios, the technical scheme provided in the application is applicable to similar technical problems.
It should be understood that the communication scheme based on EtherCAT provided in the embodiments of the present application includes a communication method, a device, a system, a computing device and the like based on EtherCAT. Because the principles of solving the problems in these technical solutions are the same or similar, in the following description of the specific embodiments, some repetition is not described in detail, but it should be considered that these specific embodiments have mutual references and can be combined with each other.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. If there is a discrepancy, the meaning described in the present specification or the meaning obtained from the content described in the present specification is used. In addition, the terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the present application. For the purpose of accurately describing the technical content of the present application, and for the purpose of accurately understanding the present invention, the terms used in the present specification are given the following explanation or definition before the explanation of the specific embodiments:
1) ESM slave manager: a slave station manager (EtherCAT Slave Manager, ESM), a slave station refers to a device connected to the EtherCAT bus, which manages and controls the functions and operations of the slave station through the ESM.
2) Work count: work Count (WKC). The Ethercat message is ended by a 16-bit WKC. If the master station successfully addresses the slave station device and the slave station device successfully performs the operation, the value of the work counter will be incremented. By comparing the expected value of the working counter with the actual value after all devices have passed, the master station can check whether the Ethercat data has been successfully processed.
3) Synchronization manager: a Synchronization Manager (SM) is one of the EtherCAT buses. It is responsible for synchronizing the data streaming from the master station to the slave station devices and ensuring the correct processing and synchronization of the data in the slave station devices, each of which typically has one or more SMs for processing different types of data.
4) Bus memory management unit: a bus memory management unit (Fieldbus Memory Management Units, FMMU) for mapping the physical and logical addresses by means of an internal address mapping.
5) Automatic mode of slave ESC port registers: the ESC port register may provide a plurality of data transceiving ports, each of which may transmit and receive data frames. The transmission/forwarding order of the data frames inside the ESC is fixed, sequentially transmitted to the ports until the destination port. When the automatic mode is set, if the ESC detects that a certain port is not externally connected, the port is automatically closed, and the data frame automatically loops back and is forwarded to the next port when being transmitted inside the ESC.
6) EtherCAT master station: the EtherCAT master station is a central control device in the EtherCAT network and is responsible for communication and control with the EtherCAT slave station.
7) EtherCAT slave: etherCAT slave stations refer to devices or modules connected in an EtherCAT network, which receive instructions from an EtherCAT master station and perform corresponding operations. The secondary station may be a variety of devices such as sensors, actuators, controllers, etc.
In the prior art, the embedded network port (Embedded Network Port, ESC) state register of each secondary station is mapped through a process data object (Process Data Object, PDO), the port state of each secondary station is continuously detected in the PDO high-speed exchange process, the on-line/off-line state of the secondary station is identified through logic operation, then the closing of the ports of the secondary station is controlled through service data object (Service Data Object, SDO) service, the PDO data sending strategy of the primary station side is adjusted, and the abnormal situation of the secondary station cannot be comprehensively processed in the prior art.
In addition, the prior art occupies PDO data space when the ports of the secondary stations are closed, so that the network data of the same frame is enlarged, the utilization rate of the PDO data space is reduced, and the PDO is not beneficial to data processing; the master station side needs to adjust PDO data transmission logic, so that the cost is increased; the time consumed by the master station side in updating the state of the master station is long, which is unfavorable for the instantaneity of PDO receiving and transmitting.
In order to solve the technical problems, the application provides a communication scheme based on EtherCAT, which comprises a communication method, a device, a system, a computing device and a computer readable storage medium based on EtherCAT.
As shown in fig. 1, fig. 1 is a schematic flow chart of a communication method based on EtherCAT according to an embodiment of the present application. The communication method based on EtherCAT provided by the embodiment comprises the following steps:
s101: PDO data communication is performed by real-time tasks.
In the method, the PDO module only performs real-time data processing, does not continuously detect the state of the ESC port register in the PDO high-speed exchange process, does not occupy PDO bandwidth, does not influence the instantaneity of the PDO data processing, and reduces the burden of a master station side.
S102: performing SDO data communications via non-real-time tasks when the PDO data communications are idle, the performing SDO data communications including: the online state of each EtherCAT slave station and the state of each EtherCAT slave station for processing PDO data are monitored.
When the PDO data communication is idle, the state of the bus and the state of each slave station are monitored through the SDO service, and parameter settings (such as monitoring period and the like) of the upper computer software are received, and the abnormal processing, the discovery of the slave station and the like are performed.
In this embodiment, the SDO communication is performed only when the PDO communication is idle, so that no resource contention occurs and the PDO instantaneity is not affected.
In some embodiments, monitoring the presence status of each EtherCAT slave and the status of each EtherCAT slave processing PDO data may include:
the master station may send a first instruction to all slaves of the EtherCAT via the SDO service.
After the EtherCAT slave station receives a first instruction sent by the master station through broadcasting, the EtherCAT slave station responds to the first instruction and sends working state parameters of the EtherCAT slave station to the master station. The master station receives the working state parameters and the working count value of the at least one EtherCAT slave station, which are sent by the at least one EtherCAT slave station in response to the first instruction. The master station may acquire a Working Count value (WKC) of the EtherCAT bus.
The master station determines the online state of the corresponding EtherCAT slave station according to the working state parameters, and determines the state of the corresponding EtherCAT slave station for processing PDO data according to the working count value. Specifically, the operating state of the slave station can be judged by collecting all the ESM values of the slave station through the broadcasted first instruction, and the ESM value is OP, which indicates that the slave station is normal. The state of the corresponding EtherCAT slave station for processing PDO data can be determined by acquiring the WKC value of the EtherCAT bus, and the slave station equipment successfully executes the operation, so that the WKC value is increased; thus, when all the secondary stations are operating normally, the acquired WKC value should be equal to the expected WKC value, and when the two are not equal, it indicates that there is a secondary station that is not processing PDO data correctly.
In this embodiment, the first instruction is broadcast to collect the working state parameters and the working count values of all the secondary stations, so that all the secondary stations are not individually polled, the resource occupation can be reduced, and the reaction speed of the primary station can be improved.
In some embodiments, monitoring the presence status of each EtherCAT slave and the status phase of each EtherCAT slave processing PDO data, when an anomaly is determined to occur, polling each EtherCAT slave status and processing accordingly includes at least one of:
if the working state parameter of the polled current EtherCAT slave station is 0, indicating that the current EtherCAT slave station has been removed from the EtherCAT bus, marking the current EtherCAT slave station as off-line;
if the working state parameter of the current EtherCAT slave station is not 0 and is not OP, the current EtherCAT slave station works in an abnormal state, and then abnormal state processing is further executed; the exception state handling includes: if the current EtherCAT slave station is marked as an off-line state, the current EtherCAT slave station is reinserted into the EtherCAT bus, initialization of the current EtherCAT slave station is executed, and an OP instruction is sent to the current EtherCAT slave station, wherein the OP instruction comprises a working instruction for enabling the current EtherCAT slave station to work in a normal state; if the current EtherCAT slave station is not marked as an offline state, the current EtherCAT slave station indicates that the working state of the current EtherCAT slave station is wrong, the error is cleared for the current EtherCAT slave station, and an OP instruction is sent to the current EtherCAT slave station so that the current EtherCAT slave station works normally.
In some embodiments, setting information is sent to each EtherCAT slave station, where the setting information is used to configure the EtherCAT slave station into an automatic mode, and when the EtherCAT slave station in the automatic mode detects that a port has no external connection, the port is automatically closed.
In the embodiment, by initializing configuration, when each slave station is pulled out of the slave station port, the ESC port register of the slave station is automatically processed, the inside of the slave station port is automatically closed, the master station is not required to send an instruction to close the port, and the burden of the master station is reduced.
In some embodiments, the data packets that perform PDO data communications are different from the data packets that perform SDO data communications. In this embodiment, the SDO data and the PDO data are sent by different data packets, so that the SDO does not occupy the bandwidth of the PDO and occupy the resources of the real-time task, so that resource contention does not occur and the real-time performance of task processing is not affected.
According to the method and the device, the data information and the state information are acquired through the SDO service, the EtherCAT bus equipment is monitored, the bandwidth of the PDO service is not occupied, the resources of the real-time task are not preempted, and the instantaneity of the PDO service is not affected. In addition, when the EtherCAT bus equipment is monitored, the state of the ESC port register is not continuously detected in the PDO high-speed exchange process, the instantaneity of PDO data processing is not affected, and the burden of a master station side is reduced.
An embodiment of the EtherCAT-based communication method provided in the present application is further described below in conjunction with a specific embodiment. Fig. 2 is a schematic flow chart of a communication method based on EtherCAT according to another embodiment of the present application. The communication method based on EtherCAT provided by the embodiment comprises the following steps:
s201: and the master station receives the configuration parameters from the upper computer software and executes corresponding configuration.
A schematic flow chart of the configuration setting as shown in fig. 3. When the system is started, the master station receives configuration parameters from the upper computer software and executes corresponding configuration. The necessary parameters such as FMMU, SM, register and communication channel are configured by the edge controller software of the upper computer. For example, at system initialization, the mode of the slave ESC port register is set to automatic: the slave station automatically executes the opening/closing of the port according to the network port state, the process does not need the intervention of the master station, the master station does not need to send an instruction to close the port, and the burden of the master station is reduced. The timer can be configured to execute different data information acquisition periods according to parameters configured by the upper computer software so as to realize corresponding slave station monitoring periods.
S202: when the PDO data communication is idle, the master station monitors the slave stations through the SDO data communication.
In the application, the PDO data communication only carries out real-time task processing, and when the master station detects that the PDO data communication is idle, the master station monitors the slave station through the SDO data communication can include:
the master station executes SDO data communication through a non-real-time task, acquires data information of all the slave stations, and judges whether the slave stations in the EtherCAT bus network are abnormal or not through the acquired data information.
The data information may include, among other things, the operating state parameters and the operating count values of all the secondary stations. Specifically, the working state parameter of the slave station may be a state value, and the working count value may be a WKC value of the EtherCAT bus message.
The master station may collect all the slave station status values through the broadcast instructions of the SDO service for determining whether all the slave stations are normal, for example, COB-ID (Communication Object Identifier) of the broadcast instructions of the SDO service is 0x000, indicating broadcasting to all the slave stations. All the secondary stations are then collected to return status values according to the broadcast instructions, which may include on/off status, operational mode of the secondary station, operational status of the secondary station, etc. At the moment, broadcasting instructions are used for collecting state values of all the secondary stations, all the secondary stations are not independently polled, the occupation of resources can be reduced, and the reaction speed of the primary station is improved.
In addition, the master station queries a Working counter (WKC) value of a message returned by the EtherCAT bus, so as to determine whether all the slave stations correctly process the data sent by the master station. If the master successfully addresses the slave device and the slave device successfully performs the operation, the WKC value will be incremented. By comparing the expected value of the WKC with the actual value obtained by the master station after all devices return through the EtherCAT bus message, the master station can check whether all the slave stations have successfully processed Ethercat data.
S203: when the master station determines that the data information is abnormal, each slave station is polled and the state information of the slave station is acquired.
If the data information is not abnormal, the next cycle is entered, and step S202 is continuously executed according to the configured monitoring period. When the state value of the slave station or the WKC value of the EtherCAT bus message is abnormal, determining that the data information is abnormal, and then the master station polls each slave station and acquires the state information of each slave station.
Specifically, when the master station determines whether the data information is abnormal, the master station can judge whether the data information is abnormal or not by collecting the or value of the state values of all the slave stations through a broadcast instruction, namely, judging through ESM or value, wherein the ESM value is OP, which means that the slave stations are normal, and when the ESM value of any slave station in all the acquired slave stations is not OP, the ESM or value of all the slave stations is not OP, and at the moment, the master station can determine that the data information is abnormal. When the current value of WKC in the data message returned by the EtherCAT bus acquired by the master station is equal to the expected value, the slave stations are normal and correctly process tasks; when the current value of the WKC acquired by the master station is not equal to the expected value of the WKC, the slave station does not process the data transmitted by the master station correctly, and the master station can determine that the data information is abnormal.
When the sum value of all the slave station states collected by the broadcast instruction is not OP, or the current WKC in the data message returned to the master station is not equal to the expected WKC value, the data information is indicated to have abnormality. The master station may then poll the various slaves via the SDO service and obtain the ESM value for each slave, resulting in status information for the slaves.
In some embodiments, the EtherCAT bus device shown in fig. 4 is a schematic diagram of operation, and the PDO service shown in fig. 5 is a schematic diagram for data transceiving. The master station can monitor bus states, states of all the slave stations, perform exception handling, find out the slave stations and the like through the SDO (module) of non-real-time communication, and the PDO (module) of real-time communication only processes real-time data. SDO data and PDO data are sent through different data packets, the SDO does not occupy the bandwidth of the PDO and does not occupy the resources of the real-time task, so that the resource contention does not occur. In addition, the SDO service is only carried out when the PDO service is idle, and the instantaneity of the PDO service is not affected. And the timer may be set to trigger PDO transmissions within a specific time interval, synchronize the transmission of multiple PDOs, adjust the PDO transmission rate, and ensure that PDO transmissions are completed within a specific time to meet real-time requirements, etc.
As shown in fig. 5, when PDO data communication is performed under the drive of the high-precision timer, the data calculated by the edge server is placed in the bus output virtual space, and the data is transmitted to each slave station by the EtherCAT bus and is taken away and processed by the slave station. And the slave station puts the respective output data in the bus input virtual space, and the bus data is returned to the edge server and is taken away and processed by the internal processing logic. Wherein an edge server is a computing device for processing and managing network data. Typically between a network node comprising a secondary station and a controller comprising a primary station, for collecting and processing data from the various nodes. The edge servers may perform a variety of functions including data processing, data storage, network communications, real-time control, and the like. It can collect and analyze real-time data by communicating with the network nodes and process and make decisions as needed. The edge server can also provide network connection, protocol conversion and other functions, so that different types of devices can communicate with the EtherCAT network.
S204: and the master station determines an abnormal slave station according to the state information.
The master station continues to poll each slave station through the SDO service and obtain the ESM value for each slave station.
In this embodiment, an abnormal slave station may refer to a slave station whose ESM value is not OP.
In addition, when the slave's ESM value is 0, it indicates that the slave has been removed from the EtherCAT bus, thus marking the status of the anomalous slave as offline.
If the slave status is not offline (ESM value of 0) and is not OP, it is determined that the abnormal slave has an error.
S205: and the master station sends a command to the abnormal slave station to enable the abnormal slave station to be in a normal working state.
If an abnormal slave station is marked offline, indicating that the slave station is reinserted into the bus, an initialization instruction is sent to the slave station to reinitialize the slave station, and then an OP instruction is sent to attempt to operate the slave station in an OP state.
If the abnormal slave station is not marked as offline, indicating that an error occurs in the slave station working state, transmitting an error clearing instruction to the slave station, and then transmitting an OP instruction to try to enable the slave station to work in the OP state.
Wherein, in order to ensure that the abnormal slave station is brought into an OP (operation) state, the operation may be performed as follows:
EtherCAT Telegram is created. Since each slave station has a unique slave station address in the EtherCAT network, in the Telegram, the address of the abnormal slave station is taken as a target address, and corresponding commands including a re-initialization command, a clear error command, an OP (operation) command, and the like are configured in EtherCAT Telegram. Finally, the master station transmits the EtherCAT Telegram to the slave station corresponding to the target address through the EtherCAT bus. The Telegrams are data packets for transmitting data in the EtherCAT bus network.
The response message on the EtherCAT bus can also be acquired and monitored by the master to determine if the slave has successfully entered the OP state. If the slave station successfully enters the OP state, the slave station responds to the OP instruction in the Telegram sent by the master station to realize the hot connection of the EtherCAT bus slave station and equipment.
According to the EtherCAT-based communication method, the ESM of the slave station is obtained from the non-real-time task SDO service to realize abnormal slave station processing, the newly added slave station is found and configured, and the like, so that the ESC port register state is not continuously detected in the PDO high-speed exchange process, the PDO bandwidth is not occupied, the real-time performance of PDO data processing is not affected, and the burden of a master station is reduced. In addition, the FMMU mapping is fixed, that is, the physical space address of the slave station and the logical space address on the bus are fixed, the specific slave station and the equipment controlled by the specific slave station can be debugged under the condition that the communication of other slave stations is not affected only by configuration once, and the physical position of the slave station in the network can be adjusted according to the requirement without reconfiguration.
Based on an inventive concept, the present application also provides a communication device 600 based on EtherCAT. As shown in fig. 6, a schematic structural diagram of an EtherCAT-based communication device according to an embodiment of the present application includes:
A PDO module 601, configured to perform PDO data communication through a real-time task;
a monitoring module 602, configured to perform SDO data communication through a non-real-time task when the PDO data communication is idle, where performing the SDO data communication includes: the online state of each EtherCAT slave station and the state of each EtherCAT slave station for processing PDO data are monitored.
In some embodiments, further comprising: a configuration module 603, configured to provide setting information, where the setting information includes a setting for configuring the EtherCAT slave station into an automatic mode.
Specifically, as shown in fig. 7, a flow chart of an operation process of the EtherCAT-based communication device 600 provided in the embodiment of the present application is shown. The working process can comprise the following steps:
first, the PDO module 601 performs PDO data communication, and when the PDO module is idle, the timer acquires configuration parameters according to the configuration module 603 to determine a period in which the monitoring module 602 performs monitoring.
When the monitoring module 602 performs monitoring, data information of the slave station is periodically acquired according to parameters set by the timer. The data information may include, among other things, the slave's ESM status or value and the WKC value of the EtherCAT bus message.
The monitoring module 602 may collect all slave ESM states or values through broadcast instructions of the SDO service for determining whether all slaves are normal; and acquiring the WKC value of the EtherCAT bus message to judge whether each slave station accurately processes the data transmitted by the master station.
The monitoring module 602 then determines if there is an anomaly in the ESM state or value and the WKC value of the EtherCAT bus message. If no abnormality exists, the next monitoring period is entered for circulation.
When the acquired ESM state or value is not OP, or the current WKC in the data packet returned to the master station is not equal to the expected WKC value, the monitoring module 602 determines that there is an abnormality in the data information. The monitoring module 602 may then poll the various secondary stations based on the SDO service and obtain ESM values for each secondary station to obtain status information for the secondary station.
The monitoring module 602 determines an abnormal secondary station based on the status information. When the slave's ESM value is 0, indicating that the slave has been removed from the EtherCAT bus, the status of the anomalous slave may be marked as offline. When the monitoring module 602 determines that the slave status is not offline (ESM value of 0) and is not OP, it determines that an error occurred in the abnormal slave.
Then, if an abnormal slave station is marked offline, indicating that this slave station is reinserted into the bus, the monitoring module 602 sends an initialization instruction to the slave station to reinitialize the slave station, and then sends an OP instruction to attempt to operate the slave station in the OP state. If the abnormal secondary station is not marked offline, indicating that an error has occurred in the secondary station operating state, the monitoring module 602 sends a clear error instruction to the secondary station and then sends an OP instruction to attempt to operate the secondary station in the OP state.
The PDO module 601, the monitoring module 602, the configuration module 603, the timer, etc. are configured to execute steps S101-S102 and any optional embodiments thereof, which are not described herein.
Based on an inventive concept, the application also provides a communication system 800 based on EtherCAT, as shown in fig. 8, which is a schematic structural diagram of the EtherCAT bus thermal connection system provided in the embodiment of the application. The system comprises an EtherCAT master station, a communication server and a communication server, wherein the EtherCAT master station is used for executing the communication methods based on the EtherCAT in the steps S101-S102 and any optional embodiment of the EtherCAT master station;
an EtherCAT slave station for communicating with the EtherCAT master station via an EtherCAT bus.
The working process of the EtherCAT-based communication system 800 provided in this embodiment may refer to steps S101-S102 and any optional examples thereof, and will not be described in detail again
Fig. 9 is a schematic diagram of a computing device 900 provided by an embodiment of the present application. The computing device may be used as a device for EtherCAT-based communication, and may be a terminal, or may be a chip or a chip system in the terminal, to perform each alternative embodiment of the EtherCAT-based communication method. As shown in fig. 9, the computing device 900 includes: processor 910, memory 920, and communication interface 930.
It should be appreciated that the communication interface 930 in the computing device 900 shown in fig. 9 may be used to communicate with other devices, and in particular may include one or more transceiver circuits or interface circuits.
Wherein the processor 910 may be coupled to a memory 920. The memory 920 may be used to store the program codes and data. Accordingly, the memory 920 may be a storage unit internal to the processor 910, an external storage unit independent of the processor 910, or a component including a storage unit internal to the processor 910 and an external storage unit independent of the processor 910.
Optionally, computing device 900 may also include a bus. The memory 920 and the communication interface 930 may be connected to the processor 910 through a bus. The bus may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, an unbiased line is shown in FIG. 9, but does not represent only one bus or one type of bus.
It should be appreciated that in embodiments of the present application, the processor 910 may employ a central processing unit (central processing unit, CPU). The processor may also be other general purpose processors, digital signal processors (digital signal processor, DSP), application specific integrated circuits (application specific integrated circuit, ASIC), off-the-shelf programmable gate arrays (field programmable gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. Or the processor 910 may employ one or more integrated circuits for executing associated programs to perform the techniques provided in the embodiments of the present application.
The memory 920 may include read only memory and random access memory and provide instructions and data to the processor 910. A portion of the processor 910 may also include nonvolatile random access memory. For example, the processor 910 may also store information of the device type.
When the computing device 900 is running, the processor 910 executes computer-executable instructions in the memory 920 to perform any of the operational steps of the methods described above, as well as any of the alternative embodiments.
It should be understood that the computing device 900 according to the embodiments of the present application may correspond to a respective subject performing the methods according to the embodiments of the present application, and that the foregoing and other operations and/or functions of the respective modules in the computing device 900 are respectively for implementing the respective flows of the methods of the embodiments, and are not described herein for brevity.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Embodiments of the present application also provide a computer-readable storage medium having stored thereon a computer program for performing the above-described method when executed by a processor, the method comprising at least one of the aspects described in the above-described embodiments.
Any combination of one or more computer readable media may be employed as the computer storage media of the embodiments herein. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In addition, the terms "first, second, third, etc." or module a, module B, module C, etc. in the description and the claims are used solely for distinguishing between similar objects and not necessarily for a specific ordering of objects, it being understood that a specific order or sequence may be interchanged if allowed to enable the embodiments of the application described herein to be practiced otherwise than as specifically illustrated and described herein.
In the above description, reference numerals indicating steps such as S110, S120, … …, etc. do not necessarily indicate that the steps are performed in this order, and the order of the steps may be interchanged or performed simultaneously as the case may be.
The term "comprising" as used in the description and claims should not be interpreted as being limited to what is listed thereafter; it does not exclude other elements or steps. Thus, it should be interpreted as specifying the presence of the stated features, integers, steps or components as referred to, but does not preclude the presence or addition of one or more other features, integers, steps or components, or groups thereof. Thus, the expression "a device comprising means a and B" should not be limited to a device consisting of only components a and B.
Reference in the specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. Thus, appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment, but may. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments as would be apparent to one of ordinary skill in the art from this disclosure.
Note that the above is only a preferred embodiment of the present application and the technical principle applied. Those skilled in the art will appreciate that the present application is not limited to the particular embodiments described herein, but is capable of numerous obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the present application. Thus, while the present application has been described in terms of the foregoing embodiments, the present application is not limited to the foregoing embodiments, but may include many other equivalent embodiments without departing from the spirit of the present application, all of which fall within the scope of the present application.

Claims (10)

1. The communication method based on EtherCAT is used for an EtherCAT master station and is characterized by comprising the following steps:
performing PDO data communication through a real-time task;
performing SDO data communications via non-real-time tasks when the PDO data communications are idle, the performing SDO data communications including: the online state of each EtherCAT slave station and the state of each EtherCAT slave station for processing PDO data are monitored.
2. The method of claim 1, wherein monitoring the presence status of each EtherCAT slave and the status of each EtherCAT slave processing PDO data comprises:
Broadcasting a first instruction;
receiving the working state parameters and the working count value of at least one EtherCAT slave station sent by the EtherCAT slave station in response to the first instruction;
and determining the online state of the corresponding EtherCAT slave station according to the working state parameter, and determining the state of the corresponding EtherCAT slave station for processing PDO data according to the working count value.
3. The method as recited in claim 1, further comprising:
the monitoring of the online state of each EtherCAT slave station and the state stage of each EtherCAT slave station for processing PDO data, and when abnormality is determined, the state of each EtherCAT slave station is polled and processed correspondingly; :
if the working state parameter of the polled current EtherCAT slave station indicates that the current EtherCAT slave station is removed from the EtherCAT bus, marking the current EtherCAT slave station as off-line;
and if the polled working state parameter of the current EtherCAT slave station indicates that the current EtherCAT slave station works in an abnormal state, executing abnormal state processing.
4. A method according to claim 3, wherein the exception state handling comprises: if the current EtherCAT slave station is marked to be in an off-line state, the current EtherCAT slave station is reinserted into an EtherCAT bus, initialization of the current EtherCAT slave station is executed, and a working instruction is sent to the current EtherCAT slave station so that the current EtherCAT slave station works normally; and if the current EtherCAT slave station is not marked in an offline state, indicating that the working state of the current EtherCAT slave station is wrong, executing the error clearing of the current EtherCAT slave station, and sending a working instruction to the current EtherCAT slave station so as to enable the current EtherCAT slave station to work in a normal state.
5. The method as recited in claim 1, further comprising:
and sending setting information to each EtherCAT slave station, wherein the setting information is used for enabling the EtherCAT slave station to be configured into an automatic mode, and when the EtherCAT slave station in the automatic mode detects that a certain port of the EtherCAT slave station is not externally connected, the port is automatically closed.
6. The method according to claim 1, characterized in that it comprises:
the data packet for performing PDO data communication is different from the data packet for performing SDO data communication.
7. Communication device based on EtherCAT for EtherCAT main website, its characterized in that includes:
the PDO module is used for executing PDO data communication through a real-time task;
a monitoring module, configured to perform SDO data communication through a non-real-time task when the PDO data communication is idle, where performing the SDO data communication includes: the online state of each EtherCAT slave station and the state of each EtherCAT slave station for processing PDO data are monitored.
8. The communication apparatus according to claim 7, further comprising:
and the configuration module is used for providing setting information, wherein the setting information comprises a setting for enabling the EtherCAT slave station to be configured into an automatic mode.
9. An EtherCAT-based communication system, comprising:
an EtherCAT master station for performing the EtherCAT-based communication method of any one of claims 1 to 6;
an EtherCAT slave station for communicating with the EtherCAT master station via an EtherCAT bus.
10. A computing device, comprising:
processor and method for controlling the same
A memory having stored thereon program instructions that, when executed by the processor, cause the processor to perform the EtherCAT-based communication method of any one of claims 1 to 6.
CN202311640149.1A 2023-12-01 2023-12-01 Communication method, device and system based on EtherCAT and computing equipment Pending CN117749559A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311640149.1A CN117749559A (en) 2023-12-01 2023-12-01 Communication method, device and system based on EtherCAT and computing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311640149.1A CN117749559A (en) 2023-12-01 2023-12-01 Communication method, device and system based on EtherCAT and computing equipment

Publications (1)

Publication Number Publication Date
CN117749559A true CN117749559A (en) 2024-03-22

Family

ID=90257110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311640149.1A Pending CN117749559A (en) 2023-12-01 2023-12-01 Communication method, device and system based on EtherCAT and computing equipment

Country Status (1)

Country Link
CN (1) CN117749559A (en)

Similar Documents

Publication Publication Date Title
CN110380907B (en) Network fault diagnosis method and device, network equipment and storage medium
US9467363B2 (en) Network system and method of managing topology
US9166922B2 (en) Communication device for an industrial communication network which can be operated in a redundant manner and method for operating a communication device
US10868754B2 (en) High availability input/output management nodes
US11467566B2 (en) Communication device, communication terminal, communication device and method for operating a communication system for transmitting time-critical data
JP7040734B2 (en) Frame aggregation method, network setting Frame transmission method and device
US11316654B2 (en) Communication device and method for operating a communication system for transmitting time critical data
US11281190B2 (en) Method for setting up a redundant communication connection, and failsafe control unit
US8812759B2 (en) Bus subscriber device for connection to a line-redundant data bus, and method for controlling the communication of a bus subscriber with a line-redundant serial data bus
US11564241B2 (en) Method for operating a radio communication system for an industrial automation system, radio communication system, base station and subscriber station
CN110300055B (en) Gateway system for heterogeneous field bus
CN113261220B (en) Method and control node for handling failure of TSN communication link
CN113741360A (en) Industrial control gateway, system, control method and storage medium
JP6273841B2 (en) Communication system and communication control method
US11265798B2 (en) Method and radio communication system for an industrial automation system
JP5308418B2 (en) Programmable logic controller
CN117749559A (en) Communication method, device and system based on EtherCAT and computing equipment
US11522762B2 (en) Coordination device and method for providing control applications via a communication network for transmitting time-critical data
US20210045010A1 (en) Radio Communication System for an Industrial Automation System and Method for Operating the Radio Communication System
US11784929B2 (en) Heterogeneous link data translation and distribution method, system and device, and storage medium
CN112399425B (en) Lora communication method and Lora communication system
US11442432B2 (en) Communication device and method for data transmission within an industrial communication network
CN111008173A (en) Serial communication method, device and system
JP6835662B2 (en) Node and frame transmission control method
CN112671549A (en) Data processing method, equipment and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination