LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB-USB HP3562a...

I have a question on implemintaion of automatic spectrum measurement with results saving into a text file using HP3562a spectrum analyzer.  I never done  automatic  data aquasition  before so I need to find out which is the best way to implement my task. Should I use the Instrument I/O Assistant or should I use the driver from the NI website? Any suggestions will help. Thanks.
Ruslan.
0 Kudos
Message 1 of 31
(4,824 Views)
Unless you are very familiar with the instrument and the command language, you will probably be better off using the driver. The low level stuff is hidden from you with a driver. If you use the assistant, you will have to manually enter all of the commands into the assistant and then almost certainly do a lot of debug.
 
Neither the driver or the assistant will give you the ability to save files. You will have to add that in the main program that calls the driver VIs or the assistant.
0 Kudos
Message 2 of 31
(4,814 Views)
Hello, I programmed the 3562A for use over GPIB control when the screen went dead on the unit we had.  Over GPIB, using the drivers from HP, there is a "button" mode where each command mimics pressing a button on the device.  I suggest you develop a sequence of buttons that you press to take the measurement, then code in that sequence and verify that is works correctly.  That will set up the machine to take the measurement.  Then there are commands to read out the data.  Once the data is read out, probably into an array, you can use the "array to spreadsheet file.vi" to save the data in a text file.  You may have to transpose the data before it is written to get columns instead of rows.

Good Luck!
-Andrew
0 Kudos
Message 3 of 31
(4,810 Views)
I am sending this command to the the HP3562a via gpib from LV "auto 0;rst;sngl;smes;pspc;ch1;cord;mag;linx; freq;sf 1hz;frs 2 khz; x 800 hz; "
But my Marker is not getting set on 800Hz instead it alway goes to 751Hz. Am I doing something wrong? When I do this command sequence manually the marker is being set up properly.

0 Kudos
Message 4 of 31
(4,792 Views)
According to the manual I have you are sending the following...
"auto 0;rst;sngl;smes;pspc;ch1;cord;mag;linx; freq;sf 1hz;frs 2 khz; x 800 hz; "

auto 0 = turns off auto
rst = reset (bus command, not a front panel command), does the reset undo the auto 0 command?
sngl = single
smes = select measurement
pspc = Power Specturm
ch1 = Channel 1 Active
cord = Coord
mag = Mag (lin)
lin x =
freq =
sf 1hz = Start Frequency  1Hz
frs 2 khz = Frequency Span 2 khz - the notes in my  manual suggest that for  a linear resolution that value is below the suggested range, 10.24mHz - 100 kHz
x 800 hz = setting the x display to 800 hz

I have a couple of suggestions.

1) move the rst to the first command, then turn auto off, the reset occuring after the auto 0 might be allowing auto to come back on?
2) I don't think you need the spaces between the numbers and the suffixs, like 800hz instead of 800 hz
3) try different values for 800 hz, is there a cap at 751hz?

Good Luck,
-Drewski
0 Kudos
Message 5 of 31
(4,780 Views)
If AUTO CAL is ON, you will encounter long delays when the cal routine is run..This could
affect your program if it contains time outs. To avoid this, it is suggested that you send the
following sequence of commands:
AUTO 0
RST
SNGL
This deactivates auto cal, then runs a single cal routine.

Above is the excerpt from the programmers manual by HP. That is why I was using Auto 0 thing.
I think my problem  was with wrong syntax. Here is the working version.
auto 0;rst;sngl;smes;pspc;ch1;cord;mag;linx; freq;frs 1, 1999 Hz; x; xval 1500Hz;strt;
Thanks.

0 Kudos
Message 6 of 31
(4,776 Views)
I am tryinng to get the data from the analyzer now. I have attached a VI it has the reading code in the upper right corner of the  while loop.  My problem is that GPIB Read VI does not return any data for some reason. Does anyone know what am I doing wrong?
Thanks.

0 Kudos
Message 7 of 31
(4,770 Views)
You did not include the subVI called HP3462aquery. Also, if you are getting an error, provide the error code that you are getting.
0 Kudos
Message 8 of 31
(4,755 Views)
O I thought that if VI is included in the code it is physically included.  Thanks.


0 Kudos
Message 9 of 31
(4,745 Views)
Your logic for doing a write and a read seems very convoluted. Here's something much simpler and also gives you the ability to just do a read. I used the VISA functions instead of GPIB because I prefer VISA. I also redid the connector pattern to be closer to the standard. I left your front panel pink though.Smiley Wink
0 Kudos
Message 10 of 31
(4,738 Views)