08-18-2011 03:45 AM
Hallo Everyone,
I am using sub Vi's for the first time and i ran into some problems. I created a 2 led cluster consisting of switches(7) and leds(7). i was able to control leds with the help of switches. But as soon as i tried to make them subvi. switches in cluster doesnt work from the main Vi.Another bollean on off switch works perfectly and also the timer.I have attached the subvis .
Thanks
08-18-2011 04:54 AM
08-18-2011 06:57 AM
Hi Gerdw,
I am sorry but somehow the main vi didnt get attached. o.k the complete set is as follows. the one with autoloop.vi is a subvi.
My problem is i can operate all the buttons as well as time change from main. vi but not the clusters.The clusters are the pio A, Pio B , Leds A and Leds B .. what should i do so that i can operate them from main vi..
Thanks
08-18-2011 07:05 AM
Hi speed,
I can operate the clusters in the main VI so I don't get your point...
When you try to operate any controls in a subVI, which are wired in the main VI, then they get reset to the mainVI settings with the next call of the subVI!
(Your subVI is still broken due to missing subVIs.)
08-18-2011 07:49 AM
For Example if i run Pio A+B autoloop sub vi. directly i can click on the switches4,5,6 and the leds4,5,6 turn green. (See pic01).
Now i make Pio A+B autoloop sub.vi as a subvi and this subvi is called from main.vi.
The problem is now if i click on switches 4,5,6 from the main.vi I cannot see the output i.e the leds doesn't turn green (see pic 02)
Why is it so and how should i solve it.
Thanks,
08-18-2011 07:52 AM
Hi speed,
do you switch the booleans in the main Vi before or after calling your subVI? Afterwards will not work - due to dataflow and as explained before!
Btw. it's very bad style to vreate subVI icons with no border and no filling color...
08-18-2011 08:21 PM
Your problem is that you are initializing all your clusters in your sub-VI. Any changes made in main will not show because the sub-VI resets them to false. Also, I don't understand why you are using a sequence structure in your sub-VI. It's useless since your structures will be executed in the proper order due to dataflow.