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

maxAge
“staleness” for the items, requested in milliseconds. The server will calculate the number of milliseconds between “now” and the item timestamp. If the item that has not been updated within the last MaxAge milliseconds, the value must be obtained from the underlying device. Or if the item is not available from the cache, it will also need to be obtained from the underlying device. A max age of 0 is equivalent to OPC_DS_DEVICE and a max age of 0xFFFFFFFF is equivalent to OPC_DS_CACHE. Without existence of a cache the server will always read from device. In this case MaxAge is not relevant. Some servers maintain a global cache for all clients. If the needed item is in this global cache, it is expected that the server makes use of it to check the MaxAge value. Servers should not automatically create or change the caching of an item based on a Read call with MaxAge.
transactionID
The Client generated transaction ID. This is included in the 'completion' information provided to the OnDataChange
cancelID
Place to return a Server generated ID to be used in case the operation needs to be canceled.

Glossary Item Box

Force a callback to IOPCDataCallback::OnDataChange for all active items in the group (whether they have changed or not). Inactive items are not included in the callback. The MaxAge value will determine where the data is obtained. There will be only one MaxAge value, which will determine the MaxAge for all active items in the group. This means some of the values may be obtained from cache while others could be obtained from the device depending on the “freshness” of the data in the cache.

Syntax

Visual Basic (Declaration) 
Public Function RefreshMaxAge( _
   ByVal maxAge As Integer, _
   ByVal transactionID As Integer, _
   ByRef cancelID As Integer _
) As Integer
C# 
public int RefreshMaxAge( 
   int maxAge,
   int transactionID,
   out int cancelID
)

Parameters

maxAge
“staleness” for the items, requested in milliseconds. The server will calculate the number of milliseconds between “now” and the item timestamp. If the item that has not been updated within the last MaxAge milliseconds, the value must be obtained from the underlying device. Or if the item is not available from the cache, it will also need to be obtained from the underlying device. A max age of 0 is equivalent to OPC_DS_DEVICE and a max age of 0xFFFFFFFF is equivalent to OPC_DS_CACHE. Without existence of a cache the server will always read from device. In this case MaxAge is not relevant. Some servers maintain a global cache for all clients. If the needed item is in this global cache, it is expected that the server makes use of it to check the MaxAge value. Servers should not automatically create or change the caching of an item based on a Read call with MaxAge.
transactionID
The Client generated transaction ID. This is included in the 'completion' information provided to the OnDataChange
cancelID
Place to return a Server generated ID to be used in case the operation needs to be canceled.

Return Value

HRESULT success/error code

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.