From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming an application to communicate to an anritsu spectrum analyzer.

Hi, i'm trying to create an application to communicate with the MS2601B, Anritsu Spectrum Analyzer through the GPIB port.

I'm using a new GPIB card from National Instruments, model: 183617"k"-01, and the NI488.2 protocol.

I have a problem when i send instructions as IBWRT or IBRD, the device doesn't make anythig, but it works when i send IBCLR or IBLOC, so i don't know what happens to it.

I know it works perfectly with an old HPIB card, and using instructions as IOOUTPUTS or IOENTERS,

Maybe to communicate with this Spectrum Analyzer it's necessary to compile the program with a special file or library that i don't have.

Also when i start the MAX 2.0 (Measurement & Automation Explore
r) NI program, doesn't answer to the *IDN? query or to the especific commands (to control de instrument) i send to it.

Need your help, please. Thanks
0 Kudos
Message 1 of 5
(4,505 Views)
Hello guillem,

Thank you for contacting National Instruments.

Open up MAX again, expand the Devices and Interfaces tree, right click on your GBIP card and select Scan for Instruments. Make sure that it successfully finds your instrument and does not give you any errors. If it is unable to find your instrument, check your cabling and connections.

If MAX finds your instrument, right click on the instrument and select Communicate with Instrument to open the NI 488.2 Communicator. In the Send String field, type "*IDN?". You do not have to precede it with IBWRT to send the command. Click the Query button. If your instrument does not send a response, check to ensure that your instrument is 488.2 compliant. If it is not, you will need to obtain the
specific command set for that instrument from the manufacturer.

If everything checks out up to this point, open up LabVIEW. Instead of using the 488.2 functions to communicate with your instrument, try using the VISA functions. I have written a small VI that illustrates how to use the VISA functions to send a command to your instrument and receive data back. I was able to locate a driver set for the MS2601 in our Instrument Driver Network. You may also want to consider trying these. They may work for your instrument.

If you are still experiencing problems, inspect your pins and cables. It is possible that one or more of your data pins may be damaged. Also, try communicating with a different instrument using the same card. Likewise, try communicating with the same instrument using a different card, if possible. All of these steps will help isolate the problem.

I hope this helps! If none of this works and you are still having problems, let me know.

Matthew C
Appli
cations Engineer
National Instruments
0 Kudos
Message 2 of 5
(4,505 Views)
Hi Matthew, thanks for your help.
I explain you my problem:
I'm programming an application with Delphi Language, i've made five differents environments to communicate and to paint the instrument display into the PC. The instruments are 2 network analyzer, 2 spectrum analyzer and one scope, all them form Hewlett Packard, and any problem happens to them.
But the Anritsu MS2601B doesn't work, and i think the problem is with the ibwrt and ibrd instructions. I start the MAX and the NISpy, the program initialize the device and it sends the *IDN? using the ibwrt function and this makes an error, if i send another command like CNF? (especific command of the anritsu) makes error too.
Discussing in another forum, somebody tell me that he has a similar problem wit
h an old device form anritsu and he solve it putting a termination at the end of the ibwrt function..something like ms21\n. Maybe it will work with my instrument, but i don't know where can i find information about this.
Some idea????
thanks a lot, regards, guillem.
0 Kudos
Message 3 of 5
(4,505 Views)
guillem,

What are you using in to communicate with your instrument in MAX? Are
you using the NI-488.2 Interactive Control?

The specific commands for your instrument can be found in the manual
for that instrument. You can also obtain them from the instrument
manufacturer.

If your instrument is 488.2 compliant, open MAX and go to Tools >>
NI-488.2 >> Interactive Control. Type the following commands and see
if you get a response:

IBFIND gpib0 (or the alias for your card)
IBSIC
IBSRE 1
IBCMD "@?\x22"
IBWRT "*IDN?"

Then type:

IBCMD "? B"
IBRD 100

Regards,

Matthew C
Applications Engineer
National Instruments
Message 4 of 5
(4,505 Views)
Hi Matthew. Thanks for your help.
I solved the problem using the SEND routine of the 488.2 protocol.
To send commands to the ms2601b analyzer it's necessary to finish the
line with NL (new line character), and adding the character(#13,
programming in DELPHI) at the end of the command using the instruction
ibwrt was not succesful.

IBWRT(DVM1,'INI'+#13,4);

But if we send the command with the SEND routine, and putting as
termination NLend, the routine sends by itself the NL character, and
this works perfectly

SEND(0,1,'INI',3,NLEND);

Another important thing is that the analyzer only understands the
commands in uppercase.

Thank you very much. Guillem Mello. Barcelona.
0 Kudos
Message 5 of 5
(4,505 Views)