EasyUA Reference
BeginRead(IList<ReadValueId>,UInt32,AsyncCallback,Object) Method
See Also  Send Feedback
EasyUA Assembly > Advosol.EasyUA Namespace > Session Class > BeginRead Method : BeginRead(IList<ReadValueId>,UInt32,AsyncCallback,Object) Method

nodesToRead
List of Nodes and their Attributes to read. For each entry in this list, a StatusCode is returned, and if it indicates success, the Attribute Value is also returned.
maxAge
Maximum age of the value to be read in milliseconds.
The age of the value is based on the difference between the ServerTimestamp and the time when the Server starts processing the request. For example if the Client specifies a maxAge of 500 milliseconds and it takes 100 milliseconds until the Server starts processing the request, the age of the returned value could be 600 milliseconds prior to the time it was requested. If the Server has one or more values of an Attribute that are within the maximum age, it can return any one of the values or it can read a new value from the data source. The number of values of an Attribute that a Server has depends on the number of MonitoredItems that are defined for the Attribute. In any case, the Client can make no assumption about which copy of the data will be returned. If the Server does not have a value that is within the maximum age, it shall attempt to read a new value from the data source. If the Server cannot meet the requested maxAge, it returns its “best effort” value rather than rejecting the request. This may occur when the time it takes the Server to process and return the new data value after it has been accessed is greater than the specified maximum age. If maxAge is set to 0, the Server shall attempt to read a new value from the data source. If maxAge is set to the max Int32 value or greater, the Server shall attempt to get a cached value.
callback
The callback to call when the async processing completes.
userData
The user data that is passed to the callback.

Glossary Item Box

Reads values and attributes asynchronously from OPC server.
The default requests settings are used. The timestamps are returned according the TimestampToReturn property (the default is SOURCE).

Syntax

Visual Basic (Usage)Copy Code
Dim instance As Session
Dim nodesToRead As IList(Of ReadValueId)
Dim maxAge As UInteger
Dim callback As AsyncCallback
Dim userData As Object
Dim value As IAsyncResult
 
value = instance.BeginRead(nodesToRead, maxAge, callback, userData)

Parameters

nodesToRead
List of Nodes and their Attributes to read. For each entry in this list, a StatusCode is returned, and if it indicates success, the Attribute Value is also returned.
maxAge
Maximum age of the value to be read in milliseconds.
The age of the value is based on the difference between the ServerTimestamp and the time when the Server starts processing the request. For example if the Client specifies a maxAge of 500 milliseconds and it takes 100 milliseconds until the Server starts processing the request, the age of the returned value could be 600 milliseconds prior to the time it was requested. If the Server has one or more values of an Attribute that are within the maximum age, it can return any one of the values or it can read a new value from the data source. The number of values of an Attribute that a Server has depends on the number of MonitoredItems that are defined for the Attribute. In any case, the Client can make no assumption about which copy of the data will be returned. If the Server does not have a value that is within the maximum age, it shall attempt to read a new value from the data source. If the Server cannot meet the requested maxAge, it returns its “best effort” value rather than rejecting the request. This may occur when the time it takes the Server to process and return the new data value after it has been accessed is greater than the specified maximum age. If maxAge is set to 0, the Server shall attempt to read a new value from the data source. If maxAge is set to the max Int32 value or greater, the Server shall attempt to get a cached value.
callback
The callback to call when the async processing completes.
userData
The user data that is passed to the callback.

Return Value

An object which must be passed to the EndRead method.

Remarks

The Read Service is used to read one or more attributes of one or more nodes. It allows also reading subsets or single elements of array values and to define a valid age of values to be returned to reduce the need for device reads. Like most other services, the read is optimized for bulk read operations and not for reading single Attribute values. Typically all Node Attributes are readable. For the Value Attribute the Read rights are indicated by the AccessLevel and UserAccessLevel Attribute of the Variable.

Requirements

Target Platforms: Windows 7/8/10, Windows Server 2003/2008/2012/2015, .NET4.x

See Also

Copyright © 2018 Advosol Inc. All Rights Reserved.