LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subVi trouble

Hello I want to make subVi for my example(1 input, 1 output); I add terminal for input and also for output and save it. Then I create new vi to test but it's not working; Can anyone explain me why not or fix this(Maybe is problem in while loop?), beacuse picture it taken every time when I stop .vi...

 

thanks, .vi(subVi and .vi) is attached

_________________________
Rookie; LV 2011 on WIN 7
Download All
0 Kudos
Message 1 of 5
(2,284 Views)

The subVI is not set up to display itself so it's simply running in the background. You can configure the subVI to display itself when called either throught he subVI's properties (Window Appearance section), or by right-clicking on the subVI node on the caller VI and selecting "SubVI Node Setup...". However, the graph on the caller VI will not be updated since the data will not be available until the subVI finishes.  I don't understand why you are trying to use a subVI in this case. There seems to be no point to it. Is this part of something else?

Message 2 of 5
(2,281 Views)

Well I have very big .vi with let's say 10 virtual instruments; i woul like to make in final .vi; just these 10 icons(sub.vi) and input and outputs..

_________________________
Rookie; LV 2011 on WIN 7
0 Kudos
Message 3 of 5
(2,278 Views)

Hi,

 

According to the principles of Dataflow paradigm you will have output when your node (the SubVI) finished running.

I recommend you to keep structures (like while loop) in the top level VI and create your SubVI such way it runs once and stops (As you can see it in this tutorial: http://zone.ni.com/devzone/cda/tut/p/id/7593).

 

If your SubVI contains struscture (while loop) it will run in the background and it will be confusing for the developer who watch the top level block diagram.

Otherwise you can debug it to yourself by Highlight execution or by Single-stepping debug techniques (https://decibel.ni.com/content/docs/DOC-1695).

 

Regards,

Peter Vago
Message 4 of 5
(2,246 Views)

You're thinking in the right direction, sub vi's are good. You must think about what you put in them though.

I cant open your code here, but if you're doing some processing/waiting in the sub-vi it's a bad place to do it.

Ofcourse calculations must (often) be done in loops, but apart from that you often use the sub-vi without loops and place the loop in the calling vi, then you can also use the outputs from the sub-vi to show every loop if it's desired.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 5 of 5
(2,230 Views)