Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5565

Read status byte in VISA 5.4

$
0
0

I am controlling a Rohde Schwarz FSP and have things working well, using a GPIBSession.  I am trying to set it so that I enable the Operation Complete bit and then use a timer to periodically check the Status Byte.  To set up the Operation Complete bit, I am sending the following:

"*CLS"           

"*ESE 1"           

"*SRE 32"

I can read back the ESE and SRE using the *ESE? and *SRE? queries and get the correct response to indicate that the enables are set correctly.  I then put the spectrum analyser into a Single Sweep mode and trigger the sweeps... when I query the ESR or STB ("*ESR?" and "*STB?") using a timer in a loop the reply is always 0.  If is use the ReadStatusByte, it also returns 0...

 

If I used the *OPC? / *OPC? construct, it will wait and then complete once the required sweeps are complete.  I don't like this as it locks out control and I need to rely on a calculated timeout to prevent a hang-up.

 

I am trying to avoid using Events as I prefer to know where my code is.  There don't seem to be any up-to-date examples for using NI-VISA 5.4 in Visual Studio 2012 (Visual Basic).

 

Thanks for any clues...

 

 


Viewing all articles
Browse latest Browse all 5565

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>