Passing Parameters to LabWindows/CVI Code Modules

The following table lists the variables the ATML TD translator passes to a LabWindows/CVI code module:

Variable Name Value Description Comments
seqContextCVI RunState.ThisContext CAObjHandle The translator passes the SeqContextCVI parameter so you can access any variable in TestStand from the generated LabWindows/CVI code module.
<Parameter> element <Parameter> elements are [In] parameters.
<TestResult> or <SessionDatum> element <TestResult> and <SessionDatum> elements are [In/Out] parameters.
PassFailResult Step.Result.PassFail long* A Boolean that indicates if the test passed or failed. The translator passes the PassFailResult parameter to the code modules only if the translated step is a Pass/Fail Test step.
errorOccurred Step.Result.Error.Occurred long* Boolean variable to set if an error occurs in the code module.
errorCode Step.Result.Error.Code long* Number that indicates the code of the error that occurred.
errorMsg Step.Result.Error.Msg char[1024] String that indicates the error message.

The translator passes the following parameters of the step created for an <Action> element to the code modules by value:

  • The translator passes each string type parameter as a const char *.
  • The translator passes <TestResult> and <SessionDatum> elements to code modules as pointers so you can set and return the value to TestStand.
  • If the <TestResult> or <SessionDatum> element contains a <DatumDescription> child element with an xsi:type attribute value of stringDescription, the translator passes the parent <TestResult> or <SessionDatum> element as char [1024].
  • The translator passes each Boolean value as long.
  • Some types, such as dateTime and complex, have strict type definitions and are available in ATMLCVITypes.h, which is located in the <TestStand>\Components\Translators\ATMLTDTranslator\CodeModule Templates\CVI directory. The translator passes these types to the code modules as structures.
  • The translator passes any other type that does not have a strict type definition as a CAObjHandle.

If the total number of [In] and [Out] parameters to pass to the LabWindows/CVI function is 32 or fewer, the translator places the local variable it creates for <Parameter>, <TestResult>, and <SessionDatum> elements under the Locals for the sequence. If the total number of parameters exceeds 32, the translator creates a container under the Locals for the sequence, names the container actionName_Parameters, actionName_TestResults, or actionName_SessionData, respectively, and passes the container to the function as an object reference. The actionName is the value of the name attribute of the parent <Action> element.