PutValueAsync
Syntax
void putValueAsync(EnvVarName, int val); // form 1
void putValueAsync(EnvVarName, float val); // form 2
void putValueAsync(EnvVarName, char val[]); // form 3
void putValueAsync(EnvVarName, byte val[], long vSize); // form 4
Function
Assigns the valuevalto the environment variable with identifierEnvVarName. Integers are assigned to discrete environment variables (form 1), floating point numbers are assigned to continuous environment variables (form 2). The content of a character string is assigned to character string environment variables (form 3). For data byte environment variables (form 4) the bytes of the data buffer are copied into the environment variable. The assignment is executed asynchronously. Whenmeasurement setup parallelizationis activated, other branches in the measurement setup will see the new value earlier or later than the branch where the function is called. In contrast toputValue,putValueAsyncdo not prevent a measurement setup branch from being parallelized.
Parameters
EnvVarName Environment variable name.Must exist in the database.
vSize
New value of environment variable (form 1, 2) or buffer with new data (form 3, 4).
val
New value of environment variable (form 1, 2) or buffer with new data (form 3, 4).
Return Values
—
byte dataBuf[64];...// Assign the value 0 to environment variable SwitchputValueAsync(Switch, 0);// Assign the value 22.5 to environment variable TemperatureputValueAsync(Temperature, 22.5);// Assign the value Master to environment variable NodeNameputValueAsync(NodeName, "Master");// Copy 64 bytes of the data buffer into the environment variable DiagDataputValueAsync(DiagData, dataBuf, 64);...
putValue | getValueSize | Direct access to values from system variables