OPCDA.NET Reference Manual
Read(String[],Int32[]) Method
See Also  Send Feedback
OpcDaNetUA.Net4 Assembly > OPCDA.NET Namespace > OpcServer Class > Read Method : Read(String[],Int32[]) Method

itemIDs
A list of fully qualified ItemIDs. These might be obtained from OpcServer.Browse()
maxAges
An array with “staleness” for each item, requested in milliseconds. The server will calculate, for each requested item, the number of milliseconds between “now” and the timestamp on each item. For each item that has not been updated within the last MaxAge milliseconds, 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.

Glossary Item Box

OPCD V3. Reads a group of items with individual maxAges
The purpose of this OPC V3 method is to provide an extremely easy way for simple applications to obtain OPC data. Programmers should be aware that in most servers, the design of the Group based OPC interfaces will provide much better performance than this method. In terms of performance, the user of this method should assume that it will behave as if he were to create a group, add the items, perform a single read or write and then delete the group.

Syntax

Visual Basic (Declaration) 
Public Overloads Function Read( _
   ByVal itemIDs() As String, _
   ByVal maxAges() As Integer _
) As ItemValue()
C# 
public ItemValue[] Read( 
   string[] itemIDs,
   int[] maxAges
)

Parameters

itemIDs
A list of fully qualified ItemIDs. These might be obtained from OpcServer.Browse()
maxAges
An array with “staleness” for each item, requested in milliseconds. The server will calculate, for each requested item, the number of milliseconds between “now” and the timestamp on each item. For each item that has not been updated within the last MaxAge milliseconds, 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.

Return Value

Returned value, quality, timestamp and error information.

Remarks

In case of errors an OPCException is thrown.
Error accessing individual items are reported in the returned ItemValue object.

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.