Example Code

Change the Location of LabVIEW Front Panel based on Socket Index in TestStand

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Teststand

Code and Documents

Attachment

Description

Overview

This example provides a subVI that can be called in your code module that will position instances of your code modules based on the test socket of the calling sequence.   

 

Description

If you are not familiar with the parallel and batch process models in TestStand, read the following document before using this example:

TestStand Process Model Theory

This example demonstrates how you can use a code module to set the bounds for code module VIs based on its associated socket index.  When executing in the parallel batch model, each parallel execution has a unique 0-based socket index to identify it, accessible using this property

 

Runstate.TestSockets.MyIndex

 

By passing this property to the code module, the example code tiles each panel so it is clear which socket they are associated with.

 

2018-03-30_164803.png

 

The implementation for this positioning is located in the SetBoundsBySocket.vi, which can be copied and used in other applications. This subVI also updates the title of the panel to indicate the test socket.

 

Hardware and Software Requirements

Set Bounds By Test Socket - TS2012.zip

TestStand 2012 or Compatible

LabVIEW 2013 or Compatible

Set Bounds By Test Socket - TS2012.zip

TestStand 2016 or Compatible

LabVIEW 2016 or compatible

Steps to Implement or Execute Code

  1. Open the attached sequence file, and execute it using Execute » Single Pass.  The sequence file is configured to use the batch process model and will execute the sequence in 4 separate test sockets. 
  2. Observe that the code module is tiled such that you can see the front panel of each module 

 

Additional Information or References

 

Richard S -- National Instruments -- (former) Applications Engineer -- Data Acquisition with TestStand

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.