<< to CrossControl homepage

Support & Service Center

OPC-UA in Qt 5.12

Printer-friendly versionPrinter-friendly versionPDF versionPDF version

QT Open62541plugin is available under open source license starting from QT 5.13.1.
Our newest non engineering release at the moment is 5.12 and we don’t have the commercial automation package
available in this version. But OPC Open62541 QT plugin has been added in QT 5.12 as a "technology preview".
Though, the plugin is not built by default, it can be built into the Qt 5.12 release.
Follow the instructions below to build the plugin (VI2 used in this example).

In LinX VM 4.0.3, clone the git repo:
ccs@LinX-VM:~/git$ git clone http://code.qt.io/qt/qtopcua.git
Cloning into 'qtopcua'...
warning: redirecting to https://code.qt.io/qt/qtopcua.git/
remote: Counting objects: 7848, done.
remote: Compressing objects: 100% (3881/3881), done.
remote: Total 7848 (delta 4887), reused 6344 (delta 3892)
Receiving objects: 100% (7848/7848), 2.39 MiB | 1.84 MiB/s, done.
Resolving deltas: 100% (4887/4887), done.

Then run qmake to configure the stuff for VS/VI2
ccs@LinX-VM:~/git/qtopcua$ /opt/VI2/sysroots/x86_64-linux/Qt-5.12.0/bin/qmake
Info: creating stash file /home/ccs/git/qtopcua/.qmake.stash
Info: creating cache file /home/ccs/git/qtopcua/.qmake.cache
Running configuration tests...
Checking for Open62541... no
Checking for Unified Automation C++ SDK... no
Done running configuration tests.
Configure summary:
Qt Opcua:
  Open62541 .............................. yes
  Unified Automation C++ SDK ............. no
  Support for namespace 0 NodeId names ... yes
  Namespace 0 NodeIds generator .......... no

Qt is now configured for building. Just run 'make'.
Once everything is built, you must run 'make install'.
Qt will be installed into '/opt/VI2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/opt/Qt-5.12.0'.

It will not detect Open62541 or UA C++ SDK in the VS/VI2 image, which is correct since the libraries are not included in the image.
But the Qt module has 3rd-party library code for Open62541 and will compile this.

Now run "make" and "make install" to install to VS/VI2 SDK folder.
Then use qmake to build examples:
ccs@LinX-VM:~/git/qtopcua/examples/opcua$ /opt/VI2/sysroots/x86_64-linux/Qt-5.12.0/bin/qmake 
ccs@LinX-VM:~/git/qtopcua/examples/opcua$ make -j6 

This seems to work fine for the default Qt 5.12.0 included in the VM and Qt libraries we provide for VS/VI2.
To transfer the built libraries to the target (target IP = x.x.x.x), use the Linux command ‘rsync’:
$ rsync -av /opt/VI2/sysroots/cortexa9hf-neon-poky-linux-gnueabi/opt/Qt-5.12.0 ccs@x.x.x.x:/opt

Link to OPC-UA info on Qt Homepage

Environment and Versions: 
LinX SW Suite v4.0.3 iMX6 (VS/VI2)
Applies to version: 
Qt 5.12 (or higher)