UMB: TMPP250 Process
Technology 1 (Spring 2006)Course in LabVIEWThe text in grey is not icluded in the course. What is LabVIEW?LabVIEW is a development system for measurement and automation applications based on graphical programming. LabVIEW is a good tool for experimental work on the lab and for online (real-time) and offline numerical analysis and visualization of data. LabVIEW is produced by National Instruments. Litterature (in Norwegian): Lær LabVIEW trinn for trinn. Launching LabVIEWWe launch LabVIEW via the Start-button on the PC desktop. We study the buttons on the LabVIEW launch window. Opening and running a VIWe open and run the VI Search Examples / Industrial Applications / Analysis / Temperature System Demo.vi. The contents of a VIEach VI has a
We study Temperature System Demo.vi. Developing your first VIWe will together create sigtrans.vi. During the programming we will be using the following palettes:
DebuggingErrors can be
Let us introduce some errors in the diagram of a VI to see how LabVIEW detects the error. HelpHelp for a specific element: Right-click on the element / Help. Help on topics: Menu-choice: Help / VI Help, Function, How-to. Various help (technical documents, application notes tec.) can be found from http://ni.com.
Data typesSpecial datatypes:
Text-based programming windowsFormula Node is a window where you can write programmatic expressions following the C-syntax. Using a Formula Node for mathematical expressions is often more convenient than building the expression in the ordinary graphical way in LabVIEW. The Formula Node is available via
You create inputs and outputs to and from the Formula Node bye right-clicking on the frame of the Formula Node. Note: Each variable which are given a value during an expression, must have a corresponding output on the Formla Node! Let us study sigtrans_formulanode.vi where we will remove and re-enter the Formula Node. You can also use the Matlab-node which is a window into Matlab. The Matlab-node is programmed in the same way as the Formula-node. PlottingYou can add plots to a front panel from the following sub-palette:
There are several different plots available, e.g.:
Remember: You can create an array containing all data points generated during the execution of a while-loop by wiring the variable to the frame of the while-loop and choosing Enable Indexing after right-clicking on the terminal point on the while-loop frame. Some useful techniques when generating plots:
Let us try plott.vi. Property Node[Ch. 10] Property Nodes can be used to give front panel elements certain properties, as size, visibility, color, signal range, etc. A property (appearing in the Property Node) can be set programmatically. To create a Property Node:
We will add a Property node to plott.vi to programmatically control the start value, and the max scale value, the x (time) axis increment, and to empty the chart as the VI is started. Local variablesA local variable is a "copy" of a terminal and it contains the same value as the "parent" terminal. A local variable can be used anywhere within the same VI (but not in another VI). Local variables can be set as "read" or "write". A local variable can be created (from a given variable or element) as follows:
Let us study lokal.vi.
Updated Feb 11 2006 by Finn Haugen (finn.Haugen@hit.no) |