Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

In a GPIB communication, when and how should I read the srq byte in order to flow control?

Hello,

I'm developing a software which controls a 700MR Microdyne instrument.

When I perform simple operations such as write and read once, it works.

But when I put these operations in a while loop, communication fails after any loops and windows hang up.

In the instrument documentation, it is specified that I should check a SRQ byte to verify if the instrument is busy or not, but when I read the serial poll byte, its value is 0; if I wait for SRQ, it waits until timeout occurs.

When and how should I read the srq byte in order to flow control?
Message 1 of 2
(3,666 Views)
David,
I have gone back and forth on this many times.
I have finally settled on not using the SRQ since there are some many problems. I don't have any experience with the 700MR but here are some general things about SRQ.
SRQ is Service Request, this usually means the instrument has done something or needs something. Most of the devices I have worked with allow you to set what will generate a SRQ, some generate it at the end of a measurement cycle or some such. Check the documentation and see what will generate an SRQ and whether you can set or disable this.
There are 2 main ways to use SRQ depending on your application. Use wait for SRQ if the entire process must
wait until some action is performed. Use serial polling if you can do other things while waiting for the ac
tion to be performed. In either case you should add a wait (or loop timer) that makes some sense. IE if you start a measurement that takes 3 minutes to complete, there is no reason to poll for SRQ until at or near this time. (So polling every 100ms is just wasted).
As for the problem in a while loop, it is possible that you are not waiting long enough between each cycle. You could try putting in a long delay and then shorten it until problems occur. This will tell you how much delay you need.
Kevin Kent
0 Kudos
Message 2 of 2
(3,666 Views)