IUANode.ChildrenRemoteRead(childVariables, timeoutMilliseconds)
Returns a list of all the variables of interest children of the node on which it invokes. The optional argument sets the timeout period.
IEnumerable<RemoteChildVariableValue> ChildrenRemoteRead(IEnumerable<RemoteChildVariable> childVariables, double timeoutMilliseconds);
Arguments
childVariables(IEnumerable<RemoteChildVariable>)- The list of the variables of interest, expressed as relative paths inside the node on which the API is invoked.
-
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).
Returns
-
IEnumerable<RemoteChildVariableValue> -
The list of variables of interest, expressed as a pair of the
RemoteChildVariableValueclass.RelativePath(string)- The path relative to the variable inside the node.
Value(UAValue)- The value of the variable.
Example
The following example shows an API that returns a reads list that contains the variables of interest contained in the myNode node. The two variables of interest were added in the myVariables list: one directly the child of the node (Tag1) and the other inside a child node (NestedStructure/Tag2).
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 myVariables = new List<RemoteChildVariable>()
{
new RemoteChildVariable("Tag1"),
new RemoteChildVariable("NestedStructure/Tag2")
};
var myNode = Project.Current.Get("CommDrivers/Driver1/Station1/Tags/TagStructure1");
try
{
var reads = myNode.ChildrenRemoteRead(myVariables);
}
catch (Exception ex)
{
Log.Error("ChildrenRemoteRead failed: " + ex.ToString());
}
