Long running methods/programs?

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

Moderator: uasdkcpp

Post Reply
Andreas
Sr. Member
Sr. Member
Posts: 14
Joined: 17 Sep 2012, 08:32

Long running methods/programs?

Post by Andreas »

What is the best practice in the UA OPC-implementation to handle long running method invocations (with return value)? Is it to use asynchronous method invocations or call programs? How do you notify the client when the execution has finished?


Thanks!

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

Re: Long running methods/programs?

Post by Support Team »

Hello Andreas,

A Method has a list of input arguments, executes some business logic in the server and returns a status code and a list of output arguments. In theory a method execution can take a very long time but most clients will set a timeout for the Call service of 5-20 seconds. Therefore it makes no sense to have methods that always need more then 10 seconds to complete execution. They will time out for a lot of clients. If a client is prepared for the long execution time, the time is no problem.

Programs are based on state machines where the program state machine defines different states like Idle, Running, Error and Methods like Start, Stop, Reset to influence Program execution. Inside the Running state, the program to execute can define it's own states. The program status, progress or completion is reported through events.

Best Regards
Support Team

Post Reply