sysSetVariableAsync
Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DEFunction Syntax
void sysSetVariableAsync(SysVarName, byte data[], long size); // form 1void sysSetVariableAsync(SysVarName, float value); // form 2void sysSetVariableAsync(SysVarName, float values[], long arraySize); // form 3void sysSetVariableAsync(SysVarName, long value); // form 4void sysSetVariableAsync(SysVarName, long values[], long arraySize); // form 5void sysSetVariableAsync(SysVarName, int64 value); // form 6void sysSetVariableAsync(SysVarName, char value[]); // form 7
Description
Assigns the given value (data, value or values[]) to the system variable with identifier SysVarName. The bytes of data buffers are copied to struct, generic data and byte array system variables (form 1). The content of a character string is copied to String system variables (form 7). Floating point or integer numbers and arrays are assigned to the corresponding types of system variables (form 2 – 6). The assignment is executed asynchronously. When measurement setup parallelization is 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 tosysSetVariable* functions, sysSetVariableAsync do not prevent a measurement setup branch from being parallelized.
Note
sysSetVariableAsync is useful to set system variables during the simulation and read their value using the System COM object after the simulation has been stopped. For this purpose, system variables have to be configured to be used for analysis only.
The sysSetVariableAsync function can also be used for specific elements of a system variable of type struct or generic array. For this, add the element to the name of the variable. If you directly give the element name to the function instead of using strings, precede the name by sysvarMember:: instead of sysvar::.
Example
sysvarMember::XCP::ECU_2::KL2.Curve2[0]
Parameters
- SysVarName: System variable name. Must exist in the database.
- data, value or values[]: New value for the system variable (form 1, 2) or buffer with new data (form 3, 4).
- size: The number of bytes to be copied (form 1).
- arraySize: The number of elements to be copied (form 3, 5).