Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-93664

QT OPC UA: association between async requests and responses

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 5.15.3
    • OpcUA
    • None
    • All

    Description

      When reading multiple items are read via QOpcUaClient::readNodeAttributes at multiple location in user code they all are reported at the exact same signal. This means in each dedicated slot for a read I have to figure out if I should return immediately or handle the data by examining if the nodeids/attributes returned match the requested ones.

      As a minimum (as other OPC UA API do) I would like to have some user-data I supply for the read call so that in the callbacks I can easily return if the user data does not match.

      m_client->readNodeAttributes(request, 42);

      auto handler = [](..., Userdata userdata){if (userdata ! =42) return; ...}

      A better approach would be not to burden the user code with the same problem over and over again but to supply a single callback method for the read, e.g.
      m_client->readNodeAttributes(
      request,
      [](QVector<QOpcUaReadResult> results, QOpcUa::UaStatusCode serviceResult){...});
      For attributes of a single node I can retrieve the node and then add a slot for the read, but this creates a new node object which I might not need after the read and it does not generalize to read multiple values.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            fmeerkoetter Frank Meerkötter
            __henning__ Henning Voss
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes