Creating LabWindows/CVI Code Modules for <Behavior> Elements

TestStand ATML Toolkit 2017 Help

Edition Date: June 2018

Part Number: 374205B-01

»View Product Info
Download Help (Windows Only)

The ATML TD translator creates a LabWindows/CVI project using the path you specified in the LabWindows/CVI Project File Path control on the Code Module Settings tab of the ATML Test Description Translator Configuration dialog box and adds the generated source file, header file, and default TestStand instrument files to the project. The translator configures the paths of the LabWindows/CVI project file, source file, and the DLL as relative paths in the generated TestStand step.

The translator creates a LabWindows/CVI source file, creates a function for each <Action> parent element, names the function using the name attribute of the <Action> element, and inserts the function in the LabWindows/CVI code module. The translator then creates comments that begin with the string <ATMLTranslatorComment> for the <AutomaticGeneration>, <Description>, <Extension>, <IeeeStd1641>, or <Operations> child elements of the <Behavior> element and adds the comments to the function.

Completing the Partial Test Program Completing the Partial Test Program  You must manually implement the logic that the <AutomaticGeneration>, <Description>, <Extension>, <IeeeStd1641>, and <Operations> elements describe. Refer to the post-translation recommended actions section of the log file for more information about the elements you must implement.

The translator configures the path of the DLL project to be relative to the sequence file. The translator passes all the <Parameters>, <TestResults>, and <SessionData> elements of the corresponding <Action> element to the function.

The translator passes parameters as local variables or as a single container to the LabWindows/CVI code module.

Note Note  The translator does not build the LabWindows/CVI code module project. You must manually build the LabWindows/CVI project and generate the DLL before you run the sequence file.
Caution Caution  The translator opens LabWindows/CVI to generate code as the translation progresses. Closing LabWindows/CVI while translating a TD instance document can cause the translator to stop translation.

If a source file already exists at the path you specified and the file contains a function with a name that matches the value of the name attribute of the parent <Action> element, the translator updates existing comments in the function. If the function does not exist, the translator creates a new source file.

Incremental Update Incremental Update  The translator incrementally updates existing comments that correspond to the <AutomaticGeneration>, <Description>, <Extension>, <IeeeStd1641>, and <Operations> child elements of the <Behavior> element, as the following table describes.



Note Note  If you modified the LabWindows/CVI project after the original translation but you attempt to incrementally update the project, you must verify that the project compiles without any errors before you update.
Change in Source TD Instance Document Incremental Update Behavior
You modify the <AutomaticGeneration>, <Description>, <Extension>, or <IeeeStd1641> child element of the <Behavior> element. The translator updates the function comment that corresponds to the element you modified to use the new XML from the source TD instance document.
You delete a child element of the <Behavior> element in the source TD instance document and insert a different child element of the <Behavior> element. For example, you delete a <Description> child element and insert an <Operations> child element. The translator deletes the function comment that corresponds to the element you deleted and creates a new function comment for the element you created.
You add or modify a <Behavior>/<Operations>/<Operation> element. The translator adds or modifies the function comment that corresponds to the <Operation> element you added or modified.
You delete any <Behavior>/<Operations>/<Operation> element. The translator deletes the function comment that corresponds to the <Operation> element you deleted from the source TD instance document.
Note Note  The translator incrementally updates comments only when the text of the comment begins with the string <ATMLTranslatorComment> and the XML in the comment is valid. If you modify the comment after a previous translation but before you attempt an incremental update and the XML content in the label is invalid, the translator replaces the invalid XML content with the valid XML content from the source TD instance document.

If you disable the Delete Previously Generated Sequence File and Code Module Constructs option on the General Settings tab of the ATML Test Description Translator Configuration dialog box, the translator does not delete comments or parameters during an incremental update.

See Also

<Action> Element

ATML Test Description Translator Configuration dialog box

Logging Translation Information

<Parameters> Element

Passing Parameters to LabWindows/CVI Code Modules

<SessionData> Element

<TestResults> Element

WAS THIS ARTICLE HELPFUL?

Not Helpful