LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I controll a sub vi.

I built a subvi to do redundant calculations.  I do not want this vi to appear when I call it (I just want it to calculate and pass back the results).  Also, after it is called I want it to go away completely.  When it is called now it appears on the screen and the variables do not reintialize each subsequent time I call it (ie, a summed value does not start at zero even though I program it to do so).  How/where do I set this up to operate as needed?  Is this control in the subVI or where I call it in the main program?
0 Kudos
Message 1 of 4
(2,750 Views)

Hi irfocus,

how do you call your vi? Normally if you didn't change the vi options, then it should work as you expect. Do you use a loop inside your sub vi? If yes, then you should initialize the shiftregister.

Can you upload you vi?

 

Mike

0 Kudos
Message 2 of 4
(2,739 Views)

Hi irfocus,

 

usually vis are set to not appear on call. You probably set the vi properties to "show frontpanel on call" and "close FP afterwards". Turn both items off!

 

Second:

Your problem of "non-initialized control" seems related to the use of shift registers. But without seeing any code we can only guess what's wrong. So please attach your vi!

Best regards,
GerdW


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

Firstly, to avoid your subVI became visible when is called, uncheck "Show front panel when called" available in the VI properties (right click on icon of SubVI), Category : Window Appearance then select Custom then press "Customize..."

 

For your problem about initialization, it depends on your code:

- Do you use Shift register and if yes, think to intialize these if you want always the same conditions to the start of calculation.

- Do you use global variables as entry of your calculation? 

- ... to see with your code

  

0 Kudos
Message 4 of 4
(2,736 Views)