CN114254923B - PLC control flow generation method and system based on OPCUA - Google Patents

PLC control flow generation method and system based on OPCUA Download PDF

Info

Publication number
CN114254923B
CN114254923B CN202111577820.3A CN202111577820A CN114254923B CN 114254923 B CN114254923 B CN 114254923B CN 202111577820 A CN202111577820 A CN 202111577820A CN 114254923 B CN114254923 B CN 114254923B
Authority
CN
China
Prior art keywords
node
information
edge
control flow
head
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111577820.3A
Other languages
Chinese (zh)
Other versions
CN114254923A (en
Inventor
王峥瀛
张润时
王乾
康晓非
肖棋元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Three Gorges Corp
Original Assignee
China Three Gorges Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Three Gorges Corp filed Critical China Three Gorges Corp
Priority to CN202111577820.3A priority Critical patent/CN114254923B/en
Publication of CN114254923A publication Critical patent/CN114254923A/en
Application granted granted Critical
Publication of CN114254923B publication Critical patent/CN114254923B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0633Workflow analysis
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/054Input/output
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Physics & Mathematics (AREA)
  • Economics (AREA)
  • Physics & Mathematics (AREA)
  • Operations Research (AREA)
  • Marketing (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Game Theory and Decision Science (AREA)
  • Educational Administration (AREA)
  • Development Economics (AREA)
  • Data Mining & Analysis (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)
  • General Factory Administration (AREA)

Abstract

The invention provides a PLC control flow generation method based on OPCUA, which comprises the following steps: step S1: acquiring state information of production equipment through a PLC (programmable logic controller); step S2: generating a control flow chart according to the acquired state information of the production equipment; and step S3: storing the control flow chart in a static linked list form; and step S4: generating a control flow chart information model according to the static linked list; step S5: sending the generated control flow chart information model to a client; the invention also provides a PLC control flow generation system based on the OPCUA, which avoids the repeated development of the interface on the HMI display side; more labor cost is saved; HMI display side information is directly obtained from a lower computer, and is not required to be copied independently, so that the data transmission processing efficiency is high, more development cost is saved, and the maintenance is convenient.

Description

PLC control flow generation method and system based on OPCUA
Technical Field
The invention relates to the technical field of data information processing, in particular to a PLC control flow generation method and system based on OPCUA.
Background
The industrial field needs HMI (human-machine interface) to monitor and control equipment so as to ensure the stability and high efficiency of the field production process; the realization of the HMI (human-computer interface) depends on the cooperation of the lower computer monitoring equipment and the screen display equipment; the lower computer monitoring equipment is responsible for reading the state of the actual field equipment or the sensor and controlling the actual field equipment or the sensor on the spot; the screen display is responsible for displaying a proper monitoring interface and a proper control interface for field personnel to operate; the two devices are independent from each other, and can respectively complete the functions of the two devices, so that the stability of field production work is effectively ensured; by specifying a data transmission protocol, the monitoring data of the lower computer can be correctly uploaded to the screen, and the screen control instruction can also be correctly issued to the control equipment. However, field devices are very different, and for different devices on the same field, a screen developer needs to write a large number of codes to realize communication with each device; the GUI of the screen is a graphic display of the control process of the lower monitoring device, which expresses the same content but is repeatedly developed, and for different use environments at different sites, the screen developer also needs to pay a lot of effort to develop the GUI suitable for the site, which prolongs the development period and wastes human resources.
Disclosure of Invention
The object of the present invention is to solve at least one of the technical drawbacks mentioned.
Therefore, an object of the present invention is to provide a PLC control flow generation method and system based on OPCUA, so as to solve the problems mentioned in the background art and overcome the disadvantages in the prior art.
In order to achieve the above object, an embodiment of an aspect of the present invention provides a PLC control flow generation method based on an OPCUA, including:
step S1: and acquiring the state information of the production equipment through the PLC.
Step S2: and generating a control flow chart according to the acquired state information of the production equipment.
And step S3: and storing the control flow chart in a static linked list form.
The static linked list comprises a head array, a side information array and a plurality of array indexes; the head array includes a plurality of process head nodes, and when the process head nodes have connected edges, each process head node having a connected edge corresponds to an array index. The side information array comprises a plurality of side information, and each side information corresponds to each array index; each edge information includes a connected edge, a weight, and a next edge.
And step S4: and generating a control flow chart information model according to the static linked list.
Generating the control flow graph information model according to the static linked list comprises:
step S41: and generating an SCC directory under the DA directory of the PLC information model.
Step S42: the HEAD directory, EDGE directory and CURRENT directory are generated under the SCC directory.
Step S43: and generating a plurality of HEAD nodes under the HEAD catalog and a plurality of EDGE nodes under the EDGE catalog.
The EDGE node is used for representing the next node pointed by the same flow and the attribute contained in each node, the HEAD node is used for representing the position of the process HEAD node of the next node connected with the corresponding flow in the EDGE directory, and the CURRENT directory is used for representing the position of the CURRENT flow.
Step S5: and sending the generated control flow chart information model to the client.
Preferably, the EDGE node includes a condition node, an end node and a next node; the context node is used to represent the weight, the end node is used to represent the end point of the connection, and the next node is used to represent the next element of the static linked list.
In any of the above schemes, preferably, the attribute included in each node includes a process control name and primitive information corresponding to the node.
The invention also discloses a PLC control flow generation system based on the OPCUA, which comprises: the device comprises an information acquisition module, a control flow chart module, a storage module, a control flow chart information model module and an information sending module.
The information acquisition module is used for acquiring the state information of the production equipment through the PLC.
And the control flow chart module is used for generating a control flow chart according to the acquired state information of the production equipment.
The storage module is used for storing the control flow chart in a static linked list form.
The static linked list comprises a head array, a side information array and a plurality of array indexes; the head array comprises a plurality of process head nodes, and when the process head nodes have connected edges, each process head node with the connected edges respectively corresponds to one array index; the side information array comprises a plurality of side information, and each side information corresponds to each array index; each edge information includes a connected edge, a weight, and a next edge.
The control flow chart information model module is used for generating a control flow chart information model according to the static linked list, and specifically comprises the following steps:
and generating an SCC directory under the DA directory of the PLC information model.
The HEAD directory, EDGE directory and CURRENT directory are generated under the SCC directory.
And generating a plurality of HEAD nodes under the HEAD catalog and a plurality of EDGE nodes under the EDGE catalog.
EDGE nodes are used to represent the next node to point to the same flow and the attributes each node contains,
the HEAD node is used for representing the position of the process HEAD node of the next node connected with the corresponding process in the EDGE directory, and the CURRENT directory is used for representing the position of the CURRENT process.
And the information sending module is used for sending the generated control flow chart information model to the client.
Preferably, the EDGE node includes a condition node, an end node and a next node; the condtiion node is used to represent the weight, the end node is used to represent the end point of the connection, and the next node is used to represent the next element of the static linked list.
In any of the above schemes, preferably, the attribute included in each node specifically includes a process control name and primitive information corresponding to the node.
Compared with the prior art, the invention has the advantages and beneficial effects that:
1. the interface repeated development of the display side of the HMI (human-computer interface) is avoided; more labor cost is saved; HMI (human-computer interface) display side information is directly obtained from a lower computer and does not need to be copied independently.
2. Based on the OPCUA, the static linked list is adopted to store the sequence control chart, and each node stores but is not limited to the process name and the process related graphic element, so that the attribute content can be increased according to the requirement, and the applicability is wide.
3. The problems that the nesting layer number between nodes is too deep due to the self-contained node reference relation of the OPC UA and the multi-connection relation is not visual in representation are solved; the data information processing efficiency is high, the analysis of the client is convenient, and a dynamic control flow chart can be generated in real time.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a flowchart of steps of a PLC control flow generation method based on opuua according to an embodiment of the present invention.
Fig. 2 is a structural diagram of a PLC control flow generation system based on opua according to an embodiment of the present invention.
Fig. 3 is a control flow chart generated according to the state information of the production equipment in a PLC control flow generation method based on opua according to an embodiment of the present invention.
Fig. 4 is a static linked list form diagram in a PLC control flow generation method based on the opuca according to an embodiment of the present invention.
Fig. 5a and 5b are control flow chart information model diagrams in a PLC control flow generation method based on opuua according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
As shown in fig. 1, a method for generating a PLC control flow based on the OPCUA according to a preferred embodiment of the present invention includes:
step S1: and acquiring the state information of the production equipment through the PLC.
Step S2: and generating a control flow chart according to the acquired state information of the production equipment.
And step S3: and storing the control flow chart in a static linked list form.
The static linked list comprises a head array, a side information array and a plurality of array indexes; the head array comprises a plurality of process head nodes, and when the process head nodes have connected edges, each process head node with the connected edges respectively corresponds to one array index; the side information array comprises a plurality of side information, and each side information corresponds to each array index; each edge information includes a connected edge, a weight, and a next edge.
And step S4: and generating a control flow chart information model according to the static linked list.
Generating the control flow graph information model according to the static linked list comprises:
step S41: and generating an SCC directory under the DA directory of the PLC information model.
Step S42: and generating a HEAD directory, an EDGE directory and a CURRENT directory under the SCC directory.
Step S43: and generating a plurality of HEAD nodes under the HEAD catalog and a plurality of EDGE nodes under the EDGE catalog.
The EDGE node is used for representing the next node pointed by the same flow and the attribute contained in each node, the HEAD node is used for representing the position of the process HEAD node of the next node connected with the corresponding flow in the EDGE directory, and the CURRENT directory is used for representing the position of the CURRENT flow.
Step S5: and sending the generated control flow chart information model to the client.
Further, the EDGE node comprises a condition node, an end node and a next node; the condtiion node is used to represent the weight, the end node is used to represent the end point of the connection, and the next node is used to represent the next element of the static linked list.
Furthermore, the attribute contained in each node includes a process control name and primitive information corresponding to the node.
OPC UA (unified architecture) provides a set of safe and reliable cross-platform architecture for device communication, so that interconnection among different devices, platforms and embedded devices is possible; in order to eliminate the repeated development work of different use environments of different sites, the PLC control flow generation method based on the OPCUA abstracts the control logic of the lower-layer monitoring equipment into an information model, sends the information model to the upper computer client through the OPC UA, and the upper computer client analyzes the control flow information model to realize the front-end display of the dynamically generated control flow.
The invention abstracts the PLC control flow chart into a directed weighted graph, the process control is directional, and the weight is used for storing the condition judgment relationship; as shown in fig. 3, the control flow chart includes process 1, process 2, process 3, process 4, process 5, process 6, process 7, and process 8; the process 1 is that the lower-layer equipment starts a starting action, for example, a starting action is started, the process 2 is that the lower-layer equipment executes a second step of action, a constant condition 1 is set between the process 1 and the process 2, the process 1 is constantly satisfied and executes the process 2, the process 3 is that the equipment executes a third step of action, a constant condition 2 is set between the process 2 and the process 3, the process 2 is constantly satisfied and executes the process 3, the process 4, the process 5 and the process 6 are that the equipment executes a fourth step of different actions, the process 4 is that the equipment executes a step of the fourth step, the process 5 is that the equipment executes a step of the fourth step, and the process 6 is that the equipment executes a step of the fourth step, wherein the action a, the action B and the action C are mutually independent equipment executing actions and do not interfere with each other; setting a condition 5 between the process 3 and the process 4, and when the condition 5 is satisfied, executing from the process 3 to the process 4; a condition 6 is set between the process 3 and the process 5, and when the condition 6 is satisfied, the process 3 is executed to the process 5; setting a condition 7 between the process 3 and the process 6, and when the condition 7 is satisfied, executing the process 3 to the process 6; the process 7 is that the equipment executes a fifth step of action, a constant establishment condition 3 is set between the process 4 and the process 7, the process 4 is constantly established to execute the process 7, the process 8 is a sixth step of action executed by the equipment, a constant establishment condition 4 is set between the process 7 and the process 8, and the process 7 is constantly established to execute the process 8; in the above-described constant satisfaction condition 1, constant satisfaction condition 2, constant satisfaction condition 3, constant satisfaction condition 4, condition 5, condition 6, and condition 7, the conditions may be changed as needed.
The static linked list comprises a head array, a side information array and a plurality of array indexes; the head array comprises a plurality of process head nodes, and when the process head nodes have connected edges, each process head node with the connected edges respectively corresponds to one array index; the side information array comprises a plurality of side information, and each side information corresponds to each array index; each piece of side information comprises a connected side, a weight and a next side; as shown in the control flow chart of fig. 3, storing the control flow chart information of fig. 3 in a form of a static linked list is shown in fig. 4, a process head node corresponds to the number of processes in the control flow chart, and the length of a side information array is theoretically 2 times of the number of processes; the head array comprises a process 1 head node, a process 2 head node, a process 3 head node, a process 4 head node, a process 5 head node, a process 6 head node, a process 7 head node and a process 8 head node, wherein:
process 1 in the control flow diagram corresponds to the process 1 head node in the static linked list.
Process 2 in the control flow diagram corresponds to the process 2 head node in the static linked list.
Process 3 in the control flow diagram corresponds to the process 3 head node in the static linked list.
Process 4 in the control flow diagram corresponds to the process 4 head node in the static linked list.
Process 5 in the control flow diagram corresponds to the process 5 head node in the static linked list.
Process 6 in the control flow diagram corresponds to the process 6 head node in the static linked list.
Process 7 in the control flow diagram corresponds to the process 7 head node in the static linked list.
Process 8 in the control flow diagram corresponds to the process 8 head node in the static linked list.
The side information array comprises first side information, second side information, third side information, fourth side information, fifth side information, sixth side information, seventh side information and eighth side information; null is indicated by "-1", where:
first side information: the connected edge storage information is: in the process 2, the weight storage information is as follows: the condition 1 is always true, and the next edge stores information of-1.
Second side information: the connected edge storage information is: and 3, storing the weight value as follows: if the condition 2 is satisfied, the next edge stores information: -1.
Third side information: the connected edge storage information is: and 6, storing the weight value as follows: condition 7, the next edge storage information is: -1.
Fourth side information: the connected edge storage information is: and 5, the weight storage information is as follows: and in the condition 6, the next edge storage information is array index 2.
And fifth side information: the connected edge storage information is: and 4, the weight storage information is as follows: condition 5, the next edge stores information: array index 3.
Sixth-side information: the connected edge storage information is: in the process 7, the weight storage information is: if the condition 3 is satisfied, the next piece of edge storage information is: -1.
Seventh side information: the connected edge storage information is: in the process 8, the weight storage information is: if the condition 4 is satisfied, the next edge stores information: -1.
Eighth side information: the connected edge storage information is: -1, the weight storage information is: -1, the next edge storing information as: -1; when the storage information of the connected edge is '-1', the process is null; when the weight storage information is '-1', the constant condition is satisfied or the condition is null; when the next edge stores information of "-1", it means that the next connection of the head node is empty, i.e. there is no other connection.
The process 1 head node corresponds to the array index 0, the process 2 head node corresponds to the array index 1, the process 3 head node corresponds to the array index 4, the process 4 head node corresponds to the array index 5, the process 5 head node is "-1", the process 6 head node is "-1", the process 7 head node corresponds to the array index 6, and the process 8 head node is "-1"; the array index 0 corresponds to the first side information, the array index 1 corresponds to the second side information, the array index 2 corresponds to the third side information, the array index 3 corresponds to the fourth side information, the array index 4 corresponds to the fifth side information, the array index 5 corresponds to the sixth side information, the array index 6 corresponds to the seventh side information, the array index 7 corresponds to the eighth side information, wherein the head node of the process 5 is "-1", which indicates that the process 5 is the final execution process, and no next execution process exists after the process 5; the head section of the process 6 is "-1", which means that the process 6 is the final execution process, and no next execution process exists after the process 6; the process 8 header node is "-1" indicating that process 8 is the final execution and that no further execution follows process 8.
As shown in fig. 3 and 4, the head node of the process 1 corresponds to the array index 0, the array index 0 corresponds to the first edge information, and it can be known from looking up the array index 0 that the edge connected in the first edge information is the process 2, the head node of the process 1 is connected with the process 2, the weight in the first edge information is the constant condition 1, the execution condition is the constant condition 1, and the process 1 is the constant condition 2; the next edge in the first edge information is null, that is, the process 1 executes the next step without other connection relations except for the connection with the process 2; the first node of the process 2 corresponds to the array index 1, the array index 1 corresponds to the second side information, the array index 1 is checked to know that the side connected in the second side information is the process 3, the first node of the process 2 is connected with the process 3, the weight in the second side information is a constant satisfaction condition 2, the execution condition is a constant satisfaction condition 2, and the process 2 is a constant satisfaction execution process 3; the next edge in the second edge information is null, that is, the process 2 is executed next step and has no connection relation except the connection with the process 3; the first node of the process 3 corresponds to the array index 4, the array index 4 corresponds to the fifth side information, the array index 4 is checked to know, the side connected in the fifth side information is the process 4, the first node of the process 3 is connected with the process 4, the weight in the fifth side information is a condition 5, and when the condition 5 is met, the process 4 is executed next in the process 3; the next edge in the fifth edge information is an array index 3, the array index 3 corresponds to the fourth edge information, the edge connected in the fourth edge information is a process 5, namely, a process 3 head node is connected with the process 4, the process 3 head node is also connected with the process 5, the edge connected in the fourth edge information is a condition 6, when the condition 6 is met, the process 3 executes the process 5 next, the next edge in the fourth edge information is an array index 2, the array index 2 corresponds to the third edge information, the edge connected in the third edge information is a process 6, namely, the process 3 head node is connected with the process 4 and the process 5, the process 3 head node is also connected with the process 6, the weight in the third edge information is a condition 7, when the condition 7 is met, the process 3 executes the process 6 next, the next edge in the third edge information is an empty value, namely, the process 3 executes the next step, and no other connection is left except the connection with the process 4, the process 5 and the process 6; the first node of the process 4 corresponds to the array index 5, the array index 5 corresponds to the sixth information, the array index 5 is checked, the edge connected in the sixth information is a process 7, the first node of the process 4 is connected with the process 7, the weight in the sixth information is a constant satisfied condition 3, the execution condition is a constant satisfied condition 3, and the next constant satisfied execution process 7 of the process 4 is performed; the next edge in the sixth edge information is null, that is, the process 4 is executed next step, and no connection relation exists except for the connection with the process 7; procedure 5 head nodes are: 1, namely, the head node of the process 5 is a null value, the process 5 is an execution end point, and no next step is executed; the process 6 head nodes are: 1, namely, the head node of the process 6 is a null value, the process 6 is an execution end point, and no next execution is carried out; the process 7 head node corresponds to the array index 6, the array index 6 corresponds to the seventh side information, the array index 6 is checked to know, the side connected in the seventh side information is a process 8, the process 7 head node is connected with the process 8, the weight in the seventh side information is a constant satisfaction condition 4, the execution condition is a constant satisfaction condition 4, and the process 7 is a constant satisfaction execution process 8; the next edge in the seventh edge information is null, that is, the process 7 performs the next step and has no connection relation except the connection with the process 8; the process 8 head node is: 1, namely, the head node of the process 8 is a null value, the process 8 is an execution end point, and no next step is executed; the control flow chart is stored in a form of a static linked list, where it should be noted that the information corresponding to the connected edges in the edge information, the information corresponding to the weight, and the information corresponding to the next edge may be correspondingly changed according to the change of the flow in the control flow chart.
Generating a control flow graph information model according to a static linked list comprises:
step S41: and generating an SCC directory under the DA directory of the PLC information model.
Step S42: and generating a HEAD directory, an EDGE directory and a CURRENT directory under the SCC directory.
Step S43: and generating a plurality of HEAD nodes under the HEAD catalogue and generating a plurality of EDGE nodes under the EDGE catalogue.
The PLC information model is a model generated in the OPCUA, the DA directory is an analog output directory, the SCC directory contains control flow chart information model information, the HEAD directory represents a HEAD array directory, the EDGE side information array directory and the CURRENT directory represents a CURRENT directory.
As shown in fig. 5b, the EDGE node is used to represent the next node pointed by the same flow and the attribute contained in each node, and the EDGE node includes a condition node, an end node, and a next node; the contntion node is used for representing information in a weight value in the static linked list, the end node is used for representing the connected end point, namely the information of the connected edge in the static linked list, and the next node is used for representing the next element of the static linked list, namely the information of the next edge in the static linked list.
As shown in fig. 5a, according to the control flow chart information model generated by the static linked list in fig. 4, the HEAD node is used to indicate the position of the process HEAD node of the next node connected to the corresponding flow in the EDGE directory, and the CURRENT directory is used to indicate the position of the CURRENT flow.
A value of 0 is displayed under the Current directory to indicate that the CURRENT execution is a HEAD [0] node.
A value of 10 is shown under the CURRENT directory to indicate that the CURRENT execution is a HEAD [10] node.
A display value of 11 under the Current directory indicates that the CURRENT execution is the HEAD [11] node.
A value of 12 is displayed under the Current directory to indicate that the CURRENT execution is a HEAD [12] node.
A value of 13 is displayed under the Current directory to indicate that the currently executing HEAD [13] node.
A display value of 14 under the Current directory indicates that the currently executing HEAD [14] node.
A display value of 15 under the Current directory indicates that the currently executing HEAD [15] node.
A value of 16 is displayed under the Current directory to indicate that the CURRENT execution is a HEAD [16] node.
HEAD [0] node under HEAD directory represents the process HEAD node 1 in static linked list and corresponds to EDGE [0 ].
HEAD [10] node under the HEAD directory represents the process HEAD node 2 in the static linked list and corresponds to EDGE [10 ].
HEAD [11] node under HEAD directory represents process HEAD node 3 in static linked list and corresponds to EDGE [11 ].
HEAD [12] node under HEAD directory represents the process HEAD node 4 in static linked list and corresponds to EDGE [12 ].
The HEAD [13] node under the HEAD catalog represents the process HEAD node 5 in the static linked list and corresponds to EDGE [13 ].
The HEAD node 6 of the process in the static linked list is represented by the HEAD [14] node under the HEAD directory and corresponds to the EDGE [14 ].
HEAD node 7 in static linked list is represented by HEAD [15] node under HEAD directory, and is corresponding to EDGE [15 ].
The HEAD node 8 of the process in the static linked list is represented by the HEAD node 16 under the HEAD directory and corresponds to the EDGE 16.
EDGE [0] node under EDGE directory represents array index 0 in static linked list, and corresponds to first EDGE information.
EDGE [10] node under EDGE catalogue represents array index 1 in the static linked list, and correspond to the second side information.
And the EDGE [11] node under the EDGE directory represents the group index 2 in the static linked list and corresponds to the third EDGE information.
EDGE [12] node under EDGE directory represents array index 3 in static linked list, and corresponds to fourth EDGE information.
EDGE [13] node under EDGE catalog represents array index 4 in static linked list, and corresponds to fifth side information.
The EDGE [14] node under the EDGE catalog represents an array index 5 in the static linked list and corresponds to the sixth side information.
And the EDGE [15] node under the EDGE directory represents the array index 6 in the static linked list and corresponds to the seventh side information.
The EDGE [16] node under the EDGE catalog represents the array index 7 in the static linked list and corresponds to the eighth EDGE information.
The condition node in the EDGE [0] node represents the weight information in the first EDGE information, namely, the condition 1 is constantly satisfied.
The condition node in the EDGE [10] node represents the weight information in the second side information, namely, the condition 2 is always satisfied.
The condition node in the EDGE [11] node represents the weight information in the third EDGE information, i.e., condition 7.
The condition node in EDGE [12] node represents the weight information in the fourth EDGE information, namely condition 6.
The condition node in the EDGE [13] node represents the weight information in the fifth side information, i.e. condition 5.
The condition node in the EDGE [14] node represents the weight information in the sixth side information, namely, the condition 3 is constantly satisfied.
The condition node in EDGE [15] node represents the weight information in the seventh side information, namely, the condition 4 is always satisfied.
The condition node in the EDGE [16] node represents the weight information in the eighth side information, namely "-1".
The end node in the EDGE [0] node represents the connected side information in the first side information, i.e., procedure 2.
The end node in the EDGE [10] node represents the connected side information in the second side information, i.e., procedure 3.
The end node in the EDGE [11] node represents the connected side information in the third side information, i.e., process 6.
The end node in the EDGE [12] node represents the connected side information in the fourth side information, i.e., procedure 5.
The end node in the EDGE [13] node represents the connected side information in the fifth side information, i.e., process 4.
The end node in the EDGE [14] node represents the connected side information in the sixth side information, i.e., procedure 7.
The end node in the EDGE [15] node represents the connected side information in the seventh side information, i.e., procedure 8.
The end node in the EDGE [16] node represents the concatenated side information in the eighth side information, i.e., -1".
The next node in the EDGE [0] node represents the next piece of side information in the first side information, i.e., -1".
The next node in the EDGE [10] node represents the next EDGE information in the second EDGE information, i.e., -1".
The next node in the EDGE [11] nodes represents the next EDGE information in the third EDGE information, i.e., -1".
The next node in the EDGE [12] node represents the next EDGE information in the fourth EDGE information, i.e., "EDGE [11 ].
The next node in the EDGE [13] node represents the next EDGE information in the fifth EDGE information, i.e., "EDGE [12 ].
The next node in the EDGE [14] node represents the next EDGE information in the sixth EDGE information, i.e., -1".
The next node in the EDGE [15] node represents the next EDGE information in the seventh EDGE information, i.e., -1".
The next node in the EDGE [16] node represents the next piece of side information in the eighth side information, i.e., -1".
The control flow chart information model is generated according to the static linked list, and the control flow chart model can be changed according to needs, such as adding child nodes under each directory and setting more attribute information; in this way, the control flow chart information model is generated according to the static linked list, the generated control flow chart information model is sent to the client, and the client analyzes the control flow chart information model and generates a flow chart on the client for the front end to check and monitor.
As shown in fig. 2, a PLC control flow generation system 10 based on OPCUA as another embodiment of the present invention includes: an information acquisition module 20, a control flow chart module 30, a storage module 40, a control flow chart information model module 20, and an information transmission module 30.
The information acquisition module is used for acquiring the state information of the production equipment through the PLC.
And the control flow chart module is used for generating a control flow chart according to the acquired state information of the production equipment.
The storage module is used for storing the control flow chart in a static linked list form.
The static linked list comprises a head array, a side information array and a plurality of array indexes; the head array comprises a plurality of process head nodes, and when the process head nodes have connected edges, each process head node with the connected edges respectively corresponds to one array index; the side information array comprises a plurality of side information, and each side information corresponds to each array index; each edge information includes a connected edge, a weight, and a next edge.
And the control flow chart information model module is used for generating a control flow chart information model according to the static linked list.
And the information sending module is used for sending the generated control flow chart information model to the client.
The step of generating the control flow chart information model by the control flow chart information model module according to the static linked list comprises the following steps:
and generating an SCC directory under the DA directory of the PLC information model.
The HEAD directory, EDGE directory and CURRENT directory are generated under the SCC directory.
Generating a plurality of HEAD nodes under the HEAD catalog and a plurality of EDGE nodes under the EDGE catalog;
wherein the PLC information model is a model generated in OPCUA; the EDGE node is used for representing the next node pointed by the same flow and the attribute contained by each node, the HEAD node is used for representing the position of the process HEAD node of the next node connected with the corresponding flow in the EDGE directory, and the CURRENT directory is used for representing the position of the CURRENT flow.
Further, the EDGE node comprises a condition node, an end node and a next node; the condtiion node is used to represent the weight, the end node is used to represent the end point of the connection, and the next node is used to represent the next element of the static linked list.
Furthermore, the attribute contained in each node specifically includes the process control name and the primitive information corresponding to the node, and the node attribute can also be changed as required.
The PLC control flow generation method and system based on the OPCUA in the embodiment of the invention have the following beneficial effects:
1. the interface redevelopment of the HMI display side is avoided; HMI display side information is directly obtained from a lower computer, and is not required to be copied independently, so that the transmission efficiency is high.
2. The problems that the number of nested layers between nodes is too deep due to the fact that the node reference relationship of OPC UA is used, and the multi-connection relationship is not visual in representation are solved, maintenance is convenient, a static linked list is used for storing a sequence control chart, and the process name and the process related graphic element are stored in each node but not limited, and can be changed according to the content and the requirement of the process, so that the working efficiency is greatly improved.
In the description of the specification, reference to the description of "one embodiment," "some embodiments," "an example," "a specific example," or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
It will be understood by those skilled in the art that the present invention includes any combination of the summary and detailed description of the invention described above and those illustrated in the accompanying drawings, which is not intended to be limited to the details and which, for the sake of brevity of this description, does not describe every aspect which may be formed by such combination. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made in the above embodiments by those of ordinary skill in the art without departing from the principle and spirit of the present invention. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (6)

1. A PLC control flow generation method based on OPCUA is characterized by comprising the following steps:
step S1: acquiring state information of production equipment through a PLC (programmable logic controller);
step S2: generating a control flow chart according to the acquired state information of the production equipment;
and step S3: storing the control flow chart in a static linked list form;
the static linked list comprises a head array, a side information array and a plurality of array indexes; the head array comprises a plurality of process head nodes, and when the process head nodes have connected edges, each process head node with the connected edges respectively corresponds to one array index; the side information array comprises a plurality of side information, and each side information corresponds to each array index; each piece of side information comprises a connected side, a weight and a next side;
and step S4: generating a control flow chart information model according to the static linked list;
generating a control flow graph information model according to the static linked list comprises:
step S41: generating an SCC directory under the DA directory of the PLC information model;
step S42: generating a HEAD directory, an EDGE directory and a CURRENT directory under the SCC directory;
step S43: generating a plurality of HEAD nodes under the HEAD catalog and a plurality of EDGE nodes under the EDGE catalog;
the EDGE node is used for representing the next node pointed by the same process and the attribute contained in each node, the HEAD node is used for representing the position of the process HEAD node of the next node connected with the corresponding process in the EDGE directory, and the CURRENT directory is used for representing the position of the CURRENT process;
step S5: and sending the generated control flow chart information model to a client.
2. The method as claimed in claim 1, wherein the EDGE node comprises a condition node, an end node and a next node; the contntiion node is used for representing the weight, the end node is used for representing the end point of the connection, and the next node is used for representing the next element of the static linked list.
3. The method as claimed in claim 1, wherein the attribute included in each node includes a process control name and primitive information corresponding to the node.
4. A PLC control flow generation system based on OPCUA is characterized by comprising: the device comprises an information acquisition module, a control flow diagram module, a storage module, a control flow diagram information model module and an information sending module;
the information acquisition module is used for acquiring the state information of the production equipment through the PLC;
the control flow chart module is used for generating a control flow chart according to the acquired state information of the production equipment;
the storage module is used for storing the control flow chart into a static linked list form;
the static linked list comprises a head array, a side information array and a plurality of array indexes; the head array comprises a plurality of process head nodes, and when the process head nodes have connected edges, each process head node with the connected edges respectively corresponds to one array index; the side information array comprises a plurality of side information, and each side information corresponds to each array index; each piece of side information comprises a connected side, a weight and a next side;
the control flow chart information model module is used for generating a control flow chart information model according to the static linked list, and specifically comprises the following steps:
generating an SCC directory under the DA directory of the PLC information model;
generating a HEAD directory, an EDGE directory and a CURRENT directory under the SCC directory;
generating a plurality of HEAD nodes under the HEAD catalog and a plurality of EDGE nodes under the EDGE catalog;
the EDGE node is used for representing the next node pointed by the same process and the attribute contained in each node, the HEAD node is used for representing the position of the process HEAD node of the next node connected with the corresponding process in the EDGE directory, and the CURRENT directory is used for representing the position of the CURRENT process;
and the information sending module is used for sending the generated control flow chart information model to a client.
5. The OPCUA-based PLC control flow generation system of claim 4, wherein the EDGE node comprises a condition node, an end node and a next node; the contntiion node is used for representing the weight, the end node is used for representing the end point of the connection, and the next node is used for representing the next element of the static linked list.
6. The OPCUA-based PLC control flow generation system of claim 4, wherein the attributes contained by each node specifically comprise the flow control name and primitive information corresponding to the node.
CN202111577820.3A 2021-12-22 2021-12-22 PLC control flow generation method and system based on OPCUA Active CN114254923B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111577820.3A CN114254923B (en) 2021-12-22 2021-12-22 PLC control flow generation method and system based on OPCUA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111577820.3A CN114254923B (en) 2021-12-22 2021-12-22 PLC control flow generation method and system based on OPCUA

Publications (2)

Publication Number Publication Date
CN114254923A CN114254923A (en) 2022-03-29
CN114254923B true CN114254923B (en) 2023-01-17

Family

ID=80796620

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111577820.3A Active CN114254923B (en) 2021-12-22 2021-12-22 PLC control flow generation method and system based on OPCUA

Country Status (1)

Country Link
CN (1) CN114254923B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831167B (en) * 2012-07-24 2015-01-07 东软集团股份有限公司 XML (extensive makeup language) processing method and device for graph structure
KR102110259B1 (en) * 2018-11-13 2020-05-15 ㈜유엔이 Method and system for creating related SStandard Operating Procedure
CN113179656B (en) * 2019-11-26 2024-08-16 株式会社Tmeic SCADA webpage HMI system
CN112612751B (en) * 2020-12-25 2024-08-13 北京浪潮数据技术有限公司 Asynchronous directory operation method, device, equipment and system
CN113183759A (en) * 2021-07-01 2021-07-30 智道网联科技(北京)有限公司 Method and device for displaying characters of instrument panel

Also Published As

Publication number Publication date
CN114254923A (en) 2022-03-29

Similar Documents

Publication Publication Date Title
US8321806B2 (en) Visualization of process control data
US7099958B2 (en) System for designing and performing web application
Jeong et al. AVIoT: Web-based interactive authoring and visualization of indoor internet of things
EP2084593B1 (en) Data quality and status behavior for human machine interface graphics in industrial control and automation systems
US20040017392A1 (en) Web service control for use in a graphical programming environment
CN108089857A (en) A kind of industry web monitors the generation method of the page in real time
CN103631578B (en) Method for exhibiting data in a kind of distribution automation system
US20170192776A1 (en) Service interface creation and modification for object-oriented services
CN103268226A (en) Test script file generation method and device
Nwiabu et al. User interface design for situation-aware decision support systems
CN108628729A (en) A kind of method for testing software and software test client
Pierro Smart-graph: Graphical representations for smart contract on the ethereum blockchain
CN114254923B (en) PLC control flow generation method and system based on OPCUA
JP5508078B2 (en) Program creation support apparatus and method, and program
CN114726739A (en) Topological data processing method, device, equipment and storage medium
US20140358604A1 (en) Three-dimensional representation of software usage
Pramudianto et al. Connecting the Internet of Things rapidly through a model driven approach
CN112292659B (en) Code for programming a device from a controlling computer by invoking a development tool from a semantic zoom enhancement user interface
WO2014036073A2 (en) Method and apparatus for browsing large data network topology trees
CN112764637B (en) Intelligent agriculture Internet of things equipment description file generation method
US8752010B1 (en) Dynamic interface synthesizer
CN107766306B (en) Data display method and equipment
CN113343409A (en) Visual configuration method and device based on virtual equipment
CN107615199B (en) System Design assistant device, method and program
CN114546464B (en) Visual data cleaning script cleaning process analysis system

Legal Events

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