Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling a spectrum analyzer connected to gpib/ethernet using linux

Hello all,

I want to communicate with a spectrum analyzer (HP8563E) connected to a national Instruments GPIB/Ethernet
device in Linux over the command line using C/Perl/Python. I am a complete newbie to command line instrument
control. I have used Labview and I can setup the Ethernet/GPIB as well as talk to the spectrum analyzer just fine.

I did come across some python programs that control spectrum analyzers that are connected directly to the
computer. What I would like to know is hot to setup so that I can talk to this remote device.

Any help with this is highly appreciated.

Thanks - Ram
0 Kudos
Message 1 of 4
(5,249 Views)
I was able to get a sample code which controls an ethernet/serial device and it was addressed by
the following:

ASRL::192.168.1.150::2::INSTR

I can communicate with it via

viOpen (defaultRM, ASRL::192.168.1.150::2::INSTR, VI_NULL, VI_NULL, &instr);

I have a GPIB at ethernet ip 192.168.1.140 with the spectrum analyzer at address 18.
I tried to open it with

viOpen (defaultRM, GPIB::192.168.1.140::18::INSTR, VI_NULL, VI_NULL, &instr);

but it cant seem to communicate with it.

I am new to this so any help is most appreciated.

I can communicate with the device using Labview and the Measurement and Automation
Explorer on a Windows machine.



Thanks again - Ram

0 Kudos
Message 2 of 4
(5,226 Views)
Hello,
I believe your resource name may not be correct.
Instead of GPIB you should have TCPIP like in this article.

Let us know how this works.
Christian A
National Instruments
Applications Engineer
0 Kudos
Message 3 of 4
(5,189 Views)
Christian- Thanks for your help.

I was able to play around and read more. I was able to communicate with the Specrum Analyzer over GPIB. The way
to make it work was to set it up first using the 'gpibexplorer' as a GPIB0 interface. Once this was done everything
else was easier.
0 Kudos
Message 4 of 4
(5,157 Views)