Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-GPIB communication with spectrum analyzer

Hello, 

 

can someone help me solve this issue?

I still have problem with reading... 

 

Thank you.

0 Kudos
Message 11 of 13
(999 Views)

It might be that your timing to perform the frequency span after the trigger may be causing a timeout delay - Add a delay for this (guessing at 2 seconds, but more may be needed).  I have included the setup using your path on top and with utilizing my Prologix driver below.  You will need to deactivate one or the other.

LV2019LV2019

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 12 of 13
(976 Views)

Yes, you could pole the instrument using *OPC? and read its response.  You will want to set the timeout to something longer than your measurement takes.  By default the timeout is probably 1s or 3s, if the measurement takes 10s then *OPC? will never return 1, it will error as you've seen. 

 

Alternately you could set the timeout to 1000s,  send a *WAI until done, and then just have the code continue after that.  I've simplied your code a bit and demonstrated timeout read/set and *WAI. 

 

But, If you want to read back your trace you need the right SCPI commands, and will need to go through the manual for those.  Or search the forum - https://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Get-power-measurements-from-Spectrum-Analyze...

 

HPAnalyserv2_CDS.png

 

0 Kudos
Message 13 of 13
(966 Views)