OPC UA: the communication protocol for industrial automation applications

Imperix relies on the increasingly popular OPC UA industrial protocol to remotely control and monitor its power electronic controllers over Ethernet. To do so, the B-Board PRO and B-Box RCP controllers embed an OPC UA server to communicate with the in-house monitoring software imperix Cockpit. One of the advantages of using an open standard such as OPC UA is that it enables users to use third-party clients to visualize data and send commands.

This page is aimed at users who wish to implement a custom OPC UA client to interact with an imperix controller and provides guidance on how to connect to and exchange data with the OPC UA server embedded in imperix controllers.

OPC UA communication link between a client and a B-Box controller

What is OPC UA?

OPC Unified Architecture (UA) is an open communication standard developed by the OPC Foundation targeting industrial automation. This Ethernet-based protocol allows clients to remotely control OPC UA compatible devices from various vendors. OPC UA is designed to be a secure industrial communication and supports signed and encrypted communication as well as user authentication.

Moreover, thanks to the openness of OPC UA, a multitude of resources and libraries are available online, allowing the user to build his own client. Here are a few of them:

Monitoring an imperix controller using OPC UA

Imperix Cockpit, the official monitoring software to remotely control imperix products, relies on OPC UA for most of the communication with the B-Box RCP and B-Board PRO. Consequentially, third-party clients may perform the same actions, including:

  • read and write the user variables (probe and tunable parameters) at a frequency up to 100 Hz
  • enable or disable the PWM outputs
  • get the device status (is the code running, did a fault occur, what is the CPU load, etc)
  • read the generated log messages
OPC UA enables different clients to interact with a B-Box controller
OPC UA enables different clients to interact with a B-Box controller

Connecting to the imperix OPC UA server

Imperix uses the default OPC UA port 4840, meaning that the OPC UA endpoint URL to connect to a B-Box or B-Board controller is opc.tcp://<IP-ADDRESS>:4840

Connecting to an imperix controller OPA UA server from UaExpert

Imperix system variables

Below are documented the read-only “system” OPC UA node variables that can be of use to the user. They provide configuration and status information about the target. These system node variables are stored in the namespace 1 and are available at all times (contrary to user code variables described later).

imperix controller OPA UA server variables displayed in UaExpert
Name DatatypeDescription
ACG licenseStringThe loaded ACG license status
CPP licenseStringThe loaded CPP license status
CPU load [%]FloatUser CPU load. Returns 0 when the user code is stopped
ControllerStringReturns “B-Board” or “B-Box”
Core stateString“Offline”: The user code is stopped
“Blocked”, “Operating” or “Fault” when the user code is running
Dynamic IPStringThe automatically assigned IP address
HostnameStringThe device hostname
Loaded code MD5StringThe MD5 hash of the loaded user code file
Loaded code dateStringThe last modification date of the loaded user code file
Loaded code nameStringThe name of the loaded user code file
Logs BBOSStringReturns the log messages generated by the user code system (BBOS). It uses the following format:
[severity][timestamp]Message
For instance:
[I][1648114327359324364]User code started (BBOS v3.7 build 2203211046)
MAC addressStringThe device’s MAC address
Static IPStringThe default static IP. It is always 192.168.222.22
Static IP 2StringThe user-configured static IP
StatusStringDisplay status similar to the B-Box screen.
“Initializing…”, “Discovering…” or “Synchronizing…”: the device is in its starting phase
“Ready.”: the user code can be started
“Starting…”: the user code is being started
“Running.”: a user code is running
All other messages are error messages
TemperatureFloatThe chip temperature in degrees Celsius
User CPU stateString“Running” or “Offline”
User logStringReturns the user-created log messages generated using the LOG block. It uses the following format:
[severity][timestamp]Message
VersionStringThe firmware version of the device

Imperix methods

The following methods allow the user to interact with the target (start the code, enable the PWM outputs) or to change system parameters (hostname, IP).

Method name ArgumentDescription
Change hostnamenew hostnameChange the target hostname
Change static IP 2new static IPChange the target static IP 2. The static IP 1 is always 192.168.222.22
Enable outputs
N/AEnable the PWM outputs
Disable outputsN/ADisable the PWM outputs
Set DAC<variable name>, <DAC channel>, <device ID>, <gain>, <offset>Connect a user variable to an analog output of the target, similar to the DAC module of Cockpit
Start code
N/AStart the loaded user code.
Stop codeN/AStop the loaded user code.

User-created OPC UA variables

When a user code is started, an OPC UA variable is created for each probe variable and tunable parameter present in the user model (Simulink, PLECS or C++). They are stored in the namespace index 2.

Probe connected to an ADC acquisition block
The probe “Vdc” is connected to the output of an ADC block
The probe “Vdc” of the user model is available as an OPC UA variable (UaExpert)

Going further

Making an OPC UA GUI client using MATLAB

To use MATLAB as an OPC UA client, the user may read the Industrial Communication Toolbox tutorial. This Add-On may be combined with MATLAB App Designer to build an HMI GUI for imperix power converters such as the one shown in the illustration on this page.

Making an OPC UA GUI client using C++

To go on the completely free-of-cost route, we would recommend checking out the C library open62541 and using a C++ framework such as Qt or wxWidgets to build a GUI.

Making an OPC UA GUI client using Python

To stay on the free and open-source route, developing a client using Python is also possible thanks to Freeopcua. A GUI can be built quite easily using the popular Python package tkinter.