IUANode.ChildrenRemoteWrite(childVariableValues, timeoutMilliseconds)

Writes the values of the variables of interest children of the node on which it invokes. The optional argument sets a timeout period.

void ChildrenRemoteWrite(IEnumerable<RemoteChildVariableValue> childVariableValues, double timeoutMilliseconds);

Arguments

childVariableValues (IEnumerable<RemoteChildVariableValue>)
The list of the variables with the value you want to write, expressed as a pair of the RemoteVariableValue class following properties:
Variable (IUAVariable)
The variable.
Value (UAValue)
The value of the variable.
timeoutMilliseconds (double)
The timeout period, expressed in milliseconds, after which the API throws an exception.
Tip: If not specified, the default value of the argument is 30000 (30 seconds).

Example

The following example shows an API that writes the values of the variables defined in the valuesToWrite list and contained in the myNode node. For each variable in the valuesToWrite list, the first argument indicated is the relative path of the variable, and the second argument is the value to write.

If the API returns an error or if the set timeout time is reached, the code in the following example generates an error message composed of ChildrenRemoteRead failed: and an expected error code for the API.

var valuesToWrite = new List<RemoteChildVariableValue>()
{
    new RemoteChildVariableValue("Tag1", 4),
    new RemoteChildVariableValue("Tag2", "Hello world"),
    new RemoteChildVariableValue("Tag3", true),
    new RemoteChildVariableValue("NestedStructure/Tag1", 5.9)
};
var myNode = Project.Current.Get("CommDrivers/Driver1/Station1/Tags/TagStructure1");
try
{
    myNode.ChildrenRemoteWrite(valuesToWrite);
}
catch (Exception ex)
{
    Log.Error("ChildrenRemoteWrite failed: " + ex.ToString());
}