OPC UA Server, System Processing Using OPC UA, and How to Run an OPC UA System
The OPC UA server with an embedded interpreter addresses the challenges of modifying traditional OPC UA systems by enabling execution of configuration files without recompilation, facilitating easier and cost-effective modifications.
Patent Information
- Application Number
- JP2021001644
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-02-13
- Filing Date
- 2021-01-07
- Publication Date
- 2025-04-30
- Estimated Expiration
- 2041-01-07
AI Technical Summary
Traditional OPC UA systems require users to access and modify all source code and recompile the program to make changes, which is challenging due to potential lack of source code ownership and the need for specialized skills.
An OPC UA server with embedded interpreter allows configuration files written in compiled programming languages to be executed without recompilation, enabling users to modify and add features to the OPC UA server program more easily.
This approach allows for flexible modification and execution of OPC UA server operations without the need for compiling configuration files, reducing the time and cost associated with program modifications.
Smart Images

Figure 0007669696000001 
Figure 0007669696000002 
Figure 0007669696000003
Abstract
Description
[Background technology]
[0001] OPC (Open Platform Communications) UA (Unified Architecture) is a platform-independent, service-centric architecture that provides the foundation necessary for interoperability across the enterprise, including machine-to-machine, machine-to-enterprise, and everything else in between.
[0002] Typically, an OPC UA system includes an OPC UA client and an OPC UA server. The OPC UA server executes an OPC UA server application program based on a request message from the OPC UA client. In a conventional OPC UA system, the OPC UA server application program is provided by a vendor and written in a compiled programming language, such as C++. The compiled programming language uses a compiler, which is a program that converts source code into machine code. Once the compilation process by the compiler is complete, the converted program can be executed without needing the original source code. If the OPC UA server program is changed, all source code must be edited and the compilation process must be rerun to create new machine code.
[0003] A program written in a compiled programming language cannot be modified without access to all of the source code and without the ability to recompile the program. However, a user of an OPC UA server may not have all of the source code of the OPC UA server program. Furthermore, modifying the source code requires a highly specialized skill set. Therefore, even if a user wants to make changes or add new features to an OPC UA server program, the user may not be able to easily modify the OPC UA server program and may need to ask a specialized programmer or vendor to obtain a new server compiled or built. As a result, the user may spend a great deal of time and money modifying the OPC UA server program. Summary of the Invention
[0004] An OPC UA server according to one or more embodiments includes a storage for storing a configuration file written in a compiled programming language and having an embedded interpreter, a transceiver for receiving execution requests from an OPC UA client to perform operations defined in the configuration file, and a processor for executing the operations using the interpreter.
[0005] According to one or more embodiments, a system for processing using OPC UA includes an OPC UA server that stores a configuration file written in a compiled programming language and having an embedded interpreter, and an OPC UA client that sends an execution request to the OPC UA server to execute an operation defined in the configuration file, and upon receiving the execution request, the OPC UA server executes the operation using the interpreter.
[0006] A method of executing an OPC UA system according to one or more embodiments includes storing, by an OPC UA server, a configuration file written in a compiled programming language and having an embedded interpreter; sending, by an OPC UA client, an execution request to the OPC UA server to perform an operation defined in the OPC UA configuration file; receiving, by the OPC UA server, the execution request; and, upon receiving the execution request, executing, by the OPC UA server, the operation using the interpreter.
[0007] In accordance with one or more embodiments, configuration files written in compiled programming languages used in OPC UA systems can be more easily modified and OPC UA programs can be run without compiling the configuration files. [Brief description of the drawings]
[0008] [Figure 1] FIG. 1 illustrates an OPC UA system according to one or more embodiments. [Diagram 2] FIG. 2 is a hardware schematic diagram of an OPC UA client according to one or more embodiments. [Diagram 3] FIG. 1 is a hardware schematic diagram of an OPC UA server according to one or more embodiments. [Figure 4] FIG. 1 is a schematic diagram of an OPC UA server architecture according to one or more embodiments. [Diagram 5] 1 is a flowchart for configuring operations on an OPC UA server according to one or more embodiments. [Figure 6] 1 is an example of a configuration file according to one or more embodiments. [Figure 7] 1 is an example of an OPC UA node created in the address space of an OPC UA server according to one or more embodiments. [Figure 8] 1 is an example of a configuration file according to one or more embodiments. [Figure 9]1 is an example of an OPC UA node created in the address space of an OPC UA server according to one or more embodiments. [Figure 10] 1 is an example of a configuration file according to one or more embodiments. [Figure 11] 1 is a flowchart illustrating an operation on an OPC UA server according to one or more embodiments. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will now be described in detail with reference to the drawings, in which like elements in different drawings are designated with like reference numerals for consistency.
[0010] In order to provide a more complete understanding of the invention, numerous specific details are set forth in the following description of the embodiments of the invention. However, it will be apparent to those skilled in the art that the invention can be practiced without these specific details. In other instances, well-known configurations are not described in detail to avoid obscuring the invention.
[0011] 1 illustrates an OPC UA system 1 according to one or more embodiments. The OPC UA system 1 includes an OPC UA client 110 and an OPC UA server 120. The OPC UA client 110 is connected to the OPC UA server 120 via an OPC UA network. The OPC UA system 1 may include multiple OPC UA clients 110 and OPC UA servers 120.
[0012] OPC UA client 110 is a client computer in OPC UA system 1. OPC UA client 110 has a software application that sends messages to OPC UA server 120. A message may be a unit of data communicated between OPC UA client 110 and OPC UA server 120 indicating a given service request or response. OPC UA client 110 is used to define one or more operations to be executed by OPC UA server 120. Each user-defined operation has a name.
[0013] The OPC UA server 120 is a server endpoint for client / server interactions. The OPC UA server 120 comprises a software application that executes and exposes certain services. The OPC UA server 120 comprises one or more operations that are executed based on requests from the OPC UA client 110.
[0014] An OPC UA client 110 may have the functionality of an OPC UA server 120, and vice versa.
[0015] Next, the hardware configuration of the OPC UA client 110 and the OPC UA server 120 will be described.
[0016] FIG. 2 is a schematic diagram of hardware of an OPC UA client 110 according to one or more embodiments. As shown in FIG. 2, the OPC UA client 110 includes at least one processor (e.g., a central processing unit (CPU)) 111, a memory 112 in communication with the processor 111, a storage 113, a network interface 114, and a display 115. The processor 111 executes programs stored in the memory 112. The storage 113 is a non-transitory computer-readable storage medium. The storage 113 may be a hard disk drive (HDD) or a solid-state drive (SSD). The network interface 114 transmits and receives messages (data, signals) and may be at least one of a local area network (LAN) interface, a wireless LAN interface, or a cellular network interface, such as, for example, Long Term Evolution (LTE) or New Radio (NR) (5G). The display 115 displays information based on instructions from the processor 111.
[0017] FIG. 3 is a schematic diagram of hardware of the OPC UA server 120 according to one or more embodiments. As shown in FIG. 3, the OPC UA server 120 includes at least one processor 121 (e.g., a CPU), a memory 122, a storage 123, and a network interface 124. The processor 121 executes a program stored in the memory 122. The storage 123 is a non-transitory computer-readable storage medium and may be referred to as a disk. The network interface 124 transmits and receives messages and may be at least one of a LAN interface, a wireless LAN interface, and a cellular network interface, such as LTE or NR (5G). Each of the OPC UA servers 120 may include a display 125. The network interface 124 may be referred to as a transceiver. In one or more embodiments, information stored in the memory 122 may be stored in the storage 123, and vice versa.
[0018] The following describes the architecture of the OPC UA server 120. Figure 4 is a schematic diagram of an OPC UA server architecture according to one or more embodiments.
[0019] As shown in FIG. 4, the memory 122 stores a server application program 1201 having an interpreter 1202 embedded therein, and an application programming interface (API) 1203.
[0020] The server application program 1201 is code that implements the functionality of the OPC UA server 120. The server application program 1201 uses a server API to send or receive OPC UA messages to or from the OPC UA client 110. The server API is an internal interface that retrieves the server application program 1201 from an OPC UA communication stack 1204 that is included in the network interface 124. The server application program 1201 may be defined by a configuration file that is executed based on a request from the OPC UA client 110. The server application program 1201 may be an OPC UA application program.
[0021] The OPC UA communications stack 1204 receives request messages and publication messages from the OPC UA client 110. The OPC UA communications stack 1204 sends response messages and notification messages to the OPC UA client 110.
[0022] The server application program 1201 is written in a compiled programming language, such as C++, Fortran, COBOL, etc., using a compiler to convert source code into machine code. The compiled programming language is not limited to the above examples and may be any programming language. The server application program 1201 may be referred to as a control strategy.
[0023] The interpreter 1202 may be a Lua script engine. Lua is an embeddable scripting language. The interpreter 1202 converts the source code of the server application program 1201 into machine code line by line on the fly during runtime. The interpreter 1202 may be what is called a Lua interpreter 1202. As another example, the interpreter 1202 may be a program written in Javascript. The interpreter 1202 is not limited to the above examples and may be a predetermined interpreter 1202.
[0024] By embedding the interpreter 1202 in the OPC UA server 120, an end user can define and execute operations using the interpreter 1202 without having to modify the OPC UA server 120 on which the interpreter 1202 is hosted and compiled.
[0025] One or more embodiments of the present invention allow the server application program 1201 to be flexibly modified, and by using the embedded interpreter 1202, functionality can be added to the server application program 1201 without changing the entire source code of the server application program 1201.
[0026] Examples of how to configure operations, modify the configuration file, and run operations are described below.
[0027] (Operation configuration)
[0028] FIG. 5 is a flow chart of configuring operations on the OPC UA server 120 according to one or more embodiments.
[0029] 5, the OPC UA server 120 receives a configuration request including a configuration file from the OPC UA client 110 via the network. The configuration request may be initialized in any format.
[0030] A configuration file contains source code that indicates the configuration of a calculation. The configuration file may include the name of the calculation, the values of the inputs to the calculation and the data type of each input, the values of the outputs of the calculation and the data type of each output, and the algorithm of the calculation written in plain text code for the interpreter 1202. Figure 6 is an example of source code included in a configuration request. In Figure 6, the name of the calculation is "MyCalc", the data type of each input "A" and "B" is "INT", the data type of the output "SUM" is "INT", and the algorithm is "SUM=A+B".
[0031] In step S102 of FIG. 5, when the OPC UA server 120 receives a configuration request, the processor 121 of the OPC UA server 120 determines whether a configuration file exists in the storage 123.
[0032] If the determination in step S102 is Yes, in step S103, the OPC UA server 120 deletes the OPC UA object node and child nodes from memory 122 and deletes the existing configuration file from storage 123.
[0033] If the determination in step S102 is No, the process proceeds to step S104.
[0034] In step S104, the processor 121 reads the configuration file of the configuration request and creates an OPC UA node and child nodes in the memory 122 using the “Name”, “ArgsIn” and “ArgsOut” components of the configuration file.
[0035] In step S105, the processor 121 writes the “Algorithm” component of the configuration file to the storage 123.
[0036] For example, when the OPC UA server 120 reads the configuration file of FIG. 6, the OPC UA server 120 performs the following steps:
[0037] Create an OPC UA object node named "MyCalc" in the address space of memory 122.
[0038] Create an OPC UA folder node named "Inputs" as a child node of "MyCalc".
[0039] Create an OPC UA node as a child of the node "Inputs" for the input argument "A" with the data type integer that allows reading and writing.
[0040] Create an OPC UA node as a child of the node "Inputs" for the input argument "B" with the data type Integer that allows reading and writing.
[0041] Create an OPC UA folder node named "Outputs" as a child node of "MyCalc".
[0042] Create an OPC UA node as a child of the node "Outputs" for the input argument "C" with the data type integer that is only allowed to be read.
[0043] Create an OPC UA node as a child node of the node “Outputs” for the method named “runCalc”.
[0044] As a result, the OPC UA node of Figure 7 is created in the address space of memory 122. In the tree structure of Figure 7, an OPC UA object node named "MyCalc" is created. The OPC UA child nodes named "Inputs", "Outputs" and "runCalc" exist at the same hierarchical level under the OPC UA object node named "MyCalc".
[0045] Thus, according to one or more embodiments, the configuration file can be configured into the OPC UA server 120 without compiling the configuration file because the interpreter 1202 executes the configuration file line by line.
[0046] (Modify the configuration file)
[0047] Next, we will explain how to modify the configuration file.
[0048] When the OPC UA server 120 receives the configuration file of FIG. 8 following the configuration file of FIG. 6, an OPC UA node shown in FIG. 9 is created in the address space of the memory 122. In the OPC UA node of FIG. 9, an OPC UA object node named "Average3" is created in addition to an OPC UA object node named "MyCalc". OPC UA child nodes named "Inputs", "Outputs" and "runCalc" exist at the same hierarchical level under the OPC UA object node named "Average3". An "Algorithm" component is configured as shown in FIG. 8.
[0049] In one or more embodiments, when some of the components of a configuration file that is already configured in the OPC UA server 120 are modified, the OPC UA client 110 sends the configuration file with the modified components to the OPC UA server 120.
[0050] For example, when "AVERAGE = (Va11+Va12+Va13) / 2.0" in the "Algorithm" component of the configuration file of Figure 8 is modified, the OPC client 110 sends to the OPC UA server 120 the configuration file of Figure 10 in which "AVERAGE = (Va11+Va12+Va13) / 3.0" is written in the "Algorithm" component. The remaining components other than the "Algorithm" component are identical between the configuration files of Figures 8 and 10.
[0051] When the configuration file is modified, the OPC UA server 120 processes the following procedure shown in FIG. 5.
[0052] When the OPC UA server 120 receives the configuration file of FIG. 10 named “Average3” (S101 in FIG. 5), it determines whether a configuration file named “Average3” already exists in the storage 123n (S102).
[0053] Because a configuration file named "Average3" already exists in storage 123 (yes in S102), the OPC UA server 120 deletes the existing OPC UA object node named "Average3" and the child node of the OPC UA object node named "Average3" from memory 122 (S103). The OPC UA server 120 deletes the existing configuration file named "Average3.txt" from storage 123 (S103).
[0054] The OPC UA server 120 uses the configuration file of FIG. 10 to generate an OPC UA object node named “Average3” and a child node of the OPC UA object node named “Average3” in the memory 122 (S104).
[0055] The OPC UA server 120 writes “AVERAGE = (Va11 + Va12 + Va13) / 3.0” of the “Algorithm” component in FIG. 10 to the storage 123 with the OPC UA file name “Average3.txt” (S105).
[0056] Thus, it is possible to flexibly modify configuration files using the interpreter 1202 by modifying only those components in the configuration file that should be modified.
[0057] According to one or more embodiments, if an error is found in an existing configuration file, the error can be corrected without compiling the configuration file because the interpreter 1202 executes the configuration file. As a result, modifying the configuration file is flexible because the user does not need to know the compiled rules, such as the syntax rules, of a compiled programming language in order to modify the configuration file.
[0058] (Performing calculations)
[0059] In one or more embodiments, the OPC UA server 120 causes the interpreter 1202 to perform operations based on requests from the OPC UA client 110. Figure 11 is a flowchart of the execution of operations at the OPC UA server 120 in accordance with one or more embodiments.
[0060] In step S201 of Fig. 11, the OPC UA server 120 receives an execution request to execute an operation defined in a configuration file from the OPC UA client 110 via a network. The execution request includes the name of the operation and a value entered by a user via the OPC UA client 110. In this example, the name of the operation is "MyCalc" in Fig. 6, and the values "A" and "B" are "3" and "4", respectively. The processor 121 of the OPC UA server 120 writes the values "3" and "4" to "A" and "B" of the memory 122, respectively.
[0061] In step S202, the processor 121 reads the value of the OPC UA node located under “ArgsIn” in the address space from the memory 122 and sends the value to the interpreter 1202. In this example, the processor 121 reads the values “3” and “4” corresponding to “A” and “B”, respectively, and sends the values “3” and “4” to the interpreter 1202.
[0062] In step S203, the processor 121 reads the instruction from the configuration file into the memory 122 and sends the instruction to the interpreter 1202. For example, the processor 121 reads the instruction defined as "MyCalc" ("C=A+B") from "MyCalc.txt" in the storage 123. Then, the processor 121 sends the instruction in "MyCalc.txt" to the interpreter 1202.
[0063] In step S204, the processor 121 executes the algorithm without compiling the configuration file, using the interpreter 1202. For example, the interpreter 1202 executes the operation "C=3+4".
[0064] In step S205, the processor 121 reads the result defined by “ArgsOut” from the interpreter 1202, and stores the result in the memory 122. For example, the processor 121 stores the result of the calculation, “7”, in a value named “C” in the memory 122.
[0065] In step S206, the processor 121 writes the result from the interpreter 1202 to the ArgsOut node.
[0066] Thus, one or more embodiments provide an OPC UA system 1 that includes an OPC UA server 120 that can flexibly modify configuration files used in the OPC UA system 1 and perform operations using an interpreter without compiling the configuration files.
[0067] In one or more embodiments, the configuration file is not limited to the above examples shown in Figures 6, 8, and 10. The configuration file may include any source code suitable for an OPC UA application program.
[0068] While the present disclosure has been described with respect to a limited number of embodiments, those skilled in the art will appreciate that, having the benefit of the present disclosure, a variety of other embodiments may be devised without departing from the scope thereof, and therefore the scope of the present invention is not limited solely to the appended claims.
Claims
1. a storage for storing configuration files written in a compiled programming language and having an embedded interpreter; a transceiver for receiving an execution request from an OPC UA client to execute an operation defined in the configuration file; a processor for executing the operations using the interpreter; A memory for storing an OPC UA node generated based on the configuration file; An OPC UA server comprising:
2. The OPC UA server of claim 1 , wherein the processor performs the operations without compiling the configuration file.
3. the execution request includes at least one value corresponding to at least one OPC UA node; said processor, upon receiving said execution request, sends said at least one value to said interpreter; The processor sends instructions defined in the configuration file to the interpreter; the processor causes the interpreter to execute an algorithm using the at least one value based on the instructions; The OPC UA server of claim 1 .
4. The OPC UA server according to claim 1 , wherein the configuration file is written in plain text.
5. The OPC UA server of claim 1 , wherein the interpreter is a Lua engine.
6. an OPC UA server storing a configuration file written in a compiled programming language and having an embedded interpreter; an OPC UA client that sends an execution request to the OPC UA server to execute an operation defined in the configuration file; Equipped with Upon receiving the execution request, the OPC UA server executes the operation using the interpreter; storing an OPC UA node generated based on the configuration file; A system that processes using OPC UA.
7. The system of claim 6 , wherein the OPC UA server performs the operation without compiling the configuration file.
8. the execution request includes at least one value corresponding to at least one OPC UA node; the OPC UA server, upon receiving the execution request, sends the at least one value to the interpreter; The OPC UA server sends instructions defined in the configuration file to the interpreter; the OPC UA server causes the interpreter to execute an algorithm using the at least one value based on the instruction; 8. A system according to claim 6 or 7.
9. The system according to claim 6 , wherein the configuration file is written in plain text.
10. The system of any one of claims 6 to 9, wherein the interpreter is a Lua engine.
11. 1. A method for implementing an OPC UA system, comprising: Storing, by the OPC UA server, a configuration file written in a compiled programming language and having an embedded interpreter; sending an execution request from an OPC UA client to the OPC UA server to execute an operation defined in the configuration file; receiving, by the OPC UA server, the execution request; executing, by the OPC UA server, the operation using the interpreter upon receiving the execution request; Including, The method, wherein the storing step further stores an OPC UA node generated based on the configuration file.
12. The method of claim 11 , wherein the performing step performs the operation without compiling the configuration file.
13. the execution request includes at least one value corresponding to at least one OPC UA node; sending, by the OPC UA server, upon receiving the execution request, the at least one value to the interpreter; sending, by the OPC UA server, instructions defined in the configuration file to the interpreter; causing the interpreter to execute an algorithm using the at least one value based on the instruction, by the OPC UA server; 13. The method of claim 11 or 12, further comprising:
14. The method according to any one of claims 11 to 13, wherein the configuration file is written in plain text.
15. 15. The method of any one of claims 11 to 14, wherein the interpreter is a Lua engine.
Citation Information
Patent Citations
Method for dynamic correction of software system
JP1995073032A
Java compiler and device for generating compiler information used by the java compiler
JP2003202994A
Data processing using multiple instruction sets
JP2008123545A
System and method for injecting run-time programming code in printing device
JP2014194781A
Method and system for efficiently interpreting a computer program
US20060053415A1