Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

WAIT for user to say GO in IBIC Script

I am writing a script using IBIC. I am setting up an instrument that will be calibrated and need to stop execution of the program while the user measures the output and makes any adjustments that are needed. Is there a way to insert a WAIT between commands in an IBIC script? I found the ibwait command, but don't see how to use it to wait indefinitely until the user says GO. Thanks for your assistance!
0 Kudos
Message 1 of 3
(3,430 Views)
Really, ibwait is the only way to specify a delay in an ibic script and the function works as described in the following excerpt from the NI-488.2 function reference manual:

"ibwait monitors the events specified by mask and delays processing until one or more of the events occurs. If the wait mask is zero, ibwait returns immediately with the updated ibsta status word. If TIMO is set in the wait mask, ibwait returns when the timeout period has elapsed, if one or more of the other specified events have not already occurred. If TIMO is not set in the wait mask, the function waits indefinitely for one or more of the specified events to occur. The existing ibwait mask bits are identical to the ibsta bits; they are described in Table 1-11. If ud is a device descriptor, the
only valid wait mask bits are TIMO, END, RQS, and CMPL. If ud is an interface descriptor, all wait mask bits are valid except for RQS. You can configure the timeout period using the ibtmo function."

So, as you can see to specify a certain delay you use the ibtmo function to setup the timeout period and then specify a TIMO event mask for ibwait, otherwise you will have to specifically wait on an event that maybe your user can cause to happen, like somehow cause the instrument to assert an SRQ.

For more information you can look at the function reference manual for the rest of the ibwait details (i.e. event mask table):

http://digital.ni.com/manuals.nsf/14807683e3b2dd8f8625677b006643f0/35cd6168125e0ebd86256789006e84d4

Here is another link that talks about the ibic script process as well:

http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/cbf6b1eb7da1a5348625664100758bad?OpenDocument

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 3
(3,430 Views)
Thanks, Jason. The main problem with using ibwait, if I understand it correctly, is that I don't know how long the user will take to perform steps in the calibration procedure. Therefore, I don't know the timeout value. I could set it very high, like a year, if there was a way for the user to continue execution before the timeout value is reached. Unfortunately, I don't see any way to do that. The instrument in question is VXI based and doesn't have any front panel controls, so there isn't a way for the user to assert the SRQ. I realize that ibic isn't really designed for what I'm trying to do, so I'm going to have to write a program using the only available environment on the test station...which is ATLAS .

Thanks again for your help.
0 Kudos
Message 3 of 3
(3,430 Views)