Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Behavior of ibnotify with several devices

Supose, in a scientific experiment, I want to acquire data from several Gpib instruments ( digital scopes, Boxcar, Multichannel Scaler, ...) at the same time. I want to use ibnotify so I would know when the apparatus finish the (averaged) acquisition. I would probably set up an ibnotify call for each device (the callback may be the same for all instruments). If the number of averages is the same for all instruments, the SRQ's would arrive at almost the same time, otherwise at different times. Now, what is the behavior of the driver in either case? Does it invoke the Callback function for each SRQ it receives, with the senders device descriptor? In this case, are the callbacks executed in different threads, or in one thread one a
fter another? What if the next SRQ (from another instrument) arrives while a callback is being executed?
0 Kudos
Message 1 of 3
(3,050 Views)
Hello,

From the research that I have done, the ibnotify callback will be called when the SRQ for the instrument whose device descriptor you have passed to ibnotify sets its own RQS (Request Service) bit in its Status Byte. RQS is bit 6 in the status byte and tells the controller that this specific instrument was the one (or one of many) who asserted the SRQ line. You must leave Automatic Serial Polling enabled for the callback to be guaranteed to occur (this is specified in the 488.2 reference helpfile). In the case of multiple instruments, you will have multiple device descriptors open and therefore many different IBNOTIFY calls (one for each descriptor). Ibnotify will create a new thread each time its callback is invoked.

Assuming you do have multiple instr
uments asserting SRQ simultaneously, the auto serial polling would read in all their status bytes until SRQ deasserted. Then, all the instruments for which an ibnotify was pending would have their callback functions called in separate threads. Any following callback functions would also be called in separate threads.

Hope this helps, and let me know if I failed to answer your question or if you see different behavior when you code this up as it is somewhat subtle.

For further information, please see the 488.2 Help file that is installed with the driver.

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,050 Views)
Thank you very much. This is indeed what I needed to know. It will take some time until I have a change to see this working, anyhow, because the reason for my question is that I want to create a multi-platform component (linux-win32) representing the Gpib, as part of a home-made data acquisition program for use in our scientific experiments, emulating the ibnotify on the linux side. So I wanted to know the behavior before starting to code.
0 Kudos
Message 3 of 3
(3,050 Views)