OpcUaStack is an open source implementation of OPC UA protocol written in C++. It provides SDK to create your own OPC UA application from scratch and an OPC UA framework as well, which makes creating and running OPC UA applications easier.
The stack contains the following parts:
- OpcUaStackClient is a client library, which can be used to implement a client OPC UA application in C++.
- OpcUaStackServer is a server library, which can be used to implement a server OPC UA application in C++.
- OPC UA Application Server provides a server environment to run user OPC UA client\server applications as dynamic libraries.
- OPC UA Project Generator helps to create and distribute a new user application for Application Server.
All parts of the stack are cross-platform and support Linux and Windows operation systems.
- SDK for Client\Server application
- Application Server to run OPC UA application as dynamic libraries
- Settings and OPC UA information model in XML format
- Support DEB package type to distribute user applications on Linux
In the development stage:
- Code generator to create C++ classes representing OPC UA types, objects and events from XML (Nodesets)
- Multi-thread model (currently all application modules run in only one thread)
- Support RPM package type to distribute user applications on Linux
- Support MSI package type to distribute user applications on Windows
OpcUaStack provides different ways of installing.
In order to compile and install the stack from the source code, you should meet the following requirements:
- Compiler with C++11 support
- CMake >= 2.8.9
- Boost >= 1.54
- OpenSSL >= 1.0.0
Linux (Ubuntu or Debian)
Ubuntu or Debian users can install the requirements by using apt-get command:
$ sudo apt-get install apt-get install libboost-all-dev cmake libssl-dev build-essential
The next step is the compilation of the source code and its installation. You should run in the root directory of the sources:
$ sh build.sh -t local
By default the installation path is $HOME/.ASNeG. You can change it at any moment:
$ sh build.sh -t local -i /path/witch/you/prefer
Windows
Winidows users should install all requirements manually.
In order to compile the project, you should install MSBuild Tools 2015, then run in the environment which is suitable for your target platform (e.g. Native x86) the following command:
$ build.bat local
By default the installation path is C:\install. You can change it by typing:
$ cd local_build $ set DESTDIR=C:\path\witch\you\prefer $ MSBuild INSTALL.vcxproj
The stack provides DEB packets, so you can install it into your Ubuntu or Debian. Download the last packages and install them by using dpkg command
If you need only the runtime to run your application, type:
$ sudo dpkg -i OpcUaStack-x.y.z-x86_64-bin.deb
For development, install dev packet too:
$ sudo dpkg -i OpcUaStack-x.y.z-x86_64-dev.deb
Also you can build DEB packets from source by using build.sh script:
$ build.sh -t deb
Your packets will be built in build_deb directory.
In order to create a user application OpcUa Stack provides a project builder:
$ OpcUaProjectBuilder3 MyProject ProjectDescription 9012
The builder creates a template of OPC UA application project in directory MyProject. The template is ready to be compiled and installed. Below there is an example for local installation (DEB installation is also possible):
$ cd MyPorject $ sh build.sh local
The user application is installed in directory $HOME/install by default. And you can run it by using OPC UA Server:
$ OpcUaServer3 $HOME/install/etc/OpcUaStack/MyProject/OpcUaServer.xml
The server reads the setting from file OpcUaServer.xml and run the user application. Now the application is available via OPC UA protocol on port 9012.
For more information about how to write your own OPC UA client server application see ASNeG-Demo.
Client Library:
Service Set | Function | OPC UA Interface | Value Based Interface | ||
---|---|---|---|---|---|
Sync | Async | Sync | Async | ||
Discover | Find Server | ||||
Get Endpoints | ✓ | ✓ | |||
Register Server | |||||
Secure | Open Secure Channel | ✓ | ✓ | ✓ | ✓ |
Close Secure Channel | ✓ | ✓ | ✓ | ✓ | |
Session | Create Session | ✓ | ✓ | ✓ | ✓ |
Activate Session | ✓ | ✓ | ✓ | ✓ | |
Close Session | ✓ | ✓ | ✓ | ✓ | |
Cancel Session | ✓ | ✓ | |||
Node Management | Add Nodes | ✓ | ✓ | ||
Add References | ✓ | ✓ | |||
Delete Nodes | ✓ | ✓ | |||
Delete References | ✓ | ✓ | |||
View | Browse | ✓ | ✓ | ||
Browse Next | ✓ | ✓ | |||
Translate Browse Paths | ✓ | ✓ | |||
Register Nodes | |||||
Unregister Nodes | |||||
Query | Query First | ✓ | ✓ | ||
Query Next | ✓ | ✓ | |||
Attribute | Read | ✓ | ✓ | ✓ | ✓ |
History Read | ✓ | ✓ | |||
Write | ✓ | ✓ | ✓ | ✓ | |
History Update | ✓ | ✓ | |||
Method | Call | ✓ | ✓ | ||
Monitored Item | Create Monitored Items | ✓ | ✓ | ✓ | ✓ |
Modify Monitored Items | ✓ | ✓ | |||
Set Monitoring Mode | ✓ | ✓ | |||
Set Triggering | ✓ | ✓ | |||
Delete Monitored Items | ✓ | ✓ | ✓ | ✓ | |
Subscription | Create Subscription | ✓ | ✓ | ✓ | ✓ |
Modify Subscription | ✓ | ✓ | |||
Publish/Set | ✓ | ✓ | ✓ | ✓ | |
Republish | |||||
Transfer Subscription | |||||
Delete Subscription | ✓ | ✓ | ✓ | ✓ |
Columns:
- OPC UA Interface contains the OPC UA interface with full functionality. To use the interface OPC UA skills are necessary
- Value Based Interface contains a value based interface with limited functionality. To use the interface OPC UA skills are not necessary
Server Library:
Service Set | Function | Information Model | OPC UA Interface | Value Based Interface | ||
---|---|---|---|---|---|---|
Sync | Async | Sync | Async | |||
Discover | Find Server | |||||
Get Endpoints | ✓ | |||||
Register Server | ||||||
Secure | Open Secure Channel | ✓ | ||||
Close Secure Channel | ✓ | |||||
Session | Create Session | ✓ | ||||
Activate Session | ✓ | |||||
Close Session | ✓ | |||||
Cancel Session | ||||||
Node Management | Add Nodes | |||||
Add References | ||||||
Delete Nodes | ||||||
Delete References | ||||||
View | Browse | ✓ | ||||
Browse Next | ✓ | |||||
Translate Browse Paths | ||||||
Register Nodes | ||||||
Unregister Nodes | ||||||
Query | Query First | |||||
Query Next | ||||||
Attribute | Read | ✓ | ✓ | |||
History Read | ✓ | ✓ | ||||
Write | ✓ | ✓ | ||||
History Update | ||||||
Method | Call | ✓ | ✓ | |||
Monitored Item | Create Monitored Items | ✓ | ✓ | |||
Modify Monitored Items | ||||||
Set Monitoring Mode | ||||||
Set Triggering | ||||||
Delete Monitored Items | ✓ | ✓ | ||||
Subscription | Create Subscription | ✓ | ||||
Modify Subscription | ||||||
Publish/Set | ✓ | ✓ | ||||
Republish | ||||||
Transfer Subscription | ||||||
Delete Subscription | ✓ | |||||
Alarms & Events | Alarms | ✓ | ✓ | |||
Events | ✓ | ✓ |
Columns:
- Information Model - Interface of the OPC UA information model of the OPC UA Server
- OPC UA Interface - OPC UA Applications are deployed to the OPC UA Server in form of libraries. The OPC UA Interface contains the full OPC UA functionality. To use the interface OPC UA skills are necessary.
- Value Based Interface - OPC UA Applications are deployed to the OPC UA Server in form of libraries. The value based Interface contains the limited OPC UA functionality. To use the interface OPC UA skills are not necessary.
Security:
Type | Client | Server | |
---|---|---|---|
Security Mode | None | ✓ | ✓ |
Sign | ✓ | ||
Sign and Encrypt | ✓ | ||
Security Policy | None | ✓ | ✓ |
Basic128Rsa15 | ✓ | ||
Basic256 | ✓ | ||
Basic256Sha256 | ✓ | ||
User Authentication Policy | Anonymous | ✓ | ✓ |
Username | ✓ | ||
IssuedToken | ✓ | ||
Certificate | ✓ |
- OPC UA Specifications
- ASNeG Home Page (in German)
- ASNeG-Demo