2

I am developing an OPC UA client that needs to connect asynchronously to a server and update its node data. I am using UA_Client_connectAsync to connect to the server but the async write/read APIs e.g. UA_Client_writeValueAttribute_async in

Examples/client_async.c

of Examples codes are missing from source code and do not compile. Are they deprecated? What is the new API for Async read/write to the server?

I am asking this question because I have tried the UA_Client_writeValueAttribute API with the non-blocking UA_Client_connectAsync and the server node does not receive any data on its node.

Socrates
  • 335
  • 2
  • 3
  • 11
  • I'm facing a similar issue. Async/multithread documentation of open62541 is very poor. No examples available (as of v1.3). I'm using Python opcua-asyncio (aka asyncua) meanwhile – moser Mar 03 '23 at 16:00

1 Answers1

0

There is an async client example at https://github.com/open62541/open62541/blob/master/examples/client_async.c.

The critical ingredient is to call UA_Client_run_iterate repeatedly (e.g. in a loop that is executed by a separate thread).

robert
  • 3,484
  • 3
  • 29
  • 38