Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Listen-Only Interface Board Question

When an interface controller board is setup as a listen only mode, how is it possible to know when a talker is 'online' and desiring to send information. In a normal situation, you could monitor ibsta by using ibwait(ud,0) to get the status of ibsta, and when the interface board was addressed as a listener, you could go ahead and process the request. Since the IB is configured as a Lonly, this doesn't happen. I am at loss as to how and handle this. Would a talker only istrument typically signal in some other way? Thanks for any help.. Jim
0 Kudos
Message 1 of 7
(3,736 Views)
A talker-only instrument will not signal the listener in any other way. Normally you would monitor ibsta (like you said) and wait until you were addressed as a listener. Once that happens, you would start a read to receive the data. Just assume that, since you are a listener-only device, the return from ibsta is a constant "yes, you are a listener" and just handle it as such (i.e., start an asynchronous read and wait until it completes). I recommend an asynchronous read since you really don't want the read to timeout.
Message 2 of 7
(3,736 Views)
Hi..
I am not sure I understand IBRDA. The help file
claims that it is possible to do 'other' non-gpib related tasks in your application. Does this mean that, say in a VB6 application, the application does not 'halt' when this function is called? In other words, can I call the function and still have access to the applications other buttons, menus, etc?

You mention that with IBRDA, the TIMO error is never invoked. Do I need to set TIMO to 0 to make this happen? Thanks for the help..
Jim
0 Kudos
Message 3 of 7
(3,736 Views)
I don't recall the use of asynchronous I/O in VB. It may or may not be supported. However, assuming it does work, asynchronous I/O does not halt when the function is called. You just need to either periodically poll (ibwait 0) or do a separate synchronous call to wait for the I/O to complete (ibwait CMPL). If you still want to do timeouts so that you can service other needs in the application, you can do an ibwait CMPL TIMO. This will cause a timeout to occur after the timeout period. However, the I/O will still be in progress so you can service your needs and then redo the ibwait CMPL TIMO. The reason I recommend this is because timing out on the GPIB is dangerous and a byte can be lost if you timout at just the wrong time.

Also, you do no
t need to set the timout to any value. It is ignored during asynchronous I/O.

I hope this clarifies things a bit...
0 Kudos
Message 4 of 7
(3,736 Views)
Thanks for the input.. I tried 'ibrda', and it doesn't work with VB (darn!). The only way that I could come up with (other than 'camping' on an ibrda) was to set the TIMO to something like 10mSec and then doing an ibrda with a polling routine. If the ibcnt variable showed something other than 0 after a TIMO, then I knew it was time to read the rest of the data (I would set the TIMO to 0 at this point). Of course, as you said, I may or may not lose a byte of data in the event the TIMO occurs at the wrong time.
If I were to switch to using VISA, would this allow me to do an async read? thanks... Jim
0 Kudos
Message 5 of 7
(3,736 Views)
I forgot to ask.. Is it even possible to set the interface board to read only with VISA?
0 Kudos
Message 6 of 7
(3,736 Views)
Whoops.. I meant 'Listen-Only'..
0 Kudos
Message 7 of 7
(3,736 Views)