LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control Subvi cluster from main Vi

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

0 Kudos
Message 1 of 7
(3,435 Views)

Hi speed,

 

think dataflow! Changes in mainVi FP elements will only be forwarded to a subVI when the subVI is called...

 

Btw. your attachment is missing all subVIs...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(3,424 Views)

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

Download All
0 Kudos
Message 3 of 7
(3,412 Views)

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.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(3,407 Views)

 

 

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,

 

Download All
0 Kudos
Message 5 of 7
(3,398 Views)

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(3,394 Views)

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.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 7 of 7
(3,374 Views)