Example Programs

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Custom Steps Types for TestStand

Overview

 

 The VISA step types are an example of custom steps that integrate TestStand with VISA devices.  This example provides a set of new steps that allow TestStand to perform basic VISA operations such as Read, Write, and Configure Serial Port without additional code. The VISA steps use substeps called using the LabWindows™/CVI Adapter to communicate with a DLL created with  LabWindows™/CVI.  

If you need to perform more sophisticated VISA tasks, you can use the NI-VISA built-in functions available in LabVIEW or LabWindows™/CVI to develop your code.  This example requires the NI-VISA driver.

 

Description

 

The VISA step types use the NI-VISA driver functions to perform basic VISA operations.  This example uses the  LabWindows™/CVI adapter and the source code is provided. The VISA steps can be configured for any VISA device.  Each step type provides a configuration dialog to set the parameters at edit-time for the VISA call using an edit substep defined in the step type.  When the step is executed, the VISA call is implemented in a post-step substep.

 

 

 

Note: These step types are compatible with 32-bit versions of TestStand only.  

 

The TestStand Step Types include:

  • VISA Open
  • VISA Config Serial Port
  • VISA Write
  • VISA Read
  • VISA Close

If you need to perform more sophisticated VISA tasks, create specific code modules using the NI-VISA built-in functions available in LabVIEW or LabWindows™/CVI to develop your code.

 

Visa Open

Opens a VISA session to a VISA Resource. To configure the VISA Open step, Right Click on the step » Configure VISA Open.

  • VISA Resource Name - String data type that specifies the VISA Resource Name. You can directly specify the string using VISA conventions or use TestStand string variables in this field.
  • VISA Resource Handle - Numeric data type used to store a handle to the current VISA session. This handle is used in all subsequent VISA steps.

 

VISA Config Serial Port

When the VISA session is a serial port, use this step to configure parameters of the serial port. To configure the VISA Config Serial Port, Right Click on the step » Configure VISA Serial Port.

  • VISA Resource Handle - Numeric data type used to define the current VISA session. This handle is created using the VISA Open Step.
  • Baud Rate - Used to define the current serial port transfer rate. You can enter any number; however, if the serial port does not support the specified speed an error is generated.
  • Flow Control - Used to define the current serial port flow control mode. You can select None, XON XOFF, RTS/CTS, or DTR/DSR.
  • Parity - Used to define the current serial port parity. You can select none, odd, even, mark, or space.
  • Data Bits - Used to define the current serial port data bits. You can select 8, 7, 6, or 5.
  • Stop Bits - Used to define the current serial port Stop Bits. You can select 1, or 2.
  • Termination Mode - Used to define the current serial port Termination Mode. You can select none or char. When you select char, you must specify the hex code of the termination char.
  • Termination Char - Used to define the current serial port termination char. This field is only used when Termination Mode is set to char. Enter the hex code of the termination char.

VISA Write

Allows basic Write operation to VISA sessions. To configure the VISA Write, Right Click on the step » Configure VISA Write.

  • VISA Resource Handle - Numeric data type used to define the current VISA session. This handle is created using the VISA Open Step.
  • Data - String data type that specifies the string to be sent to the VISA session. You can directly specify the string to send or use TestStand string variables in this field.

VISA Read

Allows basic Read operation to VISA sessions. To configure the VISA Read, Right Click on the step » Configure VISA Read.

  • VISA Resource Handle - Numeric data type used to define the current VISA session. This handle is created using the VISA Open Step.
  • Data - String data type used to store the data read from the VISA session.
  • Max Byte Count - Specifies the max number of bytes to read from the VISA Session.

VISA Close

Closes a VISA session. To configure the VIS Close step, Right Click on the step » Configure Close.

  • VISA Resource Handle - Numeric data type used to define the current VISA session. This handle is created using the VISA Open Step.

 

 

Hardware and Software Requirements

VISA Step Types for TestStand  - TS2013.zip

TestStand 2013 SP1 or Compatible (32-bit only)

 LabWindows™\CVI 2012 or compatible

 

Steps to Implement or Execute Code

 

Installing the VISA Step Types

  1. Unzip the Files to <TestStand Public>/Components/StepTypes/VISA
  2. Copy the Install_NI_VISATypes.ini to <TestStand Public>/Components/TypePalettes
  3. When you launch the sequence editor or a user interface, TestStand identifies files with the Install_ prefix and takes one of the following actions
    • If TestStand locates a type palette file in the type palette list with the same name, but without the Install_ prefix, TestStand merges the types in the Install_ prefix version of the file with the types in the existing file and then deletes the Install_ prefix version.
    • If TestStand locates a type palette file with the same name, but without the Install_ prefix, that is not included in the type palette list because a user explicitly excluded it, TestStand does not change the contents of either file.
  4. Copy the VISA.ico to <TestStand Public>/Components/Icons

 

Using the VISA Step Types

After installing the step types, a new "VISA" folder will appear in the insertion palette. You can insert these step types in a sequence in the same way as other TestStand steps

 

 

 

Al B.
Staff Software Engineer - TestStand
CTA/CLD
Contributors