rticommunity / rticonnextdds-gateway-opcua

The RTI OPC UA/DDS Gateway implements a standards-based transparent bridge to integrate OPC UA and DDS applications.
Other
7 stars 5 forks source link

Publish rate throttled to 1hz #1

Open rokel opened 3 years ago

rokel commented 3 years ago

When using the OPC-UA -> DDS route, the publish rate of the gateway seems to be throttled to 1Hz, regardless of the publishing_interval set for any subscription.

As far as I can tell this is due to this hard-coded parameter:

https://github.com/rticommunity/rticonnextdds-gateway-opcua/blob/master/src/opcUaSdk/OpcUaSdkClientProperty.hpp#L28

Changing e.g. to 10ms it seems to fix the issue. Is this intended behaviour?

fgaranda commented 3 years ago

Hi @rokel,

That's true, the underlying OPC UA Client doesn't have an event-driven main loop or its own thread, so we must call periodically UA_Client_run_iterate in a separate thread that is part of the Gateway. The default value of run_async_timeout does indeed throttle the publishing_interval for any subscription.

We chose a default value of 1000ms, which may be too slow as a default value -- we can look into that. In any case, we should definitely provide an option to configure run_async_timeout via XML. The plumbing for such configuration parameter is almost there, let me take a look at it'll create a PR with the new configuration parameter. Would this work for you?

rokel commented 3 years ago

Thank you for the prompt response and explanation, that makes sense. Yes, a configuration parameter to set this would certainly solve the issue for us.