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



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA.ComTypes Namespace > _EasyUAClient Interface : WriteValueList 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).

Writes values into multiple attributes, using array of argument objects as an input (status codes and timestamps are not written).
Syntax
'Declaration
 
<JetBrains.Annotations.NotNullAttribute()>
Function WriteValueList( _
   ByVal writeValueArgumentsList As IList _
) As _ElasticVector
'Usage
 
Dim instance As _EasyUAClient
Dim writeValueArgumentsList As IList
Dim value As _ElasticVector
 
value = instance.WriteValueList(writeValueArgumentsList)
[JetBrains.Annotations.NotNull()]
_ElasticVector WriteValueList( 
   IList writeValueArgumentsList
)
[JetBrains.Annotations.NotNull()]
_ElasticVector^ WriteValueList( 
   IList^ writeValueArgumentsList
) 

Parameters

writeValueArgumentsList

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.UAWriteResult. The method returns an array of OpcLabs.EasyOpc.UA.OperationModel.UAWriteResult objects. The indices of elements in the output array are the same as those in the input arrays.

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.

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.

This is an extension method (info: C#, VB.NET). In languages that have support for extensions methods (such as C# and VB.NET), you can use the extension method as if it were a regular method on the object that is its first parameter. In other languages (such as with Python.NET), you will call the extension as a static method, and pass it the object on which it acts as its first parameter.

Example

COM

// This example shows how to write values into 3 nodes at once, test for success of each write and display the exception 
// message in case of failure.

mle_outputtext.Text = ""

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

// Prepare arguments. 

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

OLEObject writeValueArguments2
writeValueArguments2 = CREATE OLEObject
writeValueArguments2.ConnectToNewObject("OpcLabs.EasyOpc.UA.OperationModel.UAwriteValueArguments")
writeValueArguments2.EndpointDescriptor.UrlString = "http://opcua.demo-this.com:51211/UA/SampleServer"
writeValueArguments2.NodeDescriptor.NodeId.ExpandedText = "nsu=http://test.org/UA/Data/ ;i=10226"
writeValueArguments2.Value = "This string cannot be converted to Double"

OLEObject writeValueArguments3
writeValueArguments3 = CREATE OLEObject
writeValueArguments3.ConnectToNewObject("OpcLabs.EasyOpc.UA.OperationModel.UAwriteValueArguments")
writeValueArguments3.EndpointDescriptor.UrlString = "http://opcua.demo-this.com:51211/UA/SampleServer"
writeValueArguments3.NodeDescriptor.NodeId.ExpandedText = "nsu=http://test.org/UA/Data/ ;s=UnknownNode"
writeValueArguments3.Value = "ABC"

OLEObject writeValueArgumentsList
writeValueArgumentsList = CREATE OLEObject
writeValueArgumentsList.ConnectToNewObject("OpcLabs.BaseLib.Collections.ElasticVector")
writeValueArgumentsList.Add(writeValueArguments1)
writeValueArgumentsList.Add(writeValueArguments2)
writeValueArgumentsList.Add(writeValueArguments3)

// Modify value of nodes

OLEObject operationResultList
operationResultList = client.WriteValueList(writeValueArgumentsList)

// Display results
Int i
FOR i = 0 TO operationResultList.Count - 1
    OLEObject operationResult
    operationResult = operationResultList.Item[i]
    IF operationResult.Succeeded THEN
        mle_outputtext.Text = mle_outputtext.Text + "Result " + String(i) + ": success" + "~r~n"
    ELSE
        mle_outputtext.Text = mle_outputtext.Text + "Result " + String(i) + ": " + operationResult.Exception.GetBaseException().Message + "~r~n"
    END IF    
NEXT

mle_outputtext.Text = mle_outputtext.Text + "~r~n" 
mle_outputtext.Text = mle_outputtext.Text + "Finished." + "~r~n" 
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