Day 03: Working with subVIs

Debugging, Creating subVIs, Documenting Code

NI Self-Paced Online Training

In LabVIEW Core 1, Module 7 on Debugging and Troubleshooting we learn how to locate and correct two main types of programming issues:

  • syntax errors that cause your VI to not be executable (resulting in a broken run arrow), and
  • logic errors that cause your VI to give incorrect results. 

Then we skip ahead to Module 12, Reusing Code which describes how to set up a VI so that it can be used as a subVI by creating an icon and defining the connector pane terminals.  This module also shows how to add documentation to your subVI.

Access LabVIEW Core 1 Course  

  • 7. Debugging and Troubleshooting
  • 12. Reusing Code
More LabVIEW Foundations

The following pages contain an overview of some different methods in LabVIEW to perform basic calculations and some information about LabVIEW’s built-in Help system.

An Example Application

In the following videos we expand on our example that uses the TMP-36 temperature sensor, by creating a subVI for scaling the measured voltage to temperature, adding some documentation to the top-level VI and subVI, and demonstrating some debugging techniques.  Watch these videos and practice the techniques of subVI creation, documentation, and debugging.

Creating subVIs

Documenting a VI

Debugging Techniques

Design Patterns

Throughout the course we will focus on understanding a few different design patterns that describe the structure of our LabVIEW virtual instruments.  The two most basic design patterns that every programmer uses whether they know it or not are called the Continuous Loop and the Immediate subVI.   You will use these two design patterns in your first couple of assignments.  The top-level VIs in these early assignments will be Continuous Loops and the subVIs used for scaling data will be Immediate subVIs.

Continue working on the Tilt Sensor

The bulk of time in class today will be spent continuing to work on the Tilt Sensor assignment.  Hopefully by the end of class today you will have this assignment nearly finished.

Print Friendly, PDF & Email