vb.netgpib

Opening and closing a NI device over GPIB


I'm currently working on a project where we're doing some automated testing.

We're using a Rohde and Schwarz Vector Network Analyzer to do our testing, and the interface it provides for communication is GPIB. On my laptop it simply plugs in as USB.

How can I communicate with it in VB?

Thanks!


Solution

  • You will need to download and install the national instruments drivers for the USB GPIB connector. The DLL you will need to include is NationalInstruments.NI4882.dll. Once you install that there are usually example projects. Then you just need to look up the GPIB commands for each of your devices (the Network Analyzer). Then just send commands via your code to control the device. GPIB Instrument Automation for Metrology Test and Measurement might be a good start.

    For the Rohde and Schwarz Vector Network Analyzer, you can find the manual here. Then in each section you will see "Remote Command(s)". These are the commands you will need to send via the national instruments driver from your code to the device. For example:

    public void WriteCommand(string command)
    {
       device.Write(command);
    }
    
    // Where you want to write the command
    WriteCommand("DISPlay:THEMe:SELect"); // Select a theme