DanaFosmer.com
  • Test Engineering
  • Electrical Engineering
  • Projects and Code
  • Archives
  • About

TestStand - Instrument Handle

3/25/2016

0 Comments

 
​Today I’m going to show a good way to add an instrument handle to a TestStand sequence. I’m using a VISA USB instrument, the Keysight U2001A power sensor. I’ve written about this instrument before.
 
First I’m going to create a little VI that will call the initialization driver of the U2001A power sensor. You can see in Figure 1 that there is a VISA resource name that is specific to this instrument. The issue with this is when this VI is called in TestStand the string has to be saved in the sequence file and it can only ever use that specific instance of the power sensor or else we have to modify the sequence file. 
Picture
Figure 1. VI with a VISA Resource Name Instrument Handle
​In TestStand it would look as shown in Figure 2. Either the Device Name is set as a hard-coded string or it is set to default from the VI that contains a hard-coded string.
Picture
Figure 2. Hard-coding an instrument handle into your sequence can be problematic.
​A better way to do it is to set an alias for power sensor in NI-MAX and then put that alias into your VI and sequence. Figure 3 shows setting an alias in NI-MAX in the Name field.
Picture
Figure 3. Creating and instrument alias in NI MAX.
​Now in the sequence file, there is a special variable type just for this purpose called LABVIEWIOControl and the DeviceName property of it is set to the alias of KS-U2001A. The SessionNumber property should stay at zero. This is shown in Figure 4.
Picture
Figure 4. Assigning the instrument alias to a LabVIEWIOControl variable contained in a TestStand sequence.
​Going down to look at the module adaptor shown in Figure 5, the local variable is set to the new KSU2001A variable. This could also be a good variable to make global, that way you can access this instrument in any sequence or sub-sequence.
Picture
Figure 5. Set the new LabVIEWIOControl variable to the input of the VI in the adapter. (Also, consider making this a global rather than a local)

Summary

​In this post I went over how to use NI MAX to create a VISA resource name alias to be used by a sequence file to access and instrument. The advantage of this is you do not have to change the specific VISA name stored in your sequence file to match the specific instance of the instrument connected to the computer running the test sequence. However, you still have to create the same alias in NI MAX for that instrument on any computer that will run the sequence file.

Source Code

Find the source code for this post here
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Archives

    December 2022
    September 2018
    March 2017
    March 2016
    October 2014
    March 2014
    August 2013
    July 2013
    August 2011
    July 2011
    February 2011
    November 2010
    October 2010
    August 2010
    June 2010
    February 2010
    January 2010

    Categories

    All
    Hardware Characterization
    Labview
    Projects
    Python
    Quality
    Test Fundamentals
    Test Hardware
    TestStand

    RSS Feed

    View my profile on LinkedIn
  • Test Engineering
  • Electrical Engineering
  • Projects and Code
  • Archives
  • About