How to Create SubVI in labview
Description: Sub VIs are very useful in LabVIEW.
Using Sub VI helps you manage changes and debug the Block Diagram quickly.
You can also easily reuse your code. SubVIs are equal to functions in text based languages.
Requirements: LabVIEW any version latest than 2009
The Procedure is as follows: Create a SubVI that performs a linear scaling . Where are inputs, and is an output.
Step 1: Create a New VI (File->New VI) (Blank VI)
Step 2: Give the VI a Name (Linear Scaling.vi)
Step 3: Create your Front Panel with your necessary Controls and Indicators
Create your Block Diagram. The Block Diagram could look something like this:
Step 5: Create the Input and Output Connectors. Right-click on the little icon in the upper right corner and select 'Show Connector'.
➨Select the Wire tool and click on the wanted connector, then click on the Control or Indicator on the Front Panel you want to connect to this connector.
Create an Icon using the Icon Editor. Right-click on the little icon in the upper right corner and select 'Edit Icon'.
Create a new VI that you use to test your Sub VI. Example:
Download Labview Source code of this subVI example
Similar posts on Labview programming
Labview data types
Creating Array and Array operations
Cluster concepts in labview
Various plots in labview
For loop,while loop and case structure
Local variable vs Global variable concepts
Useful Links to Labview Source codes
Refer following as well as links mentioned on left side panel for useful labview source codes.
Hex to Binary labview VI Decimal to Binary labview VI
Number Generator labview VI Binary to Decimal labview VI
Binary number generator modulator-demodulator
FFT up and down sample