LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Structuring Template code in Block Diagram

Solved!
Go to solution

Hey everyone,

I am rather new to LabVIEW. I am working on a project which requires me to use code for the same type of object, I.E. pumps. I have about 10-15 pumps which are going to have the same controls, Instead of creating 20 different frames with the same code for all of my pumps on the block diagram is there a way to structure it in one of those event or case structures which could keep the real estate on my block diagram a bit more organized. If anyone has been successful in doing something similar to this any insight would help.

 

Thanks.

 

 

0 Kudos
Message 1 of 2
(592 Views)
Solution
Accepted by topic author WallyK91

Common logic is often put into reusable functions. In LabVIEW, that is equivalent to a VI which you can call multiple times by a top level caller (thus called "SubVI"), mapping inputs (controls) and outputs (indicators). You have most likely used SubVIs already but created by someone else.

 

Your new SubVI should be generic enough that all the information it needs to work with are controls, and everything you need to know as a result are indicators.

 

If you need the logic to run in parallel (rather than one pump at a time) then you would probably alter the SubVI execution properties to Re-entrant (pre-allocated clone most likely).

 

 

0 Kudos
Message 2 of 2
(579 Views)