CN114254923A - PLC control flow generation method and system based on OPCUA - Google Patents
PLC control flow generation method and system based on OPCUA Download PDFInfo
- Publication number
- CN114254923A CN114254923A CN202111577820.3A CN202111577820A CN114254923A CN 114254923 A CN114254923 A CN 114254923A CN 202111577820 A CN202111577820 A CN 202111577820A CN 114254923 A CN114254923 A CN 114254923A
- Authority
- CN
- China
- Prior art keywords
- node
- information
- control flow
- edge
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0633—Workflow analysis
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
- G05B19/054—Input/output
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Administration; Management
- G06Q10/10—Office automation; Time management
- G06Q10/103—Workflow 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; step S3: storing the control flow chart in a static linked list form; 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 of 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
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
An industrial field needs an HMI (human machine interface) for equipment monitoring and control to ensure the stability and high efficiency of the field production process; the realization of the HMI (human-computer interface) depends on the mutual 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 mutually independent and respectively complete own functions, 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 accurately uploaded to the screen, and the screen control instruction can be accurately 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.
Step S3: the control flow graph is stored 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.
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.
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 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 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.
And generating a HEAD directory, an EDGE directory and a CURRENT directory 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 which the same flow is directed 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 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 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 HMI (human-computer interface) display side is avoided; more labor cost is saved; HMI (human-machine 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 use of the self-contained node reference relation of OPC UA and the multi-connection relation representation is not visual are solved; the data information processing efficiency is high, the analysis of the client side 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 or similar reference numerals refer to the same or similar elements or elements having the same or similar function 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 PLC control flow generation method based on 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.
Step S3: the control flow graph is stored 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.
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 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.
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 equipment communication, so that interconnection among different equipment, platforms and embedded type 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 directed, and the condition judgment relationship is stored by using the weight; 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; setting a condition 6 between the process 3 and the process 5, and when the condition 6 is satisfied, executing from the process 3 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 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; a null value is denoted 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, the weight storage information is 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, the weight storage information is as follows: condition 7, the next edge stores information: -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 connected edge storage information 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 array index 3, array index 3 corresponds to the fourth edge information, the edge connected in the fourth edge information is process 5, that is, the process 3 head node is connected to the process 5 in addition to the process 4, the edge connected in the fourth edge information is the condition 6, when the condition 6 is satisfied, the process 3 next executes the process 5, the next edge in the fourth edge information is the array index 2, the array index 2 corresponds to the third edge information, the edge connected in the third edge information is the process 6, that is, the process 3 head node is connected to the process 6 in addition to the process 4 and the process 5, the weight value in the third side information is the condition 7, when condition 7 is satisfied, process 3 proceeds to process 6, where the next edge in the third edge information is null, that is, the process 3 performs next no further connections other than those to the processes 4, 5 and 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 step of the process 4 is a constant satisfied execution process 7; the next edge in the sixth edge information is null, that is, the process 4 is executed next step, and no other 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 step is executed; 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 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 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 CURRENT execution is a HEAD [13] node.
A value of 14 is displayed under the Current directory to indicate that the CURRENT execution is a HEAD [14] node.
A display value of 15 under the Current directory indicates that the CURRENT execution is the 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 process HEAD node 1 in static linked list and corresponds to EDGE [0 ].
HEAD node 2 of the process in the static linked list is represented by HEAD [10] node under the HEAD directory, 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 node 4 in static linked list is represented by HEAD 12 node under HEAD list, and is corresponding to EDGE 12.
The HEAD node 5 of the process in the static linked list is represented by the HEAD node 13 under the HEAD directory, and corresponds to the 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 side information, namely, the condition 1 is always 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 always 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., procedure 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 piece of side information in the second side information, i.e., -1 ".
The next node in the EDGE [11] node 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 piece of side information in the seventh side 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; 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 diagram module 30, a storage module 40, a control flow diagram 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 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 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.
And 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;
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 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.
Further, the EDGE node comprises 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.
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. interface redevelopment of an 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 use of a node reference relation of an OPC UA (optical proximity correction) UA (object-oriented architecture), and the representation of a multi-connection relation is not visual are solved, the maintenance is convenient, a sequential control chart is stored by adopting a static linked list, 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 chart, so that the working efficiency is greatly improved.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean 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;
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;
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 OPCUA-based PLC control flow generation method of claim 1, wherein the EDGE node includes a condition node, an end node, and a next node; the contntion node is used for representing the weight value, 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 OPCUA-based PLC control flow generation method of claim 1, wherein the attribute included in each node includes a flow 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 contntion node is used for representing the weight value, 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 PLC control flow generation system based on the OPCUA according to claim 4, wherein the attributes included in each node specifically include a flow control name and primitive information corresponding to the node.
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 true CN114254923A (en) | 2022-03-29 |
CN114254923B 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) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102831167A (en) * | 2012-07-24 | 2012-12-19 | 东软集团股份有限公司 | 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 |
CN112612751A (en) * | 2020-12-25 | 2021-04-06 | 北京浪潮数据技术有限公司 | Asynchronous directory operation method, device, equipment and system |
WO2021106082A1 (en) * | 2019-11-26 | 2021-06-03 | 東芝三菱電機産業システム株式会社 | Scada web hmi system |
CN113183759A (en) * | 2021-07-01 | 2021-07-30 | 智道网联科技(北京)有限公司 | Method and device for displaying characters of instrument panel |
-
2021
- 2021-12-22 CN CN202111577820.3A patent/CN114254923B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102831167A (en) * | 2012-07-24 | 2012-12-19 | 东软集团股份有限公司 | 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 |
WO2021106082A1 (en) * | 2019-11-26 | 2021-06-03 | 東芝三菱電機産業システム株式会社 | Scada web hmi system |
CN112612751A (en) * | 2020-12-25 | 2021-04-06 | 北京浪潮数据技术有限公司 | 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 |
---|---|
CN114254923B (en) | 2023-01-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8321806B2 (en) | Visualization of process control data | |
Meliá et al. | A model-driven development for GWT-based rich internet applications with OOH4RIA | |
Jeong et al. | AVIoT: Web-based interactive authoring and visualization of indoor internet of things | |
US7099958B2 (en) | System for designing and performing web application | |
US20040017392A1 (en) | Web service control for use in a graphical programming environment | |
Pramudianto et al. | Iot link: An internet of things prototyping toolkit | |
CN103631578B (en) | Method for exhibiting data in a kind of distribution automation system | |
JP2006504156A (en) | Component model for real-time system control | |
US6697879B1 (en) | Computer implemented virtual sensor object and tangible medium utilizing same | |
Holten et al. | Trace visualization using hierarchical edge bundles and massive sequence views | |
US9639331B2 (en) | Service interface creation and modification for object-oriented services | |
CN115189997A (en) | Cloud robot real-time monitoring and control method based on cloud, fog and edge cooperation | |
US11016735B2 (en) | Extensible meta model for capturing solution patterns | |
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 | |
CN114254923B (en) | PLC control flow generation method and system based on OPCUA | |
JP5508078B2 (en) | Program creation support apparatus and method, and program | |
US20140358604A1 (en) | Three-dimensional representation of software usage | |
CN114726739A (en) | Topological data processing method, device, equipment and storage medium | |
Pramudianto et al. | Connecting the Internet of Things rapidly through a model driven approach | |
EP2395468A1 (en) | Semantic user interface data assembling | |
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 | |
CN113343409A (en) | Visual configuration method and device based on virtual equipment |
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 |