I don't have time to figure out xeactly what you're doing, but here's
some ideas from a previous project I did - maybe they'll fit:

The project had one main window, and six sub-windows.

The main window had a button for each sub-window, to call it up.

Each sub window ran on its own, offering a different view on live data
being taken by the main.

Each window operated as expected - it stays in front if you click it -
you move them around like any other windows.

You couldn't click the CLOSE box, but each window had its own DONE
button which closed it.

Here's how it worked:

1... A "Window Manager" vi was initialized (from the main) to generate
six OCCURRENCEs and store them in a shift reg.

2... A "Window Launcher" vi is started.  It first calls the WINDOW
MANAGER to obtain the OCCURRENCE refnums, then launches six parallel
WHILE loops.

3... Each WHILE loop has a WAIT ON OCCURRENCE function. It waits a
specific time (500 mSec in my case).

4... If the WAIT ON OCCURRENCE timed out, we simply check the state of
a global PROGRAM RUNNING variable, and loop if it's true.

5... If the WAIT ON OCCURRENCE did NOT time out, then it was
triggered, and we call our particular sub-window (there's one WHILE
loop for each window).  The sub-windows are set to show front panel
when opened, and close when done.

6... Each sub-window monitors the PROGRAM RUNNING global and stops if
that is false.

7... Periodically, the six main buttons are fed to the "window
manager"'s CHECK function.  This checks each button, and if TRUE,
calls "OPEN or MOVE to FRONT" VI with the path to the associated
sub-window, and the occurrence for the associated window.

8... The OPEN or MOVE to FRONT vi opens a reference to the associated
VI, and checks the FP Open property to see if it's already open.  If
it's already open, the FP.IsFrontmost property is set TRUE to bring it
to the front (one might click on the main button while this window is
hidden - this will bring it forward).

9... If the window is NOT already open, the associated occurrence is
fired.  The Window Launcher vi will then start it up.

The windows do whatever work they need within themselves - it's not
like the main is doing the plotting and sending data to the windows.
It's more like the main is putting data into a common pot and
whichever sub-windows are open (running) go and get it.

Hope that helps.

Reply via email to