LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running two VI's at once, with shared GPIB Resource - How to...

...keep mouse pointer within the confines of one VI's front panel?
 
Hello, a LV newbie here.  Here's my situation.
 
I have a "Main" LV program that uses a GPIB-controlled DMM (Keithley 2700) to take a scan of current measurements.   However, before taking the current measurements, the source voltage must first be calibrated.  So I came-up with a quick program to continuously read the voltage while you're adjusting the potentiometer.  It uses the same DMM.  I have a Boolean indicator on the front panel of this small program that indicates that the DMM is busy, and the Main Program "Current Scan" should not be attemped.  It is impractical to stop either program -- they both run continuously and are open side-by-side.
 
***So I try to wait for my "Meter Busy" indicator to go out on the small program before pressing the "Current Scan" button on the main program.***
 
But, being human, sometimes I jump-the-gun and press the "Current Scan" button on the main program before the voltage-read program has relinquished control.  The resulting conflict is not good.   Smiley Very Happy
 
Is there a way to keep the mouse pointer confined to within the bounds of the small program so long as the "Meter Busy" light is on?  I already have the right conditions and timing.   I just need to tie-into that Boolean wire somehow and eliminate human error.  That would completely solve my problem.
 
Thanks in advance!
0 Kudos
Message 1 of 4
(2,714 Views)
Use more cheese...

Why not make the calibration VI a subVI of the main program. It can run in parallel and have both panels open if you wish. Use semaphores to limit access to the shared resource.

Or put both functions into one VI. Use a tab control to display the voltage calibration until it is valid then switch to the current measurements. If the user cannot see both, then he can't push the wrong button.

Or make the calibration VI a pop-up subVI. If it is made modal you cannot get to the Main VI until you complete the pop-up.

Use a single VI to do the actual communications with the instrument. Set it up so that once one VI has started an operation (such as the calibration), other VIs cannot use the instrument until the operation is complete. See Ben's posts on Action Engines for ideas about implementation.

Lynn
0 Kudos
Message 2 of 4
(2,708 Views)
Agreed, that would be ideal.  Unfortunately, the main VI is not mine to revise.  Anything I do must remain separate.  Smiley Sad


Message Edited by MJRIII on 11-08-2007 03:47 PM
0 Kudos
Message 3 of 4
(2,705 Views)
Try the Front Panel property Is Frontmost. If both Vis are running in the same application instance (either in the development system or from the same executable), this will tell you if the other VI has been clicked on by the user. It won't prevent it, but it will let you make a noise, wave a red flag, or something to try to get the user's attention.

If you can't get the Main VI to be modified to "cooperate" you will probably always have the potential for conflict.

Lynn
0 Kudos
Message 4 of 4
(2,698 Views)