NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand GPIB Introduction

Hello,

 

I am looking at automation options for some of our equipment and decided that I would try TestStand out.  I am a bit familiar with GPIB and have successfully communicated to my instruments using the Measurement & Automation Explorer. Now I am wondering how can I do the same thing in TestStand.  Is there a default GPIB driver that I can use to initialize a GPIB instrument, write a SCPI string to it, and query/read results? 

 

I am new to TestStand and also not overly familiar with Labview.  If anyone can share example scripts that would greatly help as well :).  Thank you in advance for the help.

0 Kudos
Message 1 of 4
(4,439 Views)

If you have a IVI driver available for the instrument that you are using then you can directly use the TestStand IVI step type .Refer TestStand IVI examples.

 

If its not available then you may need to develop it in Labview or CVI ( Check GPIB examples in labview or CVI).

 You can reuse them and call it from TestStand.

0 Kudos
Message 2 of 4
(4,424 Views)

I can suggest you two options,

 

Option 1:
- Download LabVIEW Trial version

- Inall NI GPIB 488.2 Driver
- Open GPIB Examples; learn it and create one
- Add LabVIEW adapter and import your *.vi from TestStand to establish a GPIB commmunicaton

 

Option 2:
- Download & install Visual Studio C# Express edition
- Create new project as Class Library
- Add National Instruments 488.2 as Reference
- Write .Net code as below with correrct GPIB command(s) as per your instrument; compile them with no error which will create a DLL
- In TestStand, add .Net adapter and import your *.dll; assign all the input parameters

 

Sample C# Code:

 

namespace InstrumentComm
{
    
    public class PowerSupplyGPIBComm
    {
        public Device device;
       
        public void SetVoltage(int boardNumber, int primaryAddress, string VoltageValueIn)
        {
            //Configure the GPIB Device
            device = new Device(boardNumber, (byte)primaryAddress);
            //Send command to Set Voltage value
            device.Write("VSET " + VoltageValueIn + "; OUT ON");
        }
    }

}

NOTE: To do either option, you need to have NI GPIB Drivers needs to be installed with .Net Application Support

 

Thanks,
BlessingStar

0 Kudos
Message 3 of 4
(4,369 Views)

Thank you for your help!  I will try this out.

0 Kudos
Message 4 of 4
(4,329 Views)