Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to communicate with a HP 8510C network analyzer using LabVIEW GPIB commands to synchronize LabVIEW program and 8510C measurements.

I made a user interface in LabVIEW to control an HP 8510C network analyzer to take measurements over several frequency sweeps. After each sweep, the data will be output and appended to a text file. The problem is that I would like for the network analyzer to somehow send a command to inform the controller (I am using a GPIB-USB controller connected to the laptop/user interface) that it has finished the entire sweep so then the program will output the data only after the single sweep has finished. Then the next sweep will begin and when it is finished, the data is output again.

 

Right now I have a Time Delay subVI which I am using to allow a long enough delay for it to finish. But if the user changes the dwell time for each frequency point, then the Time Delay value has to be changed in the LabVIEW Block Diagram as well, in order for the network analyzer to finish the sweep before the data is appended to the file. This is not a good solution. So, is there a way to use LabVIEW's GPIB command subVIs to allow the program to wait until the network analyzer finshes each sweep?

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

Does the instrument have a status bit or support a command such as OPC? What functions are in the instrument driver and what does the low level GPIB functions have to do with that? The driver uses VISA.

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

Hello. I am not sure what you mean by "OPC command." I see in the HP 8510C Keyword Dictionary that there are 2 status bytes separated by a comma (i.e. < status byte #1 > , < status byte #2 >). The only status bits that I see that look like they could possibly be used to verify that the HP 8510C has finished a frequency sweep are bits # 1, # 2 and # 6, all of which are in status byte #1. This is what the Keyword Dictionary labels these bits as:

 

Bit #1: "Data entry complete"

Bit #2: "TRIG mode, waiting for GET (next point or sweep) or SIMS; also FASC; ready for GET menu hardware trigger, CALF; complete"

Bit #6: "RQS (SRQ) issued"

 

I am new to GPIB and I can't seem to understand what RQS and SRQ really do. Also, I am new to LabVIEW and I do not know how to use the GPIB subVIs to access individual bits from the STATUS bytes. Actually, I cannot even figure out how to access the STATUS bytes in LabVIEW while I am connected to the HP 8510C. I tried the GPIB Read and Write VIs and also the VISA Read and Write VIs (while using the "OUTPSTAT" command), but I can't get them to output any data from the STATUS bytes.

 

The Keyword Dictionary pdf document can be found on this website: http://www.ko4bb.com/Manuals/HP_Agilent/HP_8510_Network_Analyzer/HP_8510C_Keyword_Dictionary.pdf

 

Information about the STATUS bytes are on pdf pages 337 and 338.

 

Thanks for any help you can give.

0 Kudos
Message 3 of 6
(5,747 Views)
OPC is Operation Complete. Many instruments have an OPC? query.

What you should be using is the instrument driver written for the 8510C. Use Help> Find Instrument Drivers.
0 Kudos
Message 4 of 6
(5,744 Views)

Sorry, I forgot to mention that I have already downloaded the 8510C drivers, and I am using several of them in my LabVIEW user interface to control the 8510C. Some of the drivers would not work correctly, so I had to figure out different ways to make the program work correctly. For example, the "Output Raw Data.vi" would not output any data. So I found some other code on the internet that would work instead.

 

I did not find any 8510C driver that can check the status bytes or create the synchronized delay that I am looking for. That's why I'm trying to figure out how to use the low-level GPIB commands to control the 8510C exactly how I want to.

 

I just figured out that I can use the VISA "Read STB" subVI to check the status byte. Using this, I found out that while the 8510C is taking measurements, then the status byte (I assume it is status byte #1, not byte #2) is a decimal 3 (binary 0000 0011), and when the measurements are finished, then the status byte is a decimal 19 (binary 0001 0011).

 

So I believe that bit #4 of status byte #1 is the bit that tells whether the measurements are complete. Now I just need to figure out how to convert the output of the Read STB subVI from a decimal integer to a binary value so that I can check whether bit #4 is 1 or 0 (boolean true or false). Do you have any suggestion how to do this?

 

Thanks

 

(I think last post I gave you the wrong page numbers for the status bytes info. The correct page for the Keyword Dictionary is on page 706. The correct page numbers to the Agilent 8510C Operating and Programming Manual are pages 338 and 339.)

0 Kudos
Message 5 of 6
(5,739 Views)

Hello,

I think I have the similar problem like you have, the output raw data vi is not working properl. I need to do a frequency scan and then I should record Sxx parameters with respect to frequency range. You mentioned that you found another code internet. Could you please share that code. I will appreciate it. Thanks

0 Kudos
Message 6 of 6
(2,524 Views)