Part I Introduction to LabVIEW
What is programming? • A set of instructions that tell a computer how to carry out a task.
What is LabVIEW? • "Laboratory Virtual Instrumentation Engineering Workbench" • Graphical programming software
How to open LabVIEW • Find the correct version of LabVIEW on your computer in the Start menu. Use the search bar if you cannot see the icon. • Double-click on the icon.
How to open a Blank VI • Open LabVIEW. • Click "Blank VI" in the upper left section "New".
What is a VI? • A "virtual instrument". • A program in LabVIEW. • Similar to a document in word • It has two components: a front panel and a block diagram.
Variables and Data Types A variable has an unchanging name (Fido) and it always holds a value (breed) of the same data type (dog). However, the value (breed) is changeable. The value (breed) of a variable may be accessed by calling the variable's name (Fido). • Data types in programming: • long (any integer) • double (any number) • String (a word) • boolean (true/false)
Front Panel • The user interface: where users interact with the program. • Here, the user can use variable controls for input and indicators to view the output for a program.
Front Panel Control Palette contains variable controls (ways to enter inputs) and indicators (ways to display outputs) find: right click on the front panel tip: pin it down by clicking the thumbtack on the upper left corner
Controls vs. Indicators A control allows for data input (changing the value of a variable): • typing into a editable text box • turning a knob • flipping a switch An indicator displays the output (accessing the value of a variable): • a graph • a read-only text box • an on/off light
Block Diagram The programming interface. Functions Palette contains elements for programming Find: right click Tip: pin it down for easy access
Wires Wires pass data from one element to another Broken wire means that the two connecting elements are of different data types
Cleaning up wires Process: 1. Right click on the wire.2. “Clean up wires”
Data Flow --> Left to Right • LabVIEW functions (ex. addition) accept input from the left and output from the right. • Read and write LabVIEW as you would read and write English.
Debugging in LabVIEW Debugging finding and fixing problems How: highlight execution and run Tips: keep code neat and organized: individual sections should be stacked vertically, not horizontally