OPC Studio User's Guide and Reference
ReadList Method (_EasyUAClient)
Example 



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA.ComTypes Namespace > _EasyUAClient Interface : ReadList Method

The value of this parameter cannot be null (Nothing in Visual Basic).

The individual elements of the parameter value cannot be null (Nothing in Visual Basic).

Reads multiple attributes, using array of argument objects as an input.
Syntax
'Declaration
 
<JetBrains.Annotations.NotNullAttribute()>
Function ReadList( _
   ByVal readArgumentsList As IList _
) As _ElasticVector
'Usage
 
Dim instance As _EasyUAClient
Dim readArgumentsList As IList
Dim value As _ElasticVector
 
value = instance.ReadList(readArgumentsList)
[JetBrains.Annotations.NotNull()]
_ElasticVector ReadList( 
   IList readArgumentsList
)
[JetBrains.Annotations.NotNull()]
_ElasticVector^ ReadList( 
   IList^ readArgumentsList
) 

Parameters

readArgumentsList

The value of this parameter cannot be null (Nothing in Visual Basic).

The individual elements of the parameter value cannot be null (Nothing in Visual Basic).

Return Value

Array of OpcLabs.EasyOpc.UA.OperationModel.UAAttributeDataResult. Returns an array of attribute data objects. Each object stores the value of an attribute, together with status code and timestamps. The indices of elements in the output array are the same as those in the input array, readArgumentsArray.

This method never returns null (Nothing in Visual Basic).

The individual elements of the returned value are never null (Nothing in Visual Basic).

Exceptions
ExceptionDescription

A null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

An operation was performed on a disposed object.
Remarks

This method uses lists instead of arrays.

This member is not compatible with VBScript.

This member or type is for use from COM. It is not meant to be used from .NET or Python. Refer to the corresponding .NET member or type instead, if you are developing in .NET or Python.

Example

COM

// This example shows how to read data (value, timestamps, and status code) of 3 attributes at once. In this example,
// we are reading a Value attribute of 3 different nodes, but the method can also be used to read multiple attributes
// of the same node.

mle_outputtext.Text = ""

// Instantiate the client object
OLEObject client
client = CREATE OLEObject
client.ConnectToNewObject("OpcLabs.EasyOpc.UA.EasyUAClient")

// Prepare arguments. By default, the Value attributes of the nodes will be read.

OLEObject readArguments1
readArguments1 = CREATE OLEObject
readArguments1.ConnectToNewObject("OpcLabs.EasyOpc.UA.OperationModel.UAReadArguments")
readArguments1.EndpointDescriptor.UrlString = "http://opcua.demo-this.com:51211/UA/SampleServer"
readArguments1.NodeDescriptor.NodeId.ExpandedText = "nsu=http://test.org/UA/Data/ ;i=10845"

OLEObject readArguments2
readArguments2 = CREATE OLEObject
readArguments2.ConnectToNewObject("OpcLabs.EasyOpc.UA.OperationModel.UAReadArguments")
readArguments2.EndpointDescriptor.UrlString = "http://opcua.demo-this.com:51211/UA/SampleServer"
readArguments2.NodeDescriptor.NodeId.ExpandedText = "nsu=http://test.org/UA/Data/ ;i=10853"

OLEObject readArguments3
readArguments3 = CREATE OLEObject
readArguments3.ConnectToNewObject("OpcLabs.EasyOpc.UA.OperationModel.UAReadArguments")
readArguments3.EndpointDescriptor.UrlString = "http://opcua.demo-this.com:51211/UA/SampleServer"
readArguments3.NodeDescriptor.NodeId.ExpandedText = "nsu=http://test.org/UA/Data/ ;i=10855"

OLEObject readArgumentsList
readArgumentsList = CREATE OLEObject
readArgumentsList.ConnectToNewObject("OpcLabs.BaseLib.Collections.ElasticVector")
readArgumentsList.Add(readArguments1)
readArgumentsList.Add(readArguments2)
readArgumentsList.Add(readArguments3)

// Obtain attribute data. 
OLEObject attributeDataResultList
attributeDataResultList = client.ReadList(readArgumentsList)

// Display results
Int i
FOR i = 0 TO attributeDataResultList.Count - 1
    OLEObject attributeDataResult
    attributeDataResult = attributeDataResultList.Item[i]
    IF attributeDataResult.Succeeded THEN
        mle_outputtext.Text = mle_outputtext.Text + "AttributeData: " + String(attributeDataResult.AttributeData) + "~r~n"
    ELSE
        mle_outputtext.Text = mle_outputtext.Text + "*** Failure: " + attributeDataResult.ErrorMessageBrief + "~r~n"
    END IF    
NEXT

// Example output:
//
//AttributeData: 51 {System.Int16} @11/6/2011 1:49:19 PM @11/6/2011 1:49:19 PM; Good
//AttributeData: -1993984 {System.Single} @11/6/2011 1:49:19 PM @11/6/2011 1:49:19 PM; Good
//AttributeData: Yellow% Dragon Cat) White Blue Dog# Green Banana- {System.String} @11/6/2011 1:49:19 PM @11/6/2011 1:49:19 PM; Good            
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also