0% found this document useful (0 votes)
49 views10 pages

LabVIEW SubVIs

SubVIs in LabVIEW allow users to reuse code by creating custom functions (SubVIs) that can be called from the block diagram like built-in VIs. SubVIs hide complicated code, making programs easier to maintain and bugs easier to find and fix. Users select inputs and outputs for the SubVI, and can create an icon using the Icon Editor to help understand what the SubVI does at a glance. Once created, SubVIs can be dragged onto the block diagram like pre-made VIs and provide advantages like code reuse and simplified maintenance.

Uploaded by

gvkovind
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views10 pages

LabVIEW SubVIs

SubVIs in LabVIEW allow users to reuse code by creating custom functions (SubVIs) that can be called from the block diagram like built-in VIs. SubVIs hide complicated code, making programs easier to maintain and bugs easier to find and fix. Users select inputs and outputs for the SubVI, and can create an icon using the Icon Editor to help understand what the SubVI does at a glance. Once created, SubVIs can be dragged onto the block diagram like pre-made VIs and provide advantages like code reuse and simplified maintenance.

Uploaded by

gvkovind
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

SubVIs in LabVIEW

Hans-Petter Halvorsen
SubVIs
• A SubVI is the same as a func2on or a method
used in other languages
• Hundreds or thousands of SubVIs are included
with LabVIEW
• But even be?er: You can create and use your
own SubVIs
Why create and use SubVIs?
• You need to use the same operation many
times in your code
• Reuse your code
• Hide complicated code
• Easier to maintain your code
• Easier to find bugs and repair them
• ...
Select Inputs and Outputs
SubVIs
Input Output
Icon that makes it easier
to understand what the
SubVI is doing
(Control) (Indicator)
Create a nice icon as well
(Icon Editor)

A SubVI is the same as a


function or a method used
in other languages
Icon Editor Use the Icon Editor in order to create
a descriptive icon for your SubVI.
Using SubVIs

SubVI created in previous slide


(just drag it on the Block Diagram with your mouse)
SubVIs Here you see some of the
advantages with using SubVIs.
Hans-Petter Halvorsen
University of South-Eastern Norway
www.usn.no

E-mail: [email protected]
Web: https://www.halvorsen.blog

You might also like