LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

switching between subprogramms ???

Hi,

I wrote two vis which the user should be able to use alternatively. That means the user should be able to switch between the programms. While prog1 is active
prog2 has to be inaktive and while prog2 is active prog1 is inaktive.
Both programms should use the same frontpanel - showing the controls/indicators of the
running programm and hiding all the frontpanel objects of the inactive programm.

I thougt about using an event structure to determine the users programm choise and do the switching but didn't get very far.
My main problem is where I have to put my subprogramms ( which contain controls that have to be modified during running)

Dos anyone have any suggestions ?

thank you in advance and best whishe
s for 2004

Simon
0 Kudos
Message 1 of 2
(2,510 Views)
A case structure is more relevant to your application than an event structure. You can use one toggle switch to toggle between prog1 and prog2 since one of these are active at all times. Prog1 and Prog2 could be implemented in subvis. Essentially you would be using a state machine approach.

You may want to use references to the controls/indicators rather than the controls/indicators themselves since you need to hide and unhide them within the programs. These reference could be bundled prior to passing into the subvi if there are a large number of them.

You may want to take sort of a state machine within a state machine approach as each of your subvis will have an initialization state (where all of the controls/indicators are hidden and revealed, and perha
ps other initializing takes place) and an operating state. The subvi should terminate if the value of the selector switch is changed.

I hope that this is helpful.

John
0 Kudos
Message 2 of 2
(2,510 Views)