Skip to content

Reference

IOpcWriteNodesService Members

Defines a specialized IOpcService<TResponse, TRequest> which can be used to write values to one or more attributes (see OpcAttribute) of one or more nodes.

Reference

IOpcWriteNodesService Members ​

Type
IOpcWriteNodesService
Namespace
Opc.UaFx.Services
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Also in
Opc.UaFx.Client

Inherits members from IOpcService<OpcWriteNodesResponse, OpcWriteNodesRequest>.

Properties ​

MaxNodesPerWrite ​

since v2.9

Gets or sets the maximum number of nodes which shall be written using a single write request. This number indirectly defines the number of requests used to send a specific number of write requests to the server.

csharp
uint? MaxNodesPerWrite { get; set; }
vbnet
Property MaxNodesPerWrite As UInteger?

Property value

Nullable<UInt32>

The absolute number of write commands which shall be send to the server per request or a null reference (Nothing in Visual Basic). In case there a specific number of nodes is used, a request with more commands as the MaxNodesPerWrite is partitioned into multiple requests and the responses of them are accumulated. The default value of this property is a null reference (Nothing in Visual Basic) and means that all commands defined are send to the server using the server defined number of nodes per write request.

TimestampSource ​

Gets or sets the OpcTimestampSource to use to prepare OpcValue timestamp values before sending a write request to a server.

csharp
OpcTimestampSource? TimestampSource { get; set; }
vbnet
Property TimestampSource As OpcTimestampSource?

Property value

Nullable<OpcTimestampSource>

One of the members defined by the OpcTimestampSource enumeration; otherwise a null reference (Nothing in Visual Basic). In case there the value is null reference (Nothing in Visual Basic) there will be tried to automatically determine the timestamp sourcing to match the needs of the server. The default value of this property is a null reference (Nothing in Visual Basic).

UsedMaxNodesPerWrite ​

since v2.9

Gets the maximum number of nodes which are written using a single write request. This property will use either the MaxNodesPerWrite or the maximum number of nodes which can be written in one request as defined by the server. The lowest number of nodes is used to partition the commands to execute into multiple write requests.

csharp
uint? UsedMaxNodesPerWrite { get; }
vbnet
ReadOnly Property UsedMaxNodesPerWrite As UInteger?

Property value

Nullable<UInt32>

In case there has already been one write attempt (with more than one write command) the definite number of commands per write request; otherwise a null reference (Nothing in Visual Basic).

UsedTimestampSource ​

Gets the OpcTimestampSource currently used to prepare OpcValue timestamp values before sending a write request to a server. In case there TimestampSource is a null reference (Nothing in Visual Basic) this property will define the OpcTimestampSource automatically determined during the first write attempt which does write an OpcValue of the Value attribute.

csharp
OpcTimestampSource? UsedTimestampSource { get; }
vbnet
ReadOnly Property UsedTimestampSource As OpcTimestampSource?

Property value

Nullable<OpcTimestampSource>

In case there has already been one write attempt to a Value attribute the definite timestamp source; otherwise a null reference (Nothing in Visual Basic).

Methods ​

WriteNodes ​

2 overloads

OverloadDescription
WriteNodes(IEnumerable<OpcWriteNode>)Writes one or more values to one or more attributes of one or more nodes using the specified commands.
WriteNodes(params OpcWriteNode[])Writes one or more values to one or more attributes of one or more nodes using the specified commands.

Exceptions (all overloads)

ExceptionCondition
InvalidOperationExceptionThe write service is currently not supported, especially using the commands specified.
OpcExceptionThe service execution failed upon different circumstances; for more details see exception details. The following issues can lead to that exception: BadNothingToDo and BadTooManyOperations.

WriteNodes(IEnumerable<OpcWriteNode>) ​

Writes one or more values to one or more attributes of one or more nodes using the specified commands.

csharp
OpcStatusCollection WriteNodes(IEnumerable<OpcWriteNode> commands)
vbnet
Function WriteNodes(
    commands As IEnumerable(Of OpcWriteNode)) As OpcStatusCollection

Parameters

NameTypeDescription
commandsIEnumerable<OpcWriteNode>A sequence of OpcWriteNode instances to process.

Returns

OpcStatusCollection

An instance of the OpcStatusCollection its number and order of items matches the number and order of items in the commands sequence. There is for each command one entry which indicates the outcome of the operation for that command.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe commands sequence or one of its items is a null reference (Nothing in Visual Basic).

Remarks

Known results for the commands specified are:

StatusDescription
GoodCompletesAsynchronouslyThe value was successfully written to an intermediate system but the Server does not know if the data source was updated properly.
BadNodeIdInvalidFor more details see BadNodeIdInvalid.
BadNodeIdUnknownFor more details see BadNodeIdUnknown.
BadAttributeInvalidFor more details see BadAttributeInvalid.
BadIndexRangeInvalidFor more details see BadIndexRangeInvalid.
BadIndexRangeNoDataFor more details see BadIndexRangeNoData.
BadWriteNotSupportedThe requested write operation is not supported. If a client attempts to write any value, quality, timestamp combination and the server does not support the requested combination (which could be a single quantity such as just timestamp), then the Server shall not perform any write on this node and shall return this status for that node.
BadNotWritableFor more details see BadNotWritable.
BadUserAccessDeniedFor more details see BadUserAccessDenied.
BadOutOfRangeIf a client attempts to write a value outside the valid range like a value not contained in the enumeration data type of a node, the server shall return this status for that node.
BadTypeMismatchFor more details see BadTypeMismatch.
BadDataEncodingUnsupportedFor more details see BadDataEncodingUnsupported.
BadNoCommunicationFor more details see BadNoCommunication.

WriteNodes(params OpcWriteNode[]) ​

Writes one or more values to one or more attributes of one or more nodes using the specified commands.

csharp
OpcStatusCollection WriteNodes(params OpcWriteNode[] commands)
vbnet
Function WriteNodes(
    ParamArray commands As OpcWriteNode()) As OpcStatusCollection

Parameters

NameTypeDescription
commandsparams OpcWriteNode[]An array of OpcWriteNode instances to process.

Returns

OpcStatusCollection

An instance of the OpcStatusCollection its number and order of items matches the number and order of items in the commands. There is for each command one entry which indicates the outcome of the operation for that command.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe commands array or one of its items is a null reference (Nothing in Visual Basic).

Remarks

Known results for the commands specified are:

StatusDescription
GoodCompletesAsynchronouslyThe value was successfully written to an intermediate system but the Server does not know if the data source was updated properly.
BadNodeIdInvalidFor more details see BadNodeIdInvalid.
BadNodeIdUnknownFor more details see BadNodeIdUnknown.
BadAttributeInvalidFor more details see BadAttributeInvalid.
BadIndexRangeInvalidFor more details see BadIndexRangeInvalid.
BadIndexRangeNoDataFor more details see BadIndexRangeNoData.
BadWriteNotSupportedThe requested write operation is not supported. If a client attempts to write any value, quality, timestamp combination and the server does not support the requested combination (which could be a single quantity such as just timestamp), then the Server shall not perform any write on this node and shall return this status for that node.
BadNotWritableFor more details see BadNotWritable.
BadUserAccessDeniedFor more details see BadUserAccessDenied.
BadOutOfRangeIf a client attempts to write a value outside the valid range like a value not contained in the enumeration data type of a node, the server shall return this status for that node.
BadTypeMismatchFor more details see BadTypeMismatch.
BadDataEncodingUnsupportedFor more details see BadDataEncodingUnsupported.
BadNoCommunicationFor more details see BadNoCommunication.