OpcUa_DoCom cost too much time

Questions regarding the use of the ANSI C SDK for Server or Client development or integration into customer products ...

Moderator: uasdkc

Post Reply
IceballSHooter
Jr. Member
Jr. Member
Posts: 3
Joined: 04 Feb 2018, 10:21

OpcUa_DoCom cost too much time

Post by IceballSHooter »

Hi, team

I am now using the ANSI C code to do UA communication with Siemens PLC UA Server, during the communication, i found that when i send/recv data as 1 ms cycle time that call SDK UaBase_DoCom() may takes more than 200 ms every step and cause date transfter to PLC with a great delay.

I have tried set DoCom time as 1000 ms which not works well and i wanna ask if there is any setting or method could solve the communication performance

Thanks
Best Regards

User avatar
Support Team
Hero Member
Hero Member
Posts: 2521
Joined: 18 Mar 2011, 15:09

Re: OpcUa_DoCom cost too much time

Post by Support Team »

Hello IceballSHooter,

the timeout passed to UaBase_TimedDoCom is the maximum time the call will wait for socket events in the select call. Increasing this timeout can slow down the server, as the select call might take as long as the passed timeout (if no events occur at the sockets), which would delay the SDK's timers, leading to inaccurate timers and delayed reaction time of the server. This is why the timeout should be chosen to be in the few milliseconds range.

If you need the server to be more reactive, you should set a smaller timeout, in your use case setting it to 1ms might increase the performance. If that doesn't help, you should enable the trace and check it for hints about what delays the UaBase_TimedDoCom call.
Best regards
Unified Automation Support Team

Post Reply