Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Generating OpcUA nodes from list
adaptine last edited by
I'm working on a "small" project here where I'm going to use Qtopcua against a PLC. What I want to do is to create some reusable QML components with QML which can be connected to the PLC-variables in the graphical designer.
I've tried the opcua examples (https://doc-snapshots.qt.io/qtopcua/qtopcua-waterpump-waterpump-qmlcpp-example.html) and got that working with my own variable, but I don't want to manually a node, signal handler connections, data subscriptions getters, notifyers etc for ever variable I want to read like they're doing in the example.
How can I sort of automate the things I mentioned above? Specifying the node identifiers (available variables from the PLC) and its data types will be done manually. Like if I specify a node identifier as "ns=4;s=PLC.PLC_PRG.rValue" and a corresponding variable name as "tankValue", I'll be able to access that value from the OPC server in QML as for instance "uaBackend.tankValue".
In Qts watertank example they've declared a Q_PROPERTY for every variable, but I dont want to do that nor declare everything else manually since I want this to be as simple as possible.