Wind power programmable controller ETHERCAT slave station hot plug method
By introducing the ESFP thread in the PLC system to monitor the EtherCAT slave status in real time, the EtherCAT slave status synchronization technology mentioned in the patent specification of EtherCAT is solved, the EtherCAT slave status synchronization technology problem of the EtherCAT bus is solved, the EtherCAT slave hot plug method of the EtherCAT bus is realized, the EtherCAT slave status synchronization technology problem of the EtherCAT bus is solved, the EtherCAT slave status synchronization technology problem of the EtherCAT bus is realized, and the reliability and stability of the system are improved.
Patent Information
- Application Number
- CN202510721279.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-19
AI Technical Summary
The EtherCAT bus can cause periodic data exchange errors in PLC systems due to transient anomalies, especially communication anomalies during hot-swapping of slaves.
By designing an ESFP thread in the PLC system, the EtherCAT slave status is monitored in real time, and the status is synchronized when a transient anomaly is detected. The EtherCAT master's API is used to manage the slave status. The ESFP sub-thread and ECB sub-thread are responsible for registering the callback function and configuring the master, respectively, to achieve rapid repair of the slave status.
It effectively reduces system instability and downtime, improves system reliability and overall performance, reduces operation and maintenance costs, and enhances the system's fault tolerance and data consistency.
Smart Images

Figure CN120675830A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automation control, and in particular to a hot-swap method for an ETHERCAT slave station of a wind power programmable controller. Background Art
[0002] A PLC (Programmable Logic Controller) system consists of a controller module and multiple input / output (IO) modules. These modules exchange data using the EtherCAT (Ethernet Control Automation Technology) bus. EtherCAT is a standardized, real-time, high-speed Ethernet communication protocol used in industrial automation. It offers advantages such as high-capacity transmission, high speed, high clock synchronization, low-cost implementation, and excellent openness. The PLC functions as the EtherCAT master, and the I / O modules function as EtherCAT slaves. The master and slaves communicate via the EtherCAT bus, which is based on full-duplex Ethernet.
[0003] The EtherCAT bus uses a state machine mechanism to control the behavior of the master and slaves during bus operation. Master states include UNKNOWN, INIT, PREOP, SAFEOP, and OP; slave states include UNKNOWN, INIT, PREOP, BOOT, SAFEOP, and OP. The EtherCAT master stores the states of both the master and all slaves, while slaves only record their own states. During bus startup, the master is in the UNKNOWN state. Subsequently, the master transitions through the INIT, PREOP, SAFEOP, and OP states, affecting all slaves. The BOOT state is used to update slave firmware. Once the EtherCAT master has booted and the bus is performing normal periodic data exchange, both the master and slaves should be in the OP state.
[0004] During the long-term operation of a PLC system, it is difficult to avoid EtherCAT bus anomalies caused by aging cards, loose network cables, unstable power supply, etc. For example: 1) One or more slaves lose power. 2) The connection between one or more slaves and the master is disconnected. 3) The master's EtherCAT output network cable is disconnected (the connection between the master and the first slave is disconnected). The above anomalies can be collectively referred to as transient EtherCAT bus anomalies. Such anomalies usually recover quickly (automatically or with manual intervention). After recovery, the current actual status of the slave may be inconsistent with the slave status stored in the master, resulting in EtherCAT periodic data exchange errors. Periodic data exchange errors caused by transient anomalies can be collectively referred to as EtherCAT slave hot-plugging problems - that is, when any slave leaves the network and then reappears during EtherCAT bus operation, the bus cannot quickly return to normal operation. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to address the deficiencies in the above-mentioned prior art and provide a hot-swap method for ETHERCAT slaves of a wind power programmable controller, which is used to solve the technical problem of EtherCAT periodic data exchange errors when transient anomalies occur.
[0006] The purpose of the present invention is achieved by the following technical solutions: In a first aspect, the present invention provides a hot-swap method for an ETHERCAT slave station of a wind power programmable controller, comprising: When the PLC is powered on, the ESFP thread is started and the EtherCAT master is configured using the ESFP thread management tool. Start the configured EtherCAT master and execute the ESFP thread to query the status of the EtherCAT slave according to the EtherCAT master; When a transient abnormality occurs in the state of an EtherCAT slave station, the state of the abnormal EtherCAT slave station is synchronized, thereby eliminating the transient abnormality of the EtherCAT slave station; The ESFP thread is a subthread in the PLC main program, which is used to manage / configure the status of the EtherCAT slave by calling the API of the EtherCAT master.
[0007] As a further improvement of the present invention, the ESFP thread includes an ESFP sub-thread and an ECB sub-thread; The ESFP sub-thread operation steps are as follows: registering a callback function; determining whether the PLC main program is running, and when the PLC main program is running, executing the slave status management task; otherwise, exiting the ESFP thread; The ECB sub-thread operation steps are: configure the EtherCAT master station; call the callback function to register the client corresponding to the ESFP thread to the EtherCAT master station; start the EtherCAT master station and exchange EtherCAT slave station status information with the client in real time.
[0008] As a further improvement of the present invention, the slave status management task is obtained according to the slave status management function; the slave status management function performs status query, status judgment and status synchronization tasks on the EtherCAT slave in each cycle.
[0009] As a further improvement of the present invention, the status query process specifically includes: Use the slave status management function to obtain whether the EtherCAT master status change notification was received in the last cycle; When receiving the EtherCAT master station status change notification, the current status of the EtherCAT master station is read, and the current status and request status of all EtherCAT slave stations are read.
[0010] As a further improvement of the present invention, the state judgment specifically includes: after reading the current state of the EtherCAT master station, sending the current state of the EtherCAT master station to the client, and judging whether the state of the EtherCAT slave station is disconnected and reconnected according to the state of the EtherCAT master station in the client; If an EtherCAT slave is obtained during status query, the request status of all slaves is set to the current status of the EtherCAT master, and all EtherCAT slaves are marked as pending update; The status of each EtherCAT slave is determined independently, and the status of the EtherCAT slave is updated according to the determination result.
[0011] As a further improvement of the present invention, a state judgment algorithm is executed according to the current state and the requested state of each EtherCAT slave station to determine in turn whether the current state transfer of the EtherCAT slave station is legal; If it is illegal, the EtherCAT slave state is set to the current state of the master; If it is legal, then determine whether the current state is equal to the requested state. If not, set the current state of the EtherCAT slave to the requested state through the master API; if they are equal, make a state judgment on the next EtherCAT slave.
[0012] As a further improvement of the present invention, the state synchronization is used to initiate an EtherCAT slave state switching request to all EtherCAT slaves marked as to be updated by calling the API of the EtherCAT master station, and switch the state of the target EtherCAT slave to the slave request state.
[0013] In a second aspect, the present invention provides a wind power programmable controller ETHERCAT slave hot-swap system, which is used to implement the above-mentioned PLC EtherCAT slave hot-swap method, comprising: Configuration module: When the PLC is powered on, the ESFP thread is started and the EtherCAT master is configured using the ESFP thread management tool. The slave status query module starts the configured EtherCAT master and executes the ESFP thread to query the status of the EtherCAT slave according to the EtherCAT master; An abnormal state elimination module, when a transient abnormality occurs in the state of an EtherCAT slave station, synchronizes the state of the abnormal EtherCAT slave station, thereby eliminating the transient abnormality of the EtherCAT slave station; The ESFP thread is a subthread in the PLC main program, which is used to manage / configure the status of the EtherCAT slave by calling the API of the EtherCAT master.
[0014] In a third aspect, the present invention provides a computer-readable storage medium storing one or more programs, wherein the one or more programs include instructions, which, when executed by a computing device, enable the computing device to execute the above-mentioned wind power programmable controller ETHERCAT slave station hot-swap method.
[0015] In a fourth aspect, the present invention provides a computing device, comprising: One or more processors, a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include steps for executing the above-mentioned wind power programmable controller ETHERCAT slave station hot plugging method.
[0016] The beneficial effects of the present invention are as follows: the hot-swap method for the ETHERCAT slave station of the wind power programmable controller provided by the present invention monitors the status of the EtherCAT slave station in real time through the ESFP thread, and immediately synchronizes the status when a transient abnormality is detected. This can effectively reduce system instability or downtime caused by transient faults and improve the overall reliability of the system. By configuring the EtherCAT master station using the ESFP thread management tool, centralized management of all EtherCAT slave stations can be achieved. Through the ESFP thread, the status changes and abnormal conditions of the EtherCAT slave station can be recorded to provide data support for subsequent fault diagnosis and analysis, thereby improving the maintainability of the system. At the same time, the automated exception handling and status synchronization mechanism reduces the need for manual intervention and reduces operation and maintenance costs.
[0017] Furthermore, the ESFP thread is divided into an ESFP sub-thread and an ECB sub-thread. The ESFP sub-thread is responsible for registering callback functions, determining the running status of the PLC main program, and performing slave status management tasks. The ECB sub-thread is responsible for configuring the EtherCAT master, registering clients, and exchanging EtherCAT slave status information with clients. The ESFP and ECB sub-threads operate independently, and errors in one sub-thread do not directly affect the operation of the other. This design improves the system's fault tolerance, stability, and reliability. The ECB sub-thread ensures real-time and consistent data by exchanging periodic data with the EtherCAT master. This mechanism effectively prevents data loss and delays, improving overall system performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 This is a flowchart of executing the ESFP thread provided by the present invention; Figure 2 This is a flowchart of the slave station status management task provided by the present invention; Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose and technical solution of the present invention clearer and easier to understand, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. The specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0021] The technical solutions of the present invention will be described clearly and completely below with reference to the accompanying drawings and specific embodiments. The described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments.
[0022] Example 1 like Figures 1 to 2 As shown, this embodiment provides a method for hot-swapping an ETHERCAT slave station of a wind power programmable controller. The specific implementation steps are as follows.
[0023] When the PLC bus is operating, the EtherCAT master (i.e., the master) polls and records the state machine information of all slaves. This includes the current state and requested state of each slave. The requested state is the target state to which the slave was requested to switch when the master last sent a state change request to the slave, while the current state is the slave's actual current state. If a transient anomaly occurs in a slave, the current state and requested state may differ, leading to bus communication anomalies. Furthermore, since the requested state is stored in the slave's memory, a power outage or restart of the slave may result in the requested state not being the state actually requested by the master, which may also cause bus communication anomalies. To enable hot swapping of slaves, the present invention designs a slave state machine proxy thread, ES_FSM_PROXY (hereinafter referred to as ESFP), in the PLC. During PLC operation, the ESFP thread records and manages the slave state machine on behalf of the master, ensuring that after a transient anomaly is resolved, the slave state machine error can be quickly repaired, thereby resuming normal cyclic data exchange on the bus. Therefore, the specific implementation of this embodiment is as follows.
[0024] First, when the PLC is powered on, the ESFP thread is started and the EtherCAT master is configured using the ESFP thread management tool.
[0025] In this embodiment, the ESFP thread is a subthread in the PLC main program, used to manage / configure the EtherCAT slave status by calling the EtherCAT master's API. Specifically, the PLC system consists of several processes, each of which is composed of multiple threads. The ESFP thread and the EtherCAT bus thread (hereinafter referred to as ECB) are both subthreads of the PLC main program. The ESFP thread manages / configures the slave status by calling multiple programming interfaces (APIs) of the master. To achieve full-cycle management of the slave status, when the PLC starts, the ESFP thread must be started before the bus thread. A thread is the smallest unit of program execution flow. A process can contain multiple threads. These threads share process resources such as memory space and file descriptors, but each thread has its own independent stack space, program counter, and registers to store context information for thread execution.
[0026] Among them, the ESFP thread includes the ESFP sub-thread and the ECB sub-thread; the operation steps of the ESFP sub-thread are: registering the callback function EcCallBack; judging whether the PLC main program is running, and when the PLC main program is running, executing the slave status management task, otherwise, exiting the ESFP thread; the operation steps of the ECB sub-thread are: configuring the EtherCAT master station; calling the callback function registered by ESFP, registering the client EcClient corresponding to the ESFP thread to the EtherCAT master station; starting the EtherCAT master station, and exchanging EtherCAT slave status information with the client EcClient in real time.
[0027] Start the configured EtherCAT master and execute the ESFP thread to query the status of the EtherCAT slave according to the EtherCAT master; Specifically, the slave status management task is derived from the slave status management function. The slave status management function (ES_FSM_MGR, ESFM for short) performs status query, status determination, and status synchronization tasks on the EtherCAT slave within each cycle. In this embodiment, the slave status management function is executed in a 50 millisecond cycle.
[0028] The status query process specifically includes: using the slave status management function to obtain whether the EtherCAT master station status change notification has been received in the previous cycle; when the EtherCAT master station status change notification is received, reading the current status of the EtherCAT master station, and reading the current status and request status of all EtherCAT slave stations.
[0029] When a transient abnormality occurs in the state of an EtherCAT slave, the state of the abnormal EtherCAT slave is synchronized, thereby eliminating the transient abnormality of the EtherCAT slave.
[0030] The status judgment specifically includes: after reading the current status of the EtherCAT master station, sending the current status of the EtherCAT master station to the client, and judging whether the EtherCAT slave station status is disconnected and reconnected according to the EtherCAT master station status in the client; If an EtherCAT slave is obtained during status query, the request status of all slaves is set to the current status of the EtherCAT master, and all EtherCAT slaves are marked as pending update; The status of each EtherCAT slave is determined independently, and the status of the EtherCAT slave is updated according to the determination result.
[0031] Furthermore, according to the current state and requested state of each EtherCAT slave, a state judgment algorithm is executed to judge in turn whether the current state transfer of the EtherCAT slave is legal; If it is illegal, the EtherCAT slave state is set to the current state of the master; If it is legal, then determine whether the current state is equal to the requested state. If not, set the current state of the EtherCAT slave to the requested state through the master API; if they are equal, make a state judgment on the next EtherCAT slave.
[0032] State synchronization is used to initiate an EtherCAT slave state switch request to all EtherCAT slaves marked as pending updates by calling the EtherCAT master's API, switching the target EtherCAT slaves to the slave request state. This ensures that the bus can quickly resume normal data exchange after encountering a transient anomaly.
[0033] Example 2 As a further preferred embodiment of Example 1, the specific steps of this embodiment are as follows.
[0034] like Figure 1 As shown, during operation, this embodiment prioritizes starting the PLC. After the PLC is powered on, it starts the ES_FSM_PROXY sub-thread and the ECB sub-thread (i.e., ECAT-BUS). The PLC then performs subsequent operations.
[0035] The ESFP thread registers a callback function, EcCallBack. EcCallBack is a callback function that the ESFP thread registers with the system. When the bus thread starts and completes the configuration of the master station, it calls EcCallBack to register a master station client, EcClient, for the ESFP thread. Key information about the master station during operation is sent to the client through the notification mechanism. The specific operation steps of the ES_FSM_PROXY child thread are as follows: a. Register the EcCallBack function.
[0036] b. Determine whether the PLC main program has exited. If so, the ESFP thread exits; otherwise, go to step c.
[0037] c. Execute slave status management functions.
[0038] d. Delay 50 milliseconds and go to step b.
[0039] The ECB sub-thread operation steps are as follows: Configure the EtherCAT master.
[0040] Call EcCallBack to register EcClient with the master.
[0041] Start the EtherCAT master and begin exchanging periodic data.
[0042] The slave status management function is executed in a 50 millisecond cycle. The slave status management function performs three tasks in each cycle: status query, status judgment, and status synchronization.
[0043] During the status query process, the ESFM function first records whether it has received notifications of changes in the master station status and EtherCAT connection status in the previous cycle, and then reads the current status and request status of all slave stations.
[0044] Status judgment is used to determine whether the status of a slave station needs to be corrected. The EtherCAT protocol requires that the status of a slave station cannot exceed the status of the master station. The specific steps are as follows: (1) If the master station status is UNKNOWN, it means that the bus is in an abnormal state and the ESFM function terminates. (2) If the EtherCAT connection status is restored during the status query, the request status of all slave stations is set to the current state of the master station, and all slave stations are marked as pending update, and the function terminates. (3) The status judgment is performed independently on each slave station. First, it is determined whether the request status of the slave station is legal under the current state of the master station. If it is illegal, the request status is set to the current state of the master station. (4) Secondly, it is determined whether the request status is consistent with the current state. If not, the slave station is marked as pending update.
[0045] State synchronization is to call the master station API to initiate a slave station state switching request to all slave stations marked as to be updated, and switch the state of the target slave station to the slave station request state, thereby ensuring that the bus can quickly restore the ability to exchange cycle data normally after encountering a transient abnormality.
[0046] Specifically, if Figure 2 As shown in the figure, the specific implementation of the slave status management task is: A. Update the current status of the master station based on the notification received by EcClient.
[0047] B. If the master station status is UNKNOWN, the task is complete. Otherwise, go to step C.
[0048] C. Based on the notification received by EcClient, determine whether the EtherCAT connection is disconnected and reconnected. If so, go to step D; otherwise, go to step E.
[0049] D. Set the master station status to the master station's current status through the master station API (equivalent to setting all slave station status to the master station's current status), and the task is completed.
[0050] E. Get the number of slaves through the master API.
[0051] F. Label the first slave as S.
[0052] G. Get S's current status and request status.
[0053] H. Execute the state judgment algorithm to determine whether the current state transfer of the slave station S is legal. If it is illegal, go to step I, otherwise go to step J.
[0054] I. Set the S request status to the current status of the master station.
[0055] J. Determine whether the current state of S is equal to the requested state. If not, go to step K; otherwise, go to step L.
[0056] K. Set the S current state to the S request state through the main station API.
[0057] L. Is there a next slave? If so, mark the next slave as S and go to step G. Otherwise, the task ends.
[0058] In this embodiment, the status judgment algorithm returns 0 to indicate that the slave status transfer is illegal, and returns 1 to indicate that it is legal.
[0059] 1. If the current status of the master station is UNKNOWN, return 0.
[0060] 2. If the slave request status is BOOT, return 1.
[0061] 3. If the requested state is the same as the master's current state or is to the left of the master's current state in the order of INIT, PREOP, SAFEOP, and OP, return 1.
[0062] 4. If none of the above conditions are met, return 0.
[0063] Example 3 This embodiment provides a wind power programmable controller ETHERCAT slave hot-swap system, which is used to implement the wind power programmable controller ETHERCAT slave hot-swap method in Embodiment 1 and Embodiment 2. The system includes: Configuration module: When the PLC is powered on, the ESFP thread is started and the EtherCAT master is configured using the ESFP thread management tool. The slave status query module starts the configured EtherCAT master and executes the ESFP thread to query the status of the EtherCAT slave according to the EtherCAT master; Abnormal state elimination module: when a transient abnormality occurs in the state of the EtherCAT slave, the state of the abnormal EtherCAT slave is switched to the current state of the EtherCAT master, and the state is synchronized, thereby eliminating the transient abnormality of the EtherCAT slave; The ESFP thread is a subthread in the PLC main program and is used to manage / configure the EtherCAT slave status by calling the EtherCAT master API.
[0064] Example 4 In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory). The computer-readable storage medium is a memory device in a terminal device, used to store programs and data. It is understood that the computer-readable storage medium herein may include both built-in storage media in the terminal device and, of course, extended storage media supported by the terminal device. It may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for being loaded and executed by a processor. These instructions may be one or more computer programs (including program code). It should be noted that more specific examples (a non-exhaustive list) of computer-readable storage media herein include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk-read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0065] Computer-readable storage media also include data signals propagated in baseband or as part of a carrier wave, which carry readable program code. Such propagated data signals can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium can also be any readable medium other than a readable storage medium, which can send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0066] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0067] The processor may load and execute one or more instructions stored in a computer-readable storage medium to implement the corresponding steps of the hot-swap method for an ETHERCAT slave station of a wind power programmable controller in the above embodiment; the processor may load and execute the following steps: When the PLC is powered on, the ESFP thread is started and the EtherCAT master is configured using the ESFP thread management tool. Start the configured EtherCAT master and execute the ESFP thread to query the status of the EtherCAT slave according to the EtherCAT master; When a transient abnormality occurs in the state of an EtherCAT slave station, the state of the abnormal EtherCAT slave station is synchronized, thereby eliminating the transient abnormality of the EtherCAT slave station; The ESFP thread is a subthread in the PLC main program and is used to manage / configure the EtherCAT slave status by calling the EtherCAT master API.
[0068] Example 4 Figure 3 The present invention is a block diagram of an electronic device according to an embodiment of the present invention.
[0069] See also Figure 3 The terminal device 600 is an electronic device that is implemented as a general-purpose computing device. The components of the electronic device may include, but are not limited to, at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including the storage unit 620 and the processing unit 610), and a display unit 640.
[0070] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the above method section of this specification. For example, the processing unit 610 can perform the following steps: Figure 1 The steps shown are as follows for the hot swap method of the ETHERCAT slave station of the wind power programmable controller.
[0071] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0072] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0073] Bus 630 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0074] The electronic device 600 can also communicate with one or more external devices 700 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 600, and / or any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 650. Furthermore, the electronic device 600 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 660. The network adapter 660 can communicate with other modules of the electronic device 600 via the bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with the electronic device 600, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.
[0075] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.
Claims
1. A hot-swap method for a wind power programmable controller ETHERCAT slave station, characterized in that: include: When the PLC is powered on, the ESFP thread is started and the EtherCAT master is configured using the ESFP thread management tool. Start the configured EtherCAT master and execute the ESFP thread to query the status of the EtherCAT slave according to the EtherCAT master; When a transient abnormality occurs in the state of an EtherCAT slave station, the state of the abnormal EtherCAT slave station is synchronized, thereby eliminating the transient abnormality of the EtherCAT slave station; The ESFP thread is a subthread in the PLC main program, which is used to manage / configure the status of the EtherCAT slave by calling the API of the EtherCAT master.
2. The hot-swap method for a wind power programmable controller ETHERCAT slave station according to claim 1, characterized in that: The ESFP thread includes an ESFP sub-thread and an ECB sub-thread; The ESFP sub-thread operation steps are as follows: registering a callback function; determining whether the PLC main program is running, and when the PLC main program is running, executing the slave status management task; otherwise, exiting the ESFP thread; The ECB sub-thread operation steps are: configure the EtherCAT master station; call the callback function to register the client corresponding to the ESFP thread to the EtherCAT master station; start the EtherCAT master station and exchange EtherCAT slave station status information with the client in real time.
3. The hot-swap method for a wind power programmable controller ETHERCAT slave station according to claim 2, characterized in that: The slave status management task is obtained according to the slave status management function; the slave status management function performs status query, status judgment and status synchronization tasks on the EtherCAT slave in each cycle.
4. The hot-swap method for a wind power programmable controller ETHERCAT slave station according to claim 3, characterized in that: The status query process specifically includes: Use the slave status management function to obtain whether the EtherCAT master status change notification was received in the last cycle; When receiving the EtherCAT master station status change notification, the current status of the EtherCAT master station is read, and the current status and request status of all EtherCAT slave stations are read.
5. The hot-swap method for a wind power programmable controller ETHERCAT slave station according to claim 3, characterized in that: The state judgment specifically includes: after reading the current state of the EtherCAT master station, sending the current state of the EtherCAT master station to the client, and judging whether the state of the EtherCAT slave station is disconnected and reconnected according to the state of the EtherCAT master station in the client; If an EtherCAT slave is obtained during status query, the request status of all slaves is set to the current status of the EtherCAT master, and all EtherCAT slaves are marked as pending update; The status of each EtherCAT slave is determined independently, and the status of the EtherCAT slave is updated according to the determination result.
6. The hot-swap method for an ETHERCAT slave station of a wind power programmable controller according to claim 5, characterized in that: According to the current state and requested state of each EtherCAT slave, the state judgment algorithm is executed to determine whether the current state transfer of the EtherCAT slave is legal; If it is illegal, the EtherCAT slave state is set to the current state of the master; If it is legal, then determine whether the current state is equal to the requested state. If not, set the current state of the EtherCAT slave to the requested state through the master API; if they are equal, make a state judgment on the next EtherCAT slave.
7. The hot-swap method for a wind power programmable controller ETHERCAT slave station according to claim 1, characterized in that: The state synchronization is used to initiate an EtherCAT slave state switching request to all EtherCAT slaves marked as to be updated by calling the API of the EtherCAT master, and switch the state of the target EtherCAT slave to the slave request state.
8. A wind power programmable controller ETHERCAT slave station hot-swap system, used to implement the wind power programmable controller ETHERCAT slave station hot-swap method according to any one of claims 1 to 7, characterized in that: include: Configuration module: When the PLC is powered on, the ESFP thread is started and the EtherCAT master is configured using the ESFP thread management tool. The slave status query module starts the configured EtherCAT master and executes the ESFP thread to query the status of the EtherCAT slave according to the EtherCAT master; An abnormal state elimination module, when a transient abnormality occurs in the state of an EtherCAT slave station, synchronizes the state of the abnormal EtherCAT slave station, thereby eliminating the transient abnormality of the EtherCAT slave station; The ESFP thread is a subthread in the PLC main program, which is used to manage / configure the status of the EtherCAT slave by calling the API of the EtherCAT master.
9. A computer-readable storage medium storing one or more programs, characterized in that: The one or more programs include instructions, and when the instructions are executed by a computing device, the computing device executes the hot-swap method for an ETHERCAT slave station of a wind power programmable controller according to any one of claims 1 to 7.
10. A computing device, characterized in that include: One or more processors, a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include steps for executing the hot-swap method of the wind power programmable controller ETHERCAT slave station as described in any one of claims 1 to 7.