OPCDA.NET Reference Manual
SetKeepAlive Method
See Also  Send Feedback
OpcDaNetUA.Net4 Assembly > OPCDA.NET Namespace > OpcGroup Class : SetKeepAlive Method

keepAliveRate
The maximum amount of time (in milliseconds) between subscription callbacks. A value of zero indicates the server will not send any empty keep-alive callbacks.
revKeepAliveRate
The KeepAliveTime the server is actually providing, which may differ from keepAliveRate.

Glossary Item Box

Sets the keep-alive time for the group subscription.
Only OPC DA V3 servers support the keep alive feature. The OPCDA.NET Professional Edition emulates the keep alive feature for servers that don't implement the OPC DA V3 IOPCGroupStateMgt2 interface. Some servers may implement the interface but not the method. In this case the OpcServer.DeclareV2 property has to be set to force the emulation to be used. The emulation has a client side thread that makes periodically GetStatus server calls and executes keepalive DataChange callbacks accourding the OPC DA V3 keep alive specification.
Clients can set the keep-alive time for a subscription to cause the server to provide client callbacks on the subscription when there are no new events to report. Clients can then be assured of the health of the server and subscription without resorting to pinging the server with calls to GetStatus(). Using this facility, a client can expect a callback (data or keep-alive) within the specified keep-alive time.
Servers shall reset their keep-alive timers when real data is sent (i.e. it is not acceptable to constantly send the keep-alive callback at a fixed period equal to the keep-alive time irrespective of data callbacks).

Syntax

Visual Basic (Declaration) 
Public Function SetKeepAlive( _
   ByVal keepAliveRate As Integer, _
   ByRef revKeepAliveRate As Integer _
) As Integer
C# 
public int SetKeepAlive( 
   int keepAliveRate,
   out int revKeepAliveRate
)

Parameters

keepAliveRate
The maximum amount of time (in milliseconds) between subscription callbacks. A value of zero indicates the server will not send any empty keep-alive callbacks.
revKeepAliveRate
The KeepAliveTime the server is actually providing, which may differ from keepAliveRate.

Return Value

S_OK or E_FAIL

Requirements

Target Platforms: Windows 7/8/10, Windows Server 2003/2008/2012/2016, .NET 4.x

See Also

Copyright © 2002-2018 Advosol Inc. All Rights Reserved.