OPC UA Server Script Execution via Embedded Interpreter
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional OPC UA systems require access to all source code and specialized skills to modify or add functionality, making it difficult and costly for users to change or enhance the OPC UA server program, as they are typically compiled and require recompilation.
Innovation Solution
Embedding an interpreter within the OPC UA server application program allows for execution of calculations defined in a configuration file without modifying the compiled program, enabling users to modify and execute calculations using the interpreter, thus allowing for flexible modification and execution without recompilation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the OPC UA server program is written in compiled programming language, then execution efficiency and reliability are improved, but flexibility and ease of modification deteriorate
Solution Approach 1:
The server program is segmented into a compiled core component and a separate script configuration component. The compiled program provides reliable execution framework, while the script file handles flexible calculation logic. This segmentation allows each part to serve its optimal purpose - compiled code for reliability and script for adaptability.
Solution Approach 2:
An interpreter acts as an intermediary between the compiled server program and the script configuration file. The interpreter enables the compiled program to execute script-based calculations dynamically without requiring recompilation, thus bridging the gap between compiled reliability and script flexibility.
2Speed
If the OPC UA server program is compiled, then execution speed is improved, but ease of modification and ability to add functionality deteriorate
Solution Approach 1:
The system dynamically loads and executes calculation logic from script files at runtime rather than having all logic statically compiled. This dynamic approach allows users to modify calculations by simply editing script files without recompilation, while the compiled server program continues to execute at high speed.
Solution Approach 2:
The server program is pre-compiled with an embedded interpreter capability, preparing the execution environment in advance. This preliminary action enables the server to subsequently execute script-based calculations dynamically without requiring recompilation when modifications are needed.
3Reliability
If professional programming knowledge is required to modify the server program, then program reliability is maintained, but user accessibility and ease of operation deteriorate
Solution Approach 1:
Instead of requiring users to modify the original compiled source code, the system uses script configuration files that can be edited in plain text. These script files serve as copyable, modifiable representations of calculation logic that don't require access to or modification of the core compiled program, making them accessible to non-programmers while maintaining system integrity.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
An Open Platform Communications (OPC) Unified Architecture (UA) server (120) includes: a storage (123) that stores a configuration file written in a compiled programming language and in which an interpreter (1202) is embedded; a transceiver (124) that receives, from an OPC UA client (110), an execution request to execute a calculation defined in the configuration file; and a processor (121) that executes the calculation using the interpreter (1202).