Example Legacy LabWindows/CVI Code Module

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)

When you create a legacy code module for the LabWindows/CVI Adapter, you must add the stdtst.h header file located in the <TestStand Public>\AdapterSupport\CVI directory to the source file. The stdtst.h file includes the type definitions for the tTestData and tTestError structures.

The following is an example code module that uses the LabWindows/CVI standard prototype:

// Simple test example

#include "stdtst.h"

void TX_TEST __declspec(dllexport) FunctionName (tTestData *testData, tTestError *testError)

{

int error = 0;

double measurement = 5.0;

char *lastUserName = NULL;

testData->measurement = measurement;

if ((error = TS_PropertyGetValString (testData->seqContextCVI, NULL, "StationGlobals.TS.LastUserName", 0, &lastUserName)) < 0) goto Error;

Error:

// FREE RESOURCES

CA_FreeMemory(lastUserName);

// Set the error flag to cause a run-time error

if (error < 0)

{

testError->errorFlag = TRUE;

testError->errorCode = error;

testData->replaceStringFuncPtr(&testError->

errorMessage, "ErrorText");

}

}


See Also

tTestData Structure

tTestError Structure

Updating Step Properties

WAS THIS ARTICLE HELPFUL?

Not Helpful