Hi,
There is an example in the TestStand examples, see AccessingPropertiesAndVariables.
This has been updated from TS1.0 with a note on what to do. below is snippit from example.
void TX_TEST DLLEXPORT AccessLocalVariables(tTestData *data,tTestError *testError)
{
VBOOL propertyExists;
ERRORINFO errorInfo;
int error = 0;
ErrMsg errMsg = {'\0'};
// Note: You do not have to call TS_PropertyExists if you know that the variable
// you are accessing exists.
// Note2: You can also create a new variable and sets its value
// with a single call by passing the TS_PropOption_InsertIfMissing option
// as the fourth parameter to TS_PropertySetValNumber, TS_PropertySetValString, or TS_PropertySetValBoolean
tsErrChk(TS_Propert
yExists(data->seqContextCVI, &errorInfo, "Locals.NumericValue", 0, &propertyExists));
if (propertyExists)
// This sets the local variable NumericValue to a random number.
// We use the tsErrChk macro defined in tsutil.h to perform error checking.
tsErrChk(TS_PropertySetValNumber(data->seqContextCVI, &errorInfo, "Locals.NumericValue", TS_PropOption_InsertIfMissing, (10 * rand()) / RAND_MAX));
I have modified the SetVal function in the snippit above.
regards
Ray Farmer
Regards
Ray Farmer
