InformationModel.RemoteWrite(variableValues, timeoutMilliseconds)

Writes the values in the variables on interest. The second optional argument sets the timeout period.

static void RemoteWrite(IEnumerable<RemoteVariableValue> variableValues, double timeoutMilliseconds);

Arguments

variableValues (IEnumerable<RemoteVariable>)
The list of the variable values that 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

In the following example, the values of two tag variables are written: the 0 value for the tag3 variable, and the 123 value for the tag1 variable. The variables of interest are included and searched with the Get() method in the remoteVariableValues list, which is passed as argument of the RemoteWrite() method.
var tag1 = Project.Current.Get<Tag>("CommDrivers/CodesysDriver1/CodesysStation1/Tags/Application/PLC_PRG/VAR1");
var tag3 = Project.Current.Get<Tag>("CommDrivers/CodesysDriver1/CodesysStation1/Tags/Application/PLC_PRG/VAR3");

var remoteVariableValues = new List<RemoteVariableValue>()
{
    new RemoteVariableValue(tag3, 0),
    new RemoteVariableValue(tag1, 123)
};
InformationModel.RemoteWrite(remoteVariableValues);