Generating Output Messages

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)

Purpose

This example demonstrates how to generate output messages using the OutputMessage expression function and the Engine.NewOutputMessage and OutputMessage.Post methods of the TestStand API. The Output pane of the TestStand Sequence Editor displays the messages.

Example File Location


Open Example

<TestStand Public>\Examples\TestStand Debugging Features\Generating Output Messages\Generating Output Messages.seq

Highlighted Features

Major API

Prerequisites

(LabVIEW) You must have the LabVIEW development system installed and you must configure the LabVIEW Adapter to use the LabVIEW development system.

(LabWindows/CVI)You must have the LabWindows/CVI Run-Time Engine installed and you must configure the LabWindows/CVI Adapter to execute steps in-process. If you want to use the Execute Steps in an External Instance of CVI option, you must have the LabWindows/CVI development environment installed.

How to Use This Example

LabVIEW Action Step

Open OutputMessageExample.vi, located in the <TestStand Public>\Examples\TestStand Debugging Features\Generating Output Messages directory, and switch to the block diagram, which describes the following functionality for the VI:

  • The invoke node labeled IEngine invokes the Engine.NewOutputMessage method.
  • Parameters that enter the VI determine the sequence for which the message is intended and the content, category, and severity of the message.
  • The subsequent property nodes specify color and icon name.
  • The final invoke node invokes the OutputMessage.Post method to display the output message on the Output pane in the sequence editor

LabWindows/CVI Action Step

The LabWindows/CVI Action step calls a LabWindows/CVI DLL named GenerateOutputMessages.dll, located in the <TestStand Public>\Examples\TestStand Debugging Features\Generating Output Messages directory.

Select the Generate Output Messages using a CVI Module step and click the LabWindows/CVI Module tab on the Step Settings pane, which describes the following functionality for the LabWindows/CVI step:

  • The Module control specifies GenerateOutputMessages.dll.
  • The Function control specifies the GenerateOutputMessages function.
  • The Parameters table lists the parameters the DLL accepts. The SeqContextCVI parameter accepts the sequence context, and the other parameters handle errors or log information for inclusion in the report.

Statement Step

The Statement step is the simplest way to generate output messages. Select the Generate Output Message using a Statement step step and click the Expression edit tab on the Step Settings pane, which describes the following functionality for the Statement step:

  • The expression specifies a simple comparison to determine if the RunState.LoopIndex value is a multiple of 10. If true, the modulus 10 operation evaluates to 0, and TestStand calls the OutputMessage function.
  • The parameters of the OutputMessage function accept a message and a severity, and specify the font color and icon to display with the message.

ActiveX/COM Steps

The final step in the MainSequence is a Sequence Call step that calls the Using ActiveX Adapter steps sequence. Select the Using ActiveX Adapter steps on the Sequences pane to display the steps in the Using ActiveX Adapter steps sequence, which describes the following functionality:

  • A For loop contains all the steps in the sequence. The If step specifies that the steps execute during only every tenth iteration through the loop.
  • The New Output Message step creates the output message by calling the Engine.NewOutputMessage method. This step also specifies the message text, category, and severity and obtains a reference to the sequence context.
  • The Set Text Color step uses the Set Property option on the TextColor property to change the message font color to cyan.
  • The Set Icon Name step specifies the icon to display next to the message.
  • The Post Output Message step invokes the OutputMessage.Post method to display the output message on the Output pane. Simply creating the message using the Engine.NewOutputMessage method is insufficient.

WAS THIS ARTICLE HELPFUL?

Not Helpful