A Bladed platform and PLC hardware-in-the-loop test communication method, medium and device
By using TIA programs, xml files and opcUA protocol class libraries in ring testing on the Bladed platform and PLC hardware, the compatibility and operation complexity problems in the existing technology are solved, and the simplified and efficient communication of hardware in ring testing is achieved.
Patent Information
- Application Number
- CN202210548989.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2042-05-20
AI Technical Summary
The existing Bladed simulation platform has compatibility issues and operational complexity in ring testing with PLC hardware, especially the HardwareTest module is incompatible with some PLCs, and there is a lack of obvious prompts when the Plan file is configured incorrectly.
By downloading the TIA program into the PLC, configuring the xml file, and creating a class library containing the opcUA protocol based on the C# and C++ locale, implementing hardware in-loop testing communication between the Bladed platform and the PLC, replacing the HardwareTest module, and simplifying the test process.
It realizes communication between the Bladed platform and PLC hardware in-loop testing, simplifies the test process, reduces the number of version iteration updates, and can output information flow between both parties to detect the cause of errors.
Smart Images

Figure CN114995331B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of wind turbine Bladed simulation platform and controller PLC hardware-in-the-loop testing, and in particular to a Bladed platform and PLC hardware-in-the-loop testing communication method, medium and equipment. Background Art
[0002] In order to verify the reliability of the controller program and the accuracy of the logic, hardware-in-the-loop testing is required. Currently, the hardware-in-the-loop testing of the Bladed simulation platform and the controller PLC mainly uses the HardwareTest module of the Bladed simulation platform for communication, and some controller PLCs are not compatible with the hardwareTest module of the current Bladed simulation platform. In addition, the Plan file needs to be downloaded and configured separately for the HardwareTest module. If the Plan file is configured incorrectly, there is no obvious error prompt, which makes the entire hardware-in-the-loop test operation complicated. Summary of the invention
[0003] The first purpose of the present invention is to solve the deficiencies in the prior art and provide a Bladed platform and PLC hardware-in-the-loop test communication method to replace the HardwareTest module of Bladed, realize the hardware-in-the-loop test communication between Bladed and PLC, simplify the process of hardware-in-the-loop test, output the information flow of communication between the two parties, and detect the cause of the error.
[0004] A second object of the present invention is to provide a non-transitory computer-readable medium.
[0005] A third object of the present invention is to provide a computing device.
[0006] The first object of the present invention is achieved by the following technical solution: a Bladed platform and PLC hardware-in-the-loop test communication method, comprising the following steps:
[0007] S1. Download the TIA program to the PLC, configure the XML file according to the Bladed platform, PLC hardware-in-the-loop variables, and PLC IP address information, and create a C# class library containing the opcUA protocol based on the C# language environment, and store its path in the system registry;
[0008] S2. Based on the C++ language environment, create a C++ program, call the function to extract the Bladed array and the path of the XML file, and pass the Bladed array and the path of the XML file to the C# class library through intra-process communication;
[0009] S3. The C# class library accepts the Bladed array and the path of the XML file passed by the C++ program, extracts the information in the XML file, interacts with the PLC through the opcUA protocol, passes the Bladed array to the PLC, and then returns the data obtained from the PLC to the Bladed platform through the C++ program, realizing the hardware-in-the-loop test communication between the Bladed platform and the PLC.
[0010] Further, in step S1, the following operations are specifically performed:
[0011] Get the address information of the PLC, and configure the address information of the PLC, the variables for the interaction between the Bladed platform and the PLC, the node information of each variable in the PLC, and the position of each variable in the Bladed array in the xml file. At the same time, based on the C# language environment, create a C# class library containing the opcUA protocol according to the opcUA protocol, register the C# class library through the bat file, and store its path in the system registry.
[0012] Further, in step S2, the C++ program calls the DISCON() function, the Readxmlpath() function and the Test_update() function, the DISCON() function extracts the Bladed array and the path of the xml file, the Readxmlpath() function extracts the xml path and converts the xml path into a string, the Test_update() function passes the Bladed array from the C++ program to the C# class library, and then obtains the PLC array returned from the C# class library.
[0013] Furthermore, the C# class library includes a TestOPC_UA class and a ConnectOPC class. The TestOPC_UA class includes a Test_Update() function and a getPara() function, which are used to accept parameters passed by the C++ program and extract PLC address information, various variables for interaction between the Bladed platform and the PLC, node information of each variable in the PLC, and the position of each variable in the Bladed array in the xml according to the xml path, and return the data transmitted by the PLC to the Bladed platform through the C++ program; the ConnectOPC class includes a Connect() function, a readNotes() function, a writeNodes() function, and a Disconnect() function, which interacts with the PLC according to the extracted PLC address information, various variables for interaction between the Bladed platform and the PLC, node information of each variable in the PLC, and the position of each variable in the Bladed array.
[0014] The second purpose of the present invention is achieved through the following technical solution: a storage medium stores a program, and when the program is executed by a processor, the above-mentioned Bladed platform and PLC hardware-in-the-loop test communication method is implemented.
[0015] The third purpose of the present invention is achieved through the following technical solution: a computing device, comprising a processor and a memory for storing a program executable by the processor, when the processor executes the program stored in the memory, the above-mentioned Bladed platform and PLC hardware-in-the-loop test communication method are implemented.
[0016] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0017] The present invention enables the Bladed platform and the PLC to perform hardware-in-the-loop testing, simplifies the hardware-in-the-loop testing process, eliminates the need to configure a Plan file, and can output information of both parties for verification when an error occurs during the test; at the same time, it can replace the HardwareTest module of the Bladed platform to perform hardware-in-the-loop testing, is applicable to communication between Bladed platforms and PLCs of various versions, and reduces the number of version iteration updates. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 Flowchart of the communication method between the Bladed platform and PLC hardware-in-the-loop testing.
[0019] Figure 2 This is a structural diagram of a C++ program.
[0020] Figure 3 This is the structure diagram of the TestOPC_UA class in the C# class library.
[0021] Figure 4 This is the structure diagram of the ConnectOPC class in the C# class library.
[0022] Figure 5 Flowchart for the Bladed platform and PLC hardware-in-the-loop testing. DETAILED DESCRIPTION
[0023] The present invention will be further described below in conjunction with specific embodiments.
[0024] Example 1
[0025] See also Figures 1 to 4 As shown, the Bladed platform and PLC hardware-in-the-loop test communication method provided in this embodiment includes the following steps:
[0026] S1. Download the TIA program to the PLC, configure the XML file according to the address information of the Bladed platform and the PLC, and create a C# class library (C#.dll) including the opcUA protocol based on the C# language environment, and store its path in the system registry. Perform the following operations:
[0027] Get the address information of the PLC, and configure the address information of the PLC, the various variables for the interaction between the Bladed platform and the PLC, the node information of each variable in the PLC, and the position of each variable in the Bladed array in the xml file. At the same time, based on the C# language environment, create a C# class library (C#.dll) including the opcUA protocol, and register the C# class library (C#.dll) through the bat file, and store its path in the system registry.
[0028] S2. Based on the C++ language environment, a C++ program (C++.dll) is created, a function is called to extract the Bladed array and the path of the xml file, and the Bladed array and the path of the xml file are passed to the C# class library (C++.dll) through intra-process communication. The C++ program (C++.dll) calls the DISCON() function, the Readxmlpath() function, and the Test_update() function. The DISCON() function extracts the Bladed array and the path of the xml file. The Readxmlpath() function reads the .IN file containing the xml path and extracts the xml path and converts it into a string. The Test_update() function passes the Bladed array from the C++ program (C++.dll) to the C# class library (C#.dll), and then obtains the PLC array returned from the C# class library (C#.dll).
[0029] S3. The C# class library (C#.dll) accepts the Bladed array passed by the C++ program (C++.dll) and extracts the information in the XML file according to the path of the XML file to interact with the PLC, passes the Bladed array to the PLC, and then returns the data obtained from the PLC to the Bladed platform through the C++ program (C++.dll), realizing the hardware-in-the-loop test communication between the Bladed platform and the PLC. Among them, the C# class library (C#.dll) includes the TestOPC_UA class and the ConnectOPC class, the TestOPC_UA class includes the Test_Update() function and the getPara() function, the getPara() function extracts the node information stored in the xml according to the xml path, and the Test_Update() function returns the data transmitted by the PLC according to the Bladed array and the xml path containing the node information; the ConnectOPC class includes the Connect() function, the readNotes() function, the writeNodes() function and the Disconnect() function, and interacts with the PLC according to the extracted PLC address information, the various variables that the Bladed platform interacts with the PLC, the node information of each variable in the PLC, and the position of each variable in the Bladed array.
[0030] See also Figure 5 As shown, the Bladed platform and PLC hardware-in-the-loop testing method provided in this embodiment include the following steps:
[0031] 1. Check the TIA program, obtain the address information of the PLC, and download the program to the controller PLC;
[0032] 2. Configure the XML file, configure the PLC address and the node information of the variables that need to communicate and the position of the corresponding variables in the array in Bladed;
[0033] 3. Open the Bladed platform, import the model file corresponding to the PLC program, and import the C++.dll and the .IN file containing the XML path under the Controller module;
[0034] 4. Register C#.dll through the bat file and store the path of C#.dll in the system registry;
[0035] 5. Click the Bladed simulation button to start the hardware-in-the-loop test.
[0036] Example 2
[0037] This embodiment discloses a non-transitory computer-readable medium storing instructions. When the instructions are executed by a processor, the steps of the Bladed platform and PLC hardware-in-the-loop test communication method according to Embodiment 1 are executed.
[0038] The non-temporary computer-readable medium in this embodiment may be a disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), a USB flash drive, a mobile hard disk, or other media.
[0039] Example 3
[0040] This embodiment discloses a computing device, including a processor and a memory for storing a program executable by the processor. When the processor executes the program stored in the memory, the Bladed platform and PLC hardware-in-the-loop test communication method described in Example 1 is implemented.
[0041] The computing device described in this embodiment may be a desktop computer, a laptop computer, a smart phone, a PDA handheld terminal, a tablet computer, a programmable logic controller (PLC), or other terminal devices with a processor function.
[0042] The embodiments described above are only preferred embodiments of the present invention and are not intended to limit the scope of implementation of the present invention. Therefore, all changes made according to the shape and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A Bladed platform and PLC hardware-in-the-loop test communication method, characterized in that: The following steps are involved: S1. Download the TIA program to the PLC, configure the XML file according to the Bladed platform, PLC hardware-in-the-loop variables, and PLC IP address information, and create a C# class library containing the opcUA protocol based on the C# language environment, and store its path in the system registry; S2. Based on the C++ language environment, create a C++ program, call the function to extract the Bladed array and the path of the XML file, and pass the Bladed array and the path of the XML file to the C# class library through intra-process communication; S3. The C# class library accepts the Bladed array and the path of the XML file passed by the C++ program, extracts the information in the XML file, interacts with the PLC through the opcUA protocol, passes the Bladed array to the PLC, and then returns the data obtained from the PLC to the Bladed platform through the C++ program, realizing the hardware-in-the-loop test communication between the Bladed platform and the PLC.
2. A Bladed platform and PLC hardware-in-the-loop test communication method according to claim 1, characterized in that: In step S1, the following operations are specifically performed: Get the address information of the PLC, and configure the address information of the PLC, the variables for the interaction between the Bladed platform and the PLC, the node information of each variable in the PLC, and the position of each variable in the Bladed array in the xml file. At the same time, based on the C# language environment, create a C# class library containing the opcUA protocol according to the opcUA protocol, register the C# class library through the bat file, and store its path in the system registry.
3. A Bladed platform and PLC hardware-in-the-loop test communication method according to claim 1, characterized in that: In step S2, the C++ program calls the DISCON() function, the Readxmlpath() function and the Test_update() function, the DISCON() function extracts the Bladed array and the path of the xml file, the Readxmlpath() function extracts the xml path and converts the xml path into a string, the Test_update() function passes the Bladed array from the C++ program to the C# class library, and then obtains the PLC array returned from the C# class library.
4. A Bladed platform and PLC hardware-in-the-loop test communication method according to claim 1, characterized in that: The C# class library includes the TestOPC_UA class and the ConnectOPC class. The TestOPC_UA class includes the Test_Update() function and the getPara() function, which are used to accept parameters passed by the C++ program and extract the PLC address information, various variables for interaction between the Bladed platform and the PLC, the node information of each variable in the PLC, and the position of each variable in the Bladed array in the xml according to the xml path, and return the data transmitted by the PLC to the Bladed platform through the C++ program; the ConnectOPC class includes the Connect() function, the readNotes() function, the writeNodes() function, and the Disconnect() function, which interacts with the PLC according to the extracted PLC address information, various variables for interaction between the Bladed platform and the PLC, the node information of each variable in the PLC, and the position of each variable in the Bladed array.
5. A storage medium storing a program, characterized in that: When the program is executed by a processor, the Bladed platform and PLC hardware-in-the-loop test communication method described in any one of claims 1 to 4 is implemented.
6. A computing device comprising a processor and a memory for storing a program executable by the processor, characterized in that: When the processor executes the program stored in the memory, the Bladed platform and PLC hardware-in-the-loop test communication method described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Wind turbine running simulation system based on PLC (programmable logic controller) system
CN102156431A
Large-scale wind turbine unit real-time operation control combined simulation platform and construction method thereof
CN104865845A