LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

run dynamic vi vs directly put sub-VI in

If I have a main VI that will run several sub-VI's in a specific order that the user indicates. I have to update the indicator everytime each sub-VI updates, which would be a better way to implement this, using dynamic VI or just put the sub-VI in directly? If I use the dynamic VI, I will have to set all the control, but how do I get it to update everytime the sub-VI update? If I put the sub-VI in directly, setting up the input controls is easy, but I would have to send in my control reference for the sub-VI to update the indicators in the main VI.
0 Kudos
Message 1 of 4
(2,206 Views)
Probably the easiest way to accomplish this would be to utilize a LV 2 style global. This is a while loop with a case structure. The case structure can have two cases a read and a write. The write case will place values into an unitialize shift register and the read case will read from the shift register. The outer while will have a constant wired to the conditional to only allow 1 iteration of the while loop. This is a combination of an action engine and a LV2style global. Place the subvi in both vi's and call the read and write actions. This is an easy way to share the data between both processes. If you only have 1 subvi open at a time it is probably easiest to place all the subvi's embedded. If you want them to run and allow the top level vi to continue
to run load them dynamically using vi server. Hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 2 of 4
(2,206 Views)
Hi,
Is there anyway that you can whip up a quick example for me to see? I am still very confused by what you said. Thanks.
0 Kudos
Message 3 of 4
(2,206 Views)
here is an example. Run VIA and VIB and you will see how to set this up. Sorry these examples are very crude. Hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 4 of 4
(2,206 Views)