LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

program within a program

hello

          i got a program call a.vi and b.vi

 

I would like to have a major c.vi for both a.vi and b.vi

 

in other words, when I open c.vi there is a button to run a.vi and b.vi. 

 

any suggestion on how to implement.?

 

0 Kudos
Message 1 of 8
(3,088 Views)

make a.vi and b.vi be sub-vis in c.

 

Then put each subvi in a case structure.

When the button is pressed on the front panel,

the boolean becomes true, and the subvi will run. 

Cory K
0 Kudos
Message 2 of 8
(3,083 Views)

wiggy13 wrote:

in other words, when I open c.vi there is a button to run a.vi and b.vi. 


Sorry, do you want to run (1) "A or B" or (2)  "A and B"? Please clarify.

 

For case 2, just place both subVIs in the same event case of an event structure that triggers when you press the button.

0 Kudos
Message 3 of 8
(3,078 Views)

i would like to run a or b or both.  I would like to have  control windows that allow a or b both to run

 

 

0 Kudos
Message 4 of 8
(3,056 Views)

So you have 4 possible cases:

  1. none run
  2. A runs
  3. B runs
  4. A and B runs

 

A single boolean button would not be sufficient to select among 4 possibilities. 😄

 

Should they be able to both run at the same time or sequentially? How do the subVIs terminate?

0 Kudos
Message 5 of 8
(3,046 Views)

they should be able to run at the same time or in sequence

 

for example a.vi takes data in module a

                    b.vi takes data in module b

                   

0 Kudos
Message 6 of 8
(3,041 Views)

So use two buttons and two independent while loops, each with an event structure. One for A and one for B. There are really many ways to do this and it really depends on the details what's the best solution.

 

Should you be able to close C while A and/or B keep running?

0 Kudos
Message 7 of 8
(3,027 Views)

any sample ?

 

0 Kudos
Message 8 of 8
(3,024 Views)