Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Latency using NI native .NET gpib API with agilent 4411b spectrum

Hey, hope it's the right place to place this question of mine.

I'm using the agilent 4411b spectrum analyzer and controlling it via gpib.

My problem is , when I'm trying to read the trace data it usually about 450ms for the whole round-trip process, which is quite slow for my project demands.

 I tried to read the data in binary form of only 401 bytes and it's still takes about the same time to recive the data back to my program so I guess the problem is with the latency of the gpib protoco...?

Does anyone encountered that kind of a problem and know how to solve it?

 

0 Kudos
Message 1 of 6
(5,031 Views)

Hi,

 

The time required isn't due to gpib issues, it's probably due to the integration time required to measure the all the data.

What is your start frequency and span?

If the start frequency is low (<100 Hz) it simply takes a long time to process data at those frequencies.

 

Curt

0 Kudos
Message 2 of 6
(5,007 Views)

the start freq is about 500mhz and the span is 100mhz

but even with a span of 20mhz it's still quite slow.

 It usually take the spectrum to analyze the entire bw in about 4ms when, it only frezzes for a moment when I try to read data from it using the command "TRA?;"

0 Kudos
Message 3 of 6
(4,988 Views)

Hi,

 

Can you post some of your code?

 

Curt

0 Kudos
Message 4 of 6
(4,983 Views)

It basically look like this:

 

 


using NationalInstruments.NI4882;

.

.

.

Device dev = New Device(0,16);
.
.
.
dev.Write("TRA?;"); // ask for the trace data
string str = dev.ReadString();
.
.
.

 

I tried to read a byte array insted of a string, but nothing helps, it looks like the reading stucks the spectrum itself 😞

0 Kudos
Message 5 of 6
(4,980 Views)

Hi kanko,

 

If the issue is related to the NET Gpib library then try using these commands

 

GpibDevice.TerminateReadOnEndOfString = True

GpibDevice.ReadString()

 

More than likely it's an issue with the device

 

You should reference the Agilent user manual.

Here's a few ideas

 

1 - Turn off the display, that increases measurement time

2 - Read the data in binary format

 

From the Agilent manual

 

Use binary data format instead of ASCII

The ASCII data format is the instrument default since it is easier for people to

understand and is required by SCPI for *RST. However, data input/output is faster

using the binary formats.

:FORMat:DATA REAL,64 selects the 64-bit binary data format for all your

numerical data queries. You may need to swap the byte order if you are using a PC

rather than UNIX.
NORMal is the default byte order. Use :FORMat:BORDer

SWAP to change the byte order so that the least significant byte is sent first.

 

 

 

I've used other Agilent analyzers and you'll need to pay careful attention to the byte order.

 

You might want to try an instrument driver

 

This one might work. It's for an hp 8590 analyzer, but I think the commands should work.

http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=E3B19B3E964E659CE034080020E748... 

 

 

Sorry I couldn't be more help

 

Curt

0 Kudos
Message 6 of 6
(4,965 Views)