Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Non-changing values causing QOpcUa connection drop

Non-changing values causing QOpcUa connection drop

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 224 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mark81
    wrote on last edited by Mark81
    #1

    Here my code to enable the monitoring of an OpcUa variable:

    QOpcUaNode *node = // retrieve the desired node
    QOpcUaMonitoringParameters params(1000);
    params.setMaxKeepAliveCount(10);
    params.setLifetimeCount(30);
    
    QOpcUaNode *node = // retrieve the desired node
    node->enableMonitoring(QOpcUa::NodeAttribute::Value, params);
    

    If the variables monitored change their values constantly the application runs fine the whole day. But when at least one variable does not change its value for a while (few minutes!) the connection drops with the following messages:

    "Received a ServiceFault response"
    "The ServiceResult has the StatusCode BadTimeout"
    "Received Timeout for Publish Response"
    "The ServiceResult has the StatusCode BadNoSubscription"

    Reading the OpcUa documentation it seems that if the value is steady the server should push a notification anyway after a timeout (given by the above parameters).
    In the factory we have different kind of machines and some of them have no problems (even with variable that does not change the value for days) while others drop the connection every few minutes - no matter the settings.

    At first glance one could say: "well, it's a server fault then". I've tried with the official QOpcUa Viewer example and the behavior is exactly the same of my application... but using a different OpcUa client (I guess Qt-based as well, like Matrikon OPC UA Explorer ) the connection won't drop at all.

    I tried to manually poll a variable every few seconds, but of course it does not affect the monitoring - hence the server closes the connection anyway.

    Is there anything I could do to keep the connection alive?

    I'm using Qt 6.4.0 under Ubuntu 22.04.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved