PLC data acquisition source end modeling method

By adopting the OPC UA architecture in the hydropower control system, dynamically generate the address space of the PLC and combining the event-driven mechanism, the complex configuration of traditional protocols is solved, efficient data collection and real-time information processing are achieved, different PLC equipment is adapted to support floating-point transcoding and quality monitoring, and the development of intelligent hydropower systems is promoted.

CN120469330APending Publication Date: 2025-08-12THREE GORGES JINSHAJIANG CHUANYUN HYDROPOWER DEV CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510751438.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

In the existing hydropower control systems, the traditional protocol communication mechanism relies on static point tables, resulting in complex configuration and difficulty in maintaining, and it is difficult to adapt to dynamic and intelligent needs. The application of OPC UA in the field of hydropower control is limited by insufficient terminal equipment support, lack of point table dynamic mapping technology and incomplete event processing mechanism.

Method used

Adopting the OPC UA architecture, by configuring the measurement point table on the computer side of the intelligent integrated platform and uploading JSON files, dynamically generate the PLC's OPC UA address space, combined with the event driving mechanism, data collection of switch quantities and analog quantities is realized, and event subscriptions for quality marks and mandatory marks are supported.

Benefits of technology

It reduces the complexity of communication configuration and maintenance costs, realizes efficient data collection and real-time information processing, is adapted to different PLC equipment, supports floating-point transcoding and quality monitoring, meets the real-time and reliability requirements of hydropower control, and promotes the standardization and intelligent development of intelligent hydropower systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120469330A_ABST
    Figure CN120469330A_ABST
Patent Text Reader

Abstract

The invention provides a PLC data acquisition source end modeling method, relates to the technical field of industrial automation, and solves the problem of how to establish a good information model for a hydroelectric control object by using an OPC UA method to realize efficient communication. The method comprises the following steps: firstly, configuring a measuring point table comprising a switching value definition table and an analog value definition table, including address mapping and other configurations; the upper computer obtains the version number of the current point table in the PLC, if the version number is not consistent with the local version number, downloading of the point table is triggered, and the measuring point table is converted into a JSON file to be downloaded to the PLC; the PLC analyzes the JSON file, dynamically generates an OPC UA address space according to the label and the address mapping information, and instantiates two types of variable nodes of a switching value and an analog quantity; the switch measurement point uploads displacement information in an event mode, and the analog measurement point uploads a transcoded floating point value through a data change monitoring item; and defining an event subscription object in the OPC UA address space to receive an event, and transmitting an event source node and a real-time value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial automation, is applied to a control process of a hydropower station, and particularly relates to a PLC data acquisition source end modeling method. Background Art

[0002] Device communications in the industrial automation sector have long relied on a variety of traditional protocols, such as MODBUS, the IEC 60870-5 series (e.g., 101, 103, and 104), and IEC 61850. These protocols are widely used in scenarios such as hydropower control and substations, but they have significant limitations. For example, MODBUS and IEC 60870-5 require both parties to pre-agreed on a table of communication points before communication can begin. Any unilateral change can lead to communication anomalies. Furthermore, as the number of measurement points increases, configuration and maintenance complexity increases dramatically, and communication efficiency struggles to meet the demands of large-scale systems. While IEC 61850 has performed well in substation automation, its practical application in the hydropower control sector still faces significant resistance due to its complex entity object structure and cumbersome configuration process.

[0003] In recent years, OPC UA (Open Platform Communications Unified Architecture), a next-generation open communications standard, has gradually become a key technical direction for industrial interconnection. Jointly developed by over 30 leading global manufacturing companies, this architecture boasts cross-platform functionality, high security, and semantic modeling. It has been adopted by numerous governments and industry organizations as a foundational standard for industrial communications. International manufacturers such as Siemens, ABB, and Rockwell Automation have pioneered OPC UA technology integration and embedded it into core products such as PLCs and SCADA, driving the technology's rapid penetration into smart manufacturing, energy management, and other fields globally. In contrast, OPC UA research in my country started relatively late, particularly in the water conservancy and hydropower control sector. Mature application cases are scarce, and the technology ecosystem is still underdeveloped. Although my country has incorporated OPC UA into the national standard (GB / T 33863) and established a certification testing laboratory, its implementation still faces challenges such as poor technical adaptability and insufficient local support.

[0004] Currently, most hydropower control systems use traditional protocols, and their communication mechanisms rely on static point tables, making them difficult to adapt to dynamic and intelligent upgrades. For example, traditional point tables require repeated configuration by both communicating parties, and manual synchronization is required when changes are made, which can easily lead to version misalignment. Advanced functions such as data quality monitoring and event-driven development lack a unified framework and are often implemented through customized development, which is costly and has poor compatibility. In addition, existing protocols have limited support for complex data types such as floating-point number transcoding and quality mark integration, resulting in frequent conversions between data collection and upper-level applications, further reducing system efficiency. Although OPC UA has the potential to solve these problems, its application in the field of hydropower control is still limited by bottlenecks such as insufficient terminal device support, the lack of dynamic point table mapping technology, and an imperfect event processing mechanism. It urgently needs to be refined and improved for specific industry scenarios. Summary of the Invention

[0005] The purpose of the present invention is to solve the problem of how to use the OPC UA method to establish a good information model for hydropower control objects to achieve efficient communication. Therefore, a PLC data acquisition source end modeling method is proposed. The OPC UA architecture to be adopted by this method is based on information models and services to achieve communication purposes. The information model is derived from the concept of object-oriented programming (OOP), which meets actual needs. The construction of the information model is very flexible and has few restrictions. It only needs to establish the model on the server side, and the client obtains the model and controls the model through the service. This invention will introduce a more specific modeling operation process to realize the application of this method.

[0006] The present invention adopts the following technical solutions to achieve the purpose:

[0007] A PLC data acquisition source end modeling method, which is applied to an intelligent integrated platform for hydropower station control, includes the following steps:

[0008] S1. Configure a measurement point table on the host computer of the intelligent integrated platform using a data management tool. The measurement point table includes a switch quantity definition table and an analog quantity definition table. Each measurement point table includes an address mapping portion and other configuration portions. The address mapping portion includes a label and a PLC register address. The label is an OPC UA node browse name.

[0009] S2. The host computer calls the GetVersion interface to obtain the version number of the current point table in the PLC. If the version number is inconsistent with the local point table, the point table is triggered to be downloaded;

[0010] S3. The host computer converts the measurement point table into a JSON file through the Download interface and downloads it to the PLC. The JSON file contains the version number, table type, measurement point name, and address mapping information.

[0011] S4. The PLC parses the JSON file, dynamically generates an OPC UA address space based on the tag and address mapping information, creates an object instance of the PLCObjectType type in the address space, and instantiates variable nodes of the IndVarType and AnaVarType types under the object;

[0012] S5. PLC processes data changes according to the measurement point type: switch measurement points send position change information through events, and analog measurement points send transcoded floating-point values through data change monitoring items;

[0013] S6. Define three event subscription objects, SubIndEvents, SubQualityEvents, and SubForceEvents, in the OPC UA address space to receive switch position change, quality mark change, and forced action events, respectively. The event source node and real-time value are transmitted through the PLCEventType event type, thereby completing the PLC data acquisition source end modeling.

[0014] The GetVersion interface is the communication interface used by the host computer to obtain the version number of the current measurement point table in the PLC, which is used to determine whether the local and remote configurations are consistent. The Download interface is the communication interface used by the host computer to transfer the converted JSON format measurement point table file to the PLC, which is used to update or synchronize the measurement point configuration information.

[0015] Preferably, the generation rule of the version number in step S2 is: generating a unique identifier according to the hash value of the label and address of the address mapping part in the measurement point table, and appending a timestamp as the version number.

[0016] Specifically, the JSON file in step S3 further includes: the transcoding identifier, original code range and engineering unit configuration information of the analog measurement point; the quality flag associated register address and the mandatory flag bit address of the switch measurement point.

[0017] Specifically, the PLCEventType event type in step S6 inherits from BaseEventType and extends the following attributes: a SrcNode attribute, which represents the measurement point node that actually triggers the event; and a Value attribute, which represents the real-time data value when the event is triggered.

[0018] BaseEventType is the basic event type defined in OPC UA. It provides the basic properties and behaviors of event objects and serves as the base class for other custom event types. It usually contains common information such as timestamp, event type identifier, and source object, which is inherited and supplemented by extended event types such as PLCEventType.

[0019] Specifically, when an event corresponding to the PLCEventType event type is submitted, the SourceNode attribute and the SrcNode attribute are set; wherein the SourceNode attribute is set to the SubIndEvents, SubQualityEvents or SubForceEvents event subscription object node, and the SrcNode attribute points to the measurement point variable node.

[0020] Preferably, the variable node of the IndVarType type is defined as: data type is UInt16; contains a Quality attribute and a Force attribute, which respectively represent a Byte type quality flag and a Boolean type force flag.

[0021] Preferably, the variable node of the AnaVarType type is defined as: the data type is Double; and it also includes corresponding Quality attributes and Force attributes, which respectively represent the quality flag of the Byte type and the force flag of the Boolean type.

[0022] Specifically, in step S4, the root node name of the object instance of the PLCObjectType type is set by the host computer calling the SetRootName method, and the root node name is obtained from the PLC through the GetRootName method.

[0023] SetRootName is a method used by the host computer to set the root node name of an object instance in the PLC, used to identify or distinguish different object instances; GetRootName is a method used by the host computer to obtain the current root node name of the object instance from the PLC, used to confirm or read the set root node name.

[0024] Preferably, the specific method of dynamically generating the OPC UA address space in step S4 is:

[0025] If the PLC supports register tag programming, the address space node is generated directly based on the tag name;

[0026] If the PLC does not support programming tools, a hierarchical folder node is generated based on the mapping relationship between the measurement point name and address in the JSON file.

[0027] Specifically, the method also includes: the host computer sends a command to the PLC through the ExecCommand method, the input parameters include the command address and command content, and the output parameter is the execution status; the format of the command address adopts %MWXXXX, which corresponds to the absolute address of the PLC internal command register.

[0028] The ExecCommand method is a standardized or customized command execution interface provided by PLCs in industrial automation systems. It allows the host computer to send control instructions to the PLC by calling this method. It can also specify that commands or parameters be written to specific addresses within the PLC, thereby triggering corresponding logical operations or state changes. This method is often encapsulated in communication protocols or configuration interfaces to implement functions such as remote control, device operation, or process scheduling.

[0029] In summary, due to the adoption of this technical solution, the beneficial effects of the present invention are as follows:

[0030] The method of the present invention realizes source-end modeling of PLC data acquisition through OPC UA technology, significantly reducing the complexity of communication configuration and maintenance costs. Based on the one-sided point table configuration and dynamic address space generation mechanism, the host computer only needs to define the measurement point table in the data management tool and download it to the PLC to automatically complete the OPC UA node mapping, and completely solve the communication anomaly problem caused by point table version misalignment in the traditional solution. Combining version control with event-driven mechanism, the system can efficiently identify point table change requirements and reduce invalid data transmission. At the same time, it optimizes real-time information processing efficiency and reduces communication bandwidth pressure through hierarchical event subscription objects such as switch position change and quality mark update. In addition, built-in variable type extensions, such as integrated quality marks and mandatory marks, can enhance the integrity of data expression and provide reliable support for complex logical judgments in hydropower control scenarios.

[0031] This invention further leverages the cross-platform, high security, and semantic modeling advantages of the OPC UA protocol to achieve "plug-and-play" communication for terminal devices. By downlinking JSON point tables and generating dynamic address spaces, it adapts to the hardware capabilities of different PLC devices, breaking the traditional protocol's reliance on operating systems and underlying communication methods. Its open architecture design facilitates seamless integration with Industry 4.0 systems, supports advanced functions such as floating-point transcoding and quality monitoring, and meets the stringent real-time and reliability requirements of the hydropower sector. This solution not only simplifies the interconnection process between heterogeneous devices, but also lays a technical foundation for remote operation and maintenance and data fusion analysis of intelligent hydropower systems, driving the industry's evolution towards standardization and intelligence. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The present invention further illustrates its implementation and technical solutions in detail through the following drawings, which specifically include 6 drawings as follows:

[0033] Figure 1 A schematic diagram briefly describing the overall process steps of the method of the present invention;

[0034] Figure 2 A schematic diagram of a switch value definition table configured in the method of the present invention;

[0035] Figure 3 A schematic diagram of an analog quantity definition table configured in the method of the present invention;

[0036] Figure 4 A schematic diagram of the operation interface for obtaining the mapping table version in the method of the present invention;

[0037] Figure 5 This is a schematic diagram of the operation interface for calling the mapping table download function in the method of the present invention;

[0038] Figure 6 The figure is a schematic diagram showing the display of the PLC model on the human-computer interaction interface of the host computer in the method of the present invention. DETAILED DESCRIPTION

[0039] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.

[0040] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.

[0041] A PLC data acquisition source modeling method, Figure 1 The overall process of the method is briefly described in the following figure, which can be viewed simultaneously; the key steps of the method are summarized as follows:

[0042] S1. Configure a measurement point table on the host computer of the intelligent integrated platform using a data management tool. The measurement point table includes a switch quantity definition table and an analog quantity definition table. Each measurement point table includes an address mapping portion and other configuration portions. The address mapping portion includes a label and a PLC register address. The label is an OPC UA node browse name.

[0043] S2. The host computer calls the GetVersion interface to obtain the version number of the current point table in the PLC. If the version number is inconsistent with the local point table, the point table is triggered to be downloaded;

[0044] S3. The host computer converts the measurement point table into a JSON file through the Download interface and downloads it to the PLC. The JSON file contains the version number, table type, measurement point name, and address mapping information.

[0045] S4. The PLC parses the JSON file, dynamically generates an OPC UA address space based on the tag and address mapping information, creates an object instance of the PLCObjectType type in the address space, and instantiates variable nodes of the IndVarType and AnaVarType types under the object;

[0046] S5. PLC processes data changes according to the measurement point type: switch measurement points send position change information through events, and analog measurement points send transcoded floating-point values through data change monitoring items;

[0047] S6. Define three event subscription objects, SubIndEvents, SubQualityEvents, and SubForceEvents, in the OPC UA address space to receive switch position change, quality mark change, and forced action events, respectively. The event source node and real-time value are transmitted through the PLCEventType event type, thereby completing the PLC data acquisition source end modeling.

[0048] This embodiment will further introduce the details of the method based on the above-summarized method flow; first, it will implement the point table download function.

[0049] In order to achieve the goal of establishing a communication point table on only one side of the communicating parties, a point table is established on the host computer side of the intelligent integrated platform through a data management tool, and then the point table is downloaded to the PLC. The PLC automatically maps the measurement points to the OPC UA address space based on the point table.

[0050] As a preference, before downloading, in order to prevent the point table from being re-downloaded when it has not changed, a version number is added to the point table, and the version number is obtained first, and then downloaded if the version number is inconsistent.

[0051] In this embodiment, the host computer point table is defined as follows: configuring a measurement point table in the intelligent integrated platform data management tool, including a switch value definition table and an analog value definition table.

[0052] like Figure 2 As shown in the figure, the root node name (usually the point name prefix) must be defined in the switch definition table. Each point table entry consists of two parts: the address mapping part and the other configuration part. The address mapping part includes the label and the address. The label is the node browser name in OPCUA, and the address is the register address in the PLC. Data can be collected based on this address.

[0053] In this embodiment, for the intelligent integrated platform side, the root node name plus the label is combined into a complete point name. The other configuration parts are the configuration information required to generate complete switch measurement point information, such as Figure 2 Other fields in: description, display name, etc.

[0054] like Figure 3 As shown in the figure, the analog quantity definition table needs to define the root node name (usually the point name prefix) just like the switch quantity definition table. Each point table content also includes two parts: address mapping part and other configuration parts. The address mapping part includes label, address, and transcoding. The label and address are the same as before. The transcoding indicates whether it needs to be converted from the original code to the actual floating point number. If not, it means that it is already a floating point number (such as calculating analog quantity, etc.). The other configuration part is the configuration information required to generate complete analog measurement point information, such as Figure 3 Other fields: description, display name, unit name, etc.

[0055] like Figure 4 As shown, the mapping table version is obtained, and the GetVersion interface is developed. By inputting the mapping table file name, the mapping table version is output to the host computer of the intelligent integrated platform, so as to know whether the mapping table needs to be downloaded again.

[0056] Setting and obtaining the root node name: On the intelligent integration platform side, use the SetRootName method under the Objects node to set the root node name to the PLC, and use GetRootName to obtain the root node name from the intelligent front-end device or PLC.

[0057] like Figure 5 As shown, the mapping table download begins. A Download interface was developed to provide the host computer with mapping table download functionality. This function maps PLC internal points to host computer points and saves them as a JSON file in the PLC. The JSON file contains the version, table type, point name, address, and more. This function can be invoked by right-clicking the data in the Data Management Tool and selecting Download OPC UA Point Table Data.

[0058] In this implementation, in order to simplify processing, the configuration information of the measuring points, the alarm logic of the analog quantity, and other logic are still retained for processing on the host computer of the intelligent integrated platform; while the information such as the switch position change, quality position change, and forcing are sent to the intelligent integrated platform by the PLC side through events; the analog quantity changes are sent to the intelligent integrated platform through data change monitoring.

[0059] In addition to real-time values, measurement points in the PLC also have quality and mandatory flags. This implementation adds two variable types to OPC UA, representing switch and analog measurement points, respectively. These are as follows:

[0060] Switch variable type, named: IndVarType; data type: UInt16; has two member attributes: Quality, which represents the quality flag, is of type Byte (unsigned 8-bit integer); Force, which represents the force flag, is of type Boolean;

[0061] Analog variable type, named: AnaVarType; data type: Double; also has two member attributes: Quality represents the quality flag, type is Byte (unsigned 8-bit integer); Force represents the force flag, type is Boolean.

[0062] In this implementation, the PLC Address Space is the collection of information visible to the client in the OPC UA server. To determine the PLC's node ID in the Objects Address Space, an object type is added:

[0063] Object type name: PLCObjectType; this object type derives from BaseObjectType and has no new attribute members. After preparing the PLCObjectType object type, add an object instance of this type to the Objects address space (note that the PLC name can be modified as needed). Organize measurement point instances (i.e., IndVarType and AnaVarType type instances) under the PLC as needed. You can also add folder nodes (FolderType type instances) under the PLC to facilitate the classification of measurement points.

[0064] In this implementation, there are two schemes for generating the PLC address space:

[0065] If the programming integration tool provided by the PLC supports register tag editing, the OPC UA address space in the PLC can directly generate space nodes based on the tag name, or the measurement points can be organized under the module name according to the module where the measurement points are located.

[0066] On the intelligent integration platform side, the mapping is completed by browsing the measurement point table tags and root node names. Simultaneously, the configuration information in the measurement point table is combined to generate the intelligent integration platform side object tree and corresponding node information. Note that the measurement point table mapping portion of the intelligent integration platform side does not need to be downloaded to the PLC.

[0067] If the PLC does not provide a programming integration tool, the intelligent integration platform packages the address mapping part in the measurement point table in JSON format and transmits it to the PLC. The PLC generates the PLC's OPC UA address space based on the tag and address information and collects data based on the address.

[0068] For switch measurement points, data changes are sent as events. For analog measurement points, data should be converted to floating-point numbers and sent via data change monitoring. Therefore, the address mapping section for analog measurement points also includes the original code range and upper and lower range configuration information.

[0069] On the intelligent integration platform side, the mapping of labels to node IDs is completed through the browsing function. The JSON file content includes: version number, measurement point table type, and measurement point table item collection (point name, address, etc.).

[0070] During point-to-point operation, the intelligent integrated platform host computer calls the PLC's ExecCommand method to write a command to a specified address area. This method takes two input parameters and one output parameter. The first input parameter is the address, which corresponds to the command address area in Modbus / TCP and is formatted similarly to "%MW2604." The second input parameter is the command content. The output parameter indicates whether the command was successfully written to the specified address: 0 for failure and 1 for success.

[0071] This implementation also involves the application of data quality and mandatory flags. If the collection link is disconnected, the relevant measurement points need to set a data quality flag (1 is normal, 0 is abnormal); changes in the data quality flag should be reported to the intelligent integration platform via events.

[0072] When the intelligent integration platform issues an order to force a value to be set at a certain measurement point, the forced position of the corresponding node in the relevant OPC UA needs to be set to 1, and the forced position needs to be set to 0 when the force is released.

[0073] Finally, to achieve the integration of the upper and lower computers, it is necessary to obtain the relevant files in the PLC. In this implementation, the GetHmiFile interface is used to have the PLC export the hmi folder through the NAPro tool and copy it to the / na directory. The tar-zcvf hmi.tar.gz hmi / command is then executed to package it into an hmi.tar.gz file, which is then provided to the upper computer.

[0074] The hmi.tar.gz file contains the PLC model, which can be displayed in HTML format on the host computer through the OIX human-computer interaction interface. Figure 6 Next, to request SCC data, the HTML file can interact with the PLC through the RequestData interface.

[0075] In order to distinguish the measurement point events from other events in the PLC, and to take into account the convenience of handling the switch position change, mass position change, and forced action events, this implementation adds an event type:

[0076] Event type name: PLCEventType; this event type inherits from BaseEventType. The class itself already contains attribute fields such as EventId, EventType, LocalTime, ReceiveTime, Severity, SourceName, SourceNode, and Time.

[0077] The PLCEventType event type also contains two member attributes: SrcNode and Value; the SrcNode attribute represents the measuring point node that actually triggers the event; the Value attribute represents the real-time data value when the event is triggered.

[0078] Considering performance and efficiency, this implementation adds three new objects to the PLC address space to subscribe to switch position change, quality change, and forced action events: SubIndEvents, SubQualityEvents, and SubForceEvents. These three objects are all of type BaseObjectType, and their EventNotifier properties are all set to SubscribeToEvents.

[0079] BaseObjectType is a standard object type defined in OPC UA. It serves as the base class for other custom object types and provides common properties and behaviors. EventNotifier is an object property that indicates whether the object supports event notification and what types of event operations (such as subscription and triggering) it supports. SubscribeToEvents is a setting value of the EventNotifier property, indicating that the object supports event subscriptions, allowing clients to listen to its published events.

[0080] In this embodiment, the SubIndEvents object is used to subscribe to switch position change events, the SubQualityEvents object is used to subscribe to quality position change events, and the SubForceEvents object is used to subscribe to force action events.

[0081] It should be noted here that there is a SourceNode attribute in the BaseEventType event type base class, which will be set to the event submission node (also the event subscription object node) when the event is submitted. Therefore, an event source node is redefined in the newly added event type PLCEventType to represent the real event source.

[0082] In order to reduce communication interactions, the corresponding real-time value when the event is generated is added to the event and saved in the Value attribute.

[0083] Through the above-mentioned method process and detailed content of this embodiment, the PLC data acquisition source modeling can be successfully completed. Its one-sided point table configuration and dynamic address space generation mechanism enable the host computer to automatically complete the OPC UA node mapping by simply defining the measurement point table in the data management tool and downloading it to the PLC.

Claims

1. A PLC data acquisition source modeling method, characterized by: This method is applied to the intelligent integrated platform for hydropower station control and includes the following steps: S1. Configure a measurement point table on the host computer of the intelligent integrated platform using a data management tool. The measurement point table includes a switch quantity definition table and an analog quantity definition table. Each measurement point table includes an address mapping portion and other configuration portions. The address mapping portion includes a label and a PLC register address. The label is an OPC UA node browse name. S2. The host computer calls the GetVersion interface to obtain the version number of the current point table in the PLC. If the version number is inconsistent with the local point table, the point table is triggered to be downloaded; S3. The host computer converts the measurement point table into a JSON file through the Download interface and downloads it to the PLC. The JSON file contains the version number, table type, measurement point name, and address mapping information. S4. The PLC parses the JSON file, dynamically generates an OPC UA address space based on the tag and address mapping information, creates an object instance of the PLCObjectType type in the address space, and instantiates variable nodes of the IndVarType and AnaVarType types under the object; S5. PLC processes data changes according to the measurement point type: switch measurement points send position change information through events, and analog measurement points send transcoded floating-point values through data change monitoring items; S6. Define three event subscription objects, SubIndEvents, SubQualityEvents, and SubForceEvents, in the OPC UA address space to receive switch position change, quality mark change, and forced action events, respectively. The event source node and real-time value are transmitted through the PLCEventType event type, thereby completing the PLC data acquisition source end modeling.

2. The PLC data acquisition source modeling method according to claim 1, characterized in that: The generation rule of the version number in step S2 is: generate a unique identifier according to the hash value of the label and address in the address mapping part in the measurement point table, and append a timestamp as the version number.

3. The PLC data acquisition source modeling method according to claim 1, characterized in that: The JSON file in step S3 also includes: the transcoding identifier, original code range and engineering unit configuration information of the analog measurement point; the quality flag associated register address and the forced flag bit address of the switch measurement point.

4. The PLC data acquisition source modeling method according to claim 1, characterized in that: The PLCEventType event type in step S6 inherits from BaseEventType and extends the following attributes: a SrcNode attribute, which represents the measuring point node that actually triggers the event; and a Value attribute, which represents the real-time data value when the event is triggered.

5. The PLC data acquisition source end modeling method according to claim 4 is characterized in that: When an event corresponding to the PLCEventType event type is submitted, the SourceNode attribute and the SrcNode attribute are set; wherein the SourceNode attribute is set to the SubIndEvents, SubQualityEvents or SubForceEvents event subscription object node, and the SrcNode attribute points to the measurement point variable node.

6. The PLC data acquisition source modeling method according to claim 1, characterized in that: The variable node of the IndVarType type is defined as: the data type is UInt16; it includes a Quality attribute and a Force attribute, which respectively represent a Byte type quality flag and a Boolean type force flag.

7. The PLC data acquisition source modeling method according to claim 1, characterized in that: The variable node of the AnaVarType type is defined as: data type is Double; contains Quality attribute and Force attribute, which respectively represent the quality flag of Byte type and the force flag of Boolean type.

8. The PLC data acquisition source end modeling method according to claim 1, characterized in that: In step S4, the root node name of the object instance of the PLCObjectType type is set by the host computer calling the SetRootName method, and the root node name is obtained from the PLC through the GetRootName method.

9. The PLC data acquisition source end modeling method according to claim 1, characterized in that: The specific method of dynamically generating the OPC UA address space in step S4 is: If the PLC supports register tag programming, the address space node is generated directly based on the tag name; If the PLC does not support programming tools, a hierarchical folder node is generated based on the mapping relationship between the measurement point name and address in the JSON file.

10. The PLC data acquisition source end modeling method according to claim 1, characterized in that: Also includes: The host computer sends a command to the PLC through the ExecCommand method. The input parameters include the command address and command content, and the output parameter is the execution status. The command address format uses %MWXXXX, which corresponds to the absolute address of the PLC's internal command register.

Citation Information

Patent Citations

  • A packaging system

    IE61850B1