Introduction to LabView and G Programming

 

Instructors: M. Krishnamoorthy (moorthy@cs.rpi.edu) and June Zhu (zhuj@rpi.edu)

URL: http://www.cs.rpi.edu/~moorthy/Courses/CompLang/Labview/

Time and Place: Friday 10-11:50 am, Science Center 214.

Text Book: L. Wells and J. Travis: LabVIEW for Everyone – Graphical Programming Made Easier, Prentice Hall, 1997.

Brief Overview: Data Flow, Visual Language, Data Acquisition and Control

Expectations:(At the beginning) Knowledge in any one Programming Language

(At the end) Proficient in Language G and LabVIEW Environment

Grading: A(Completion of 6 Work Sheets),B(5 WorkSheets), C (4 WorkSheets), D (3 WorkSheets) and F(0-2 WorkSheets)

Lecture 1: (Topics Covered) Control Flow Vs Data Flow, Visual (Event Driven) Programming, Virtual Instrument (vi), Front Panel Diagram, Connection Window (Program), Control (Input), Indicator (Output), Wiring, Data Types

Work Sheet 1: Write Programs to compute x1+x2+x3+x4 and to convert centigrade to Fahrenheit.

Write Program to produce picture output (for temperature example)

Lecture 2: SubVi, Case, For, While Statement

Work Sheet 2: Creation of SubVi for Miles to kilometers

Slope Calculation of a straight line.

Home Work (Part of WorkSheet 2): 1. Write a For Loop to Compute the factorial of an input number. 2. Write a while loop to calculate the factorial of an input number 3. Given an input number x, write a program to compute: if (x<0) then y=x+10 else y=x+20; Display y.

Lecture 3: Sequences, Formula node, Arrays, Strings and Graphs.

Work Sheet 3: 1. Build a sqrt vi with case structure. 2. To Generate an array of random numbers (using a for loop) and sum the elements of the array 3. Generate a matrix (Dimensional) of random Numbers and Plot it as a waveform graph. 3. Plot a xy graph – sin(x) vs Cos(x) 4. Block Diagram (5.26) – Handout Sheet. 5. Build a vi that generates a random number that matches a number you specify (Example of Frames) 6. Build a vi using a formula node to calculate either x+y (if a switch is on) or (x-y) if a switch is off. 7. Build a String vi – to convert a number to a string concatenates two strings to form a single output string. The vi also determines the output string length. This vi also tests if a password matches a given password.

Lecture 4: Files, Vi Setup, Instrument Control and Data Acquisition