OPCUA Project Code Generator
To help you with the initial configuration of your OPCUA project, you can use a script that will perform the initialization of a sample application with all required files. Initial configuration includes:
Full configuration file
Generate self-signed certificates for all secure policies
Lua script for starting OPCUA server or client
Initializing a server
Create a Lua file with the following content:
local hostname = 'localhost'
local applicationName = 'RealTimeLogic OPCUA Server'
local applicationUri = 'urn:realtimelogic.com:opcua:server'
local initServer = require('opcua.init').initializeServer
initServer(hostname, applicationName, applicationUri)
- After running the script, you will see the following files:
config.lua - configuration file for OPCUA server
basic128rsa15.key - private key for security policy Basic128rsa15
basic128rsa15.key - self-signed certificate for security policy Basic128rsa15
main.lua - Lua script that runs OPCUA server
Initializing a client
Create a Lua file with the following content:
local hostname = 'localhost'
local applicationName = 'RealTimeLogic OPCUA Client'
local applicationUri = 'urn:realtimelogic.com:opcua:client'
local initClient = require('opcua.init').initializeClient
initClient(hostname, applicationName, applicationUri)
- After running the script, you will see the following files:
config.lua - configuration file for OPCUA client
basic128rsa15.key - private key for security policy Basic128rsa15
basic128rsa15.pem - self-signed certificate for security policy Basic128rsa15
main.lua - Lua script that contains a sample of the OPCUA client application.