LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reference subvi

Hello All,
 
And Happy New year...
I am just starting a new Labview program and want to use several Labview examples and my own code snippets as subvis without much editing. For example the explorer listbox ( search on 'files' in Examples). I realise its quite easy to subvi a 'run once' program but I usually get difficuity when the program runs in a while loop.
 
Previously I would have dragged the entire example code panel onto my application code panel however as you can imagine the final result could extend over several acres making it difficult to debug when trying to navigate this landscape. I am hoping to simplify my program code.
 
I am becoming aware of the more intelligent features in Labview and interested to know which of these is best suited to use with a subvi and how to implement a solution. I have a feeling a reference is going to do the job but i am not sure to use it. I have already tried to subvi the function but I end up going down the same road I have before where the screen flickers and the function doesnt happen correctly. I have attached an llb which will shows the problem I would like a solution to, If anyone knows how to do this I would be gratefull. I hope to use this a number of times in my program so an answer will be quite powerful for me.
 
Regards
 
Chris
0 Kudos
Message 1 of 3
(2,723 Views)
 

Hi Chris,

Happy New Year to you too!

Hereare links  which discuss how to create / use sub VI's.

https://www.ni.com/docs/en-US/bundle/labview/page/creating-subvis-from-sections-of-a-vi.html

http://digital.ni.com/public.nsf/allkb/1FA00093A04BFCF5862570920049E482 

Here there is a discussion on how to re-use a same sub VI multiple times in a main VI.

https://forums.ni.com/t5/LabVIEW/Need-to-place-sub-VI-in-VI-a-number-of-times/m-p/60132

These should you a  good start on how to use Sub Vi's effectively.

Regards

Dev

 

 

 

 

Message Edited by devchander on 01-02-2006 04:27 AM

0 Kudos
Message 2 of 3
(2,715 Views)

Hello Dev,

many thanks, I read thro your suggested URLs and although I understand the basics of how to construct a subvi, the links were excellent. Particularly the suggestion to select a code area and subvi it. I vaguely remember this feature but never used it. It also helps to partly answer my origonal question as I can see it is creating references when generating the subvi, making me think I was on the right lines although I still dont know how to use them yet.

I dont think theres a magic bullet allowing me to easily subvi an entire while looping program with this method as it throws up lots of scary hex address errors when i try to sub vi 'too much' (or is it too complicated ) code snippets?

I imagine the auto sub vi feature is really there as a way of simply condensing straight forward serially running code.

I greatly appreiciate your help and advice.

 

Regards

 

Chris

0 Kudos
Message 3 of 3
(2,693 Views)