Volume 1, Number 1, Fall 2000 (Software Review)


National Instruments LabVIEW

Author:� Francis R. Krygowski, MS, PE, Coordinator M.E.T.

Affiliation:� Youngstown State University, Youngstown

Abstract:

National Instruments' LabVIEW software and data acquisition hardware were used as tools to increase the efficiency of student lab experiments in a Mechanical Engineering Technology laboratory at Youngstown State Universit, under the auspices of a National Science Foundation ILI grant, #DUE-9750992.The software proved to be useful and powerful and these additions to the lab were deemed very successful.However, learning LabVIEW programming requires dedication, and documentation of custom LabVIEW program logic can be somewhat more challenging than with other programming environments.

In the training of engineers and engineering technologists, we need to teach fundamental principles, yet to acquaint students with ever-advancing tools and techniques.These two goals often compete for available class and lab time.National Instruments LabVIEW software, and NI's computer data acquisition hardware can be useful tools in simultaneously achieving these somewhat disparate goals.

National Instruments began as a company which produced specialized computer expansion boards, and it now produces a very extensive line of computer-related hardware.This includes computer expansion boards for data acquisition, external interface boards, multiplexing equipment, on-board digital instruments such as oscilloscopes-on-a-card, instrument control via IEEE-488, machine vision hardware, etc.

In time, the company developed software to handle data acquisition chores - both the low-level device drivers and the higher level tasks such as computation, operator interface, etc.This software has evolved into LabVIEW, with LabVIEW 6i being the most recent incarnation, complete with Internet capabilities.

LabVIEW software is used to produce programs known as "VIs," or Virtual Instruments.These VIs can, in many cases, replace stand-alone instruments in the laboratory, and it is possible to program special purpose VIs to perform tasks unique to a particular laboratory.

LabVIEW is unusual in that it is programmed graphically.Rather than typing commands as text, with keywords and syntax controlling the computer's operation (as in conventional languages), the LabVIEW programmer chooses graphic icons from a variety of "palettes".Each icon functions similar to a keyword in a conventional programming language, triggering a certain computer operation.These operations range from acquiring a single data point, to simple addition of numbers, to writing to a disk file, to very complex operations such as signal conditioning.The range of functions available within LabVIEW is extremely impressive.

Many of the icons used in programming relate to providing a graphic operator interface or "Front Panel".LabVIEW makes design of the front panel extremely easy.A wide selection of operator controls and displays are available, from toggle switches and knobs which be operated by the computer mouse, to dials, gauges and graphs.�� A sample front panel is shown below.

 

 

Icons representing operations are graphically "wired" together to control the flow of data, and the resulting figure, or "diagram", with its front panel, constitutes a LabVIEW program, known as a VI.LabVIEW diagrams have the appearance of complex flowcharts.According to NI, the programs compile to machine language directly from the graphical diagram.

 

 

A useful component of LabVIEW is the Channel Wizard.The primary purpose of LabVIEW is to control a data acquisition system, and certain parameters of that system must be adjusted for the task at hand.For example, data acquisition boards have multiple input and output channels, and each channel may be required to accept different voltage levels.With National Instruments hardware, these levels are controllable through software (as opposed to moving jumpers on the boards), and the Channel Wizard is a user-friendly way of achieving this control.

LabVIEW, when combined with National Instruments data acquisition hardware and even a modest computer, forms a well-integrated package with some unique capabilities.Details of our experience with LabVIEW and National Instruments follow.

BUYING� LabVIEW

The Mechanical Engineering Technology faculty at Youngstown State University obtained a grant from the National Science Foundation for Instrumentation and Laboratory Improvement, to modernize a Physical Measurements laboratory.�� A large part of this project was to introduce computer data acquisition (DAQ) techniques in that lab in order to improve instructional efficiency in teaching various characteristics of sensor systems.

After some initial discussion, we arranged for two in-house LabVIEW seminars by the area NI representative. The first seminar concentrated on the construction of simple VIs as an introduction to the programming system, with each attendee working on a laptop.The second included further instruction in the data acquisition capabilities, with each computer interfaced to a National Instruments Signal Accessory box, which is a training aid used to generate signals for the DAQ system.

These seminars were well-attended and effective.Typically, attendees found LabVIEW's graphical programming to be seductively easy.The demonstration of the large library of sophisticated pre-programmed VIs (which can be customized, if desired) reinforced the desirability of the software package.

We found the sales staff to be knowledgeable and helpful.In addition, the extensive customer support available through National Instruments influenced our decision to purchase.Our first purchase was a Starter Kit, consisting of the software, a DAQ card, a Signal Accessory, and training/documentation material.We followed that by the purchase of hardware for several stations and ultimately a site license for the software.

LEARNING LabVIEW

We proceeded with the task of learning LabVIEW by following several paths in parallel.One was the reading of the supplied manuals and tutorials.A second was reading aftermarket textbooks dealing with LabVIEW programming and use.A third was by using a multi-media CD-ROM tutorial from LabVIEW.

With our programming experience in more conventional languages, plus the success we experienced in the sales seminars, we were confident that we would be able to program useful custom VIs in relatively short order, without resorting to taking a formal LabVIEW class.Unfortunately, this did not turn out to be true.

LabVIEW is not an application program (similar to AutoCAD, Microsoft Word, or MathCAD) but is instead a programming environment.Each VI produced is a custom programming project, with requirements and techniques that may be very different from other projects.Thus, learning truly effective LabVIEW programming is a complex task.As with other programming languages, an effective LabVIEW programmer must have a thorough grasp of the overall structure of the programming environment, a familiarity with a wide variety of specific operators and their capabilities (represented by keywords in other languages, and by icons in LabVIEW), a repertoire of standard programming techniques, and skill in troubleshooting when things go wrong.We were not able to acquire these traits within the time constraints of the projects under the NSF grant.

Fortunately for our projects, a student in the Electrical Engineering Technology program at YSU (Mr. Thanh Vo) had received extensive LabVIEW training and experience as part of a co-op experience at a local company.He was eager to help with LabVIEW programming for our project, and his help was invaluable.Eventually, he produced several sophisticatedVIs which are in use in that lab.If Mr. Vo were not available, it's safe to say that the level of sophistication and efficiency of the VIs used in the lab would be much less.

Ultimately, the author did attend two formal LabVIEW classes at a NI certified training center.The experience confirmed that, despite the availability of multi-media computer instruction and aftermarket texts, there are no substitutes for a knowledgeable and experienced instructor who can help a student by answering specific questions and solving specific problems.�� Based on this experience, I recommend taking formal LabVIEW classes (schedules are available on the National Instruments' website) and budgeting sufficient time to experiment with the software.

LabVIEW IN OPERATION

Teams of students made use of several VIs.One is a general-purpose VI "voltage vs. position" VI, designed to acquire voltages associated with keyboard-input position coordinates, to produce an on-screen plot of voltage vs. position.A second VI uses the analog output capability of LabVIEW and the DAQ board to send inputs of varying frequencies to filter circuits, then acquire the filter's output to produce Bode diagrams of filter performance.A third acquires raw data (voltage and resistance vs. time) from various temperature sensors to demonstrate the fundamentals of sensor behavior, then converts those parameters to temperature readings for comparison by the students.All these VIs write their data to spreadsheet files for further analysis.(The course also makes use of some VIs provided by LabVIEW - for example, a spectrum analyzer.)

As stated, the purpose of this course is not to teach LabVIEW programming, but to use LabVIEW as a tool to teach about sensor characteristics.In that respect, the project has been very successful.Students are relieved of the burden of manually recording data.Experimental parameters are graphed on-screen while the experiment is in progress, giving quick visual feedback.Having the data streamed to disk allows sophisticated analysis afterwards, using spreadsheet software.

However, there are potential problems with this approach, and caution must be used.For example, the students must not be disconnected from the experiment by too much automation.They must be aware of what is taking place at each step of the experiment, and must be intellectually engaged.Furthermore, as with all software, the operator interface must be designed very carefully, to be sure the students understand the procedures they are to follow.We used detailed instructional handouts to guide students through the procedures.

Regarding the operator interface, some students experienced confusion in following instructions or operating the < w:st="on">VIs.For example, in the beginning, one student found a way to erase the VI -proving the value of backing up files!(Note: we now know that there are ways of preventing that particular occurrence.)In other instances, our original thoughts on operator interface design proved less than optimum, and had to be revised.It's worth noting that software developers have "beta testers" who discover the software's faults.In an educational setting, the first few classes of students sometimes function as beta testers.Faculty developing VIs for use in their labs should consider having novice volunteers attempt to follow the written and on-screen instructions, to discover what parts may be unclear, before using the VI for an entire laboratory.

DOCUMENTATION

If the use of LabVIEW in a student laboratory has a potential weakness, it is in the technical complexity and the documentation problems.In any technical laboratory, those supervising must understand the operation of the equipment.Since most laboratory equipment comes with adequate manuals, new faculty can be expected to learn the operations rather quickly.

In the case of DAQ, the equipment is more complex than usual, and the pool of faculty who are comfortable with its use is perhaps smaller than normal.But when the "equipment" includes custom software, it is important that adequate documentation be written in-house, to explain the software and hardware connections, and to give guidance on troubleshooting.This is especially important at institutions which make extensive use of part-time faculty.

The most extreme test of documentation comes when a faculty member leaves an institution, and others must assume the responsibility for the lab.To prepare for this eventuality (and to facilitate later enhancements) it is desirable to document in detail the operation of any custom software.In textual programs, explanatory remarks or comments can be inserted into the code.With a LabVIEW VI, typed comments can be displayed on the diagram or on the front panel, and further notes can be made available as on-screen help.(This is in addition to the on-screen help available via the software.)

One feature of LabVIEW which can enhance organization and documentation is LabVIEW's modularity.Sections of code can be grouped into a custom icon chosen by the programmer, known as a "Sub-VI", the LabVIEW equivalent of a subroutine or sub-program.These sub-VIs can be used repeatedly in the main VI, and can contain other sub-VIs.Each sub-VI can have associated with it user-written "VI Information", and can contain further notes on the associated sub-VI diagram or front panel.Judicious use of sub-VIs can provide a simpler main diagram and enhance understanding of VI operation.

Despite these features, in the author's judgement, documentation of program logic is somewhat more difficult in LabVIEW than in more conventional text-base programming languages.While increased familiarity with the programming environment would doubtlessly improve facility with this aspect of LabVIEW, those most in need of documentation would be those least familiar with it.For this reason, detailed written documentation of any custom < w:st="on">VIs might prove valuable in a student laboratory.

CONCLUSION

LabVIEW has proven to be a valuable addition to the Physical Measurements laboratory at Youngstown State University.More VI-based experiments are planned - for example, double-integrating the output of an accelerometer and comparing it to the position output of an LVDT.Student response has been positive, and clearly inclusion of DAQ has increased the time efficiency of the lab projects.Based on our experiences, I can recommend this software package and the associated National Instruments hardware.

wFURTHER INFORMATION

Those interested in exploring LabVIEW should begin with the National Instruments website, http://www.ni.com/

From that site, you can access demonstration software, technical support, a user community with discussion groups, and much more

Some useful texts on LabVIEW and DAQ are listed below:

Sokoloff, L.Basic Concepts of LabVIEW 4, Prentice Hall, 1998

Johnson, G. LabVIEW Graphical Programming, McGraw-Hill, 1997

Keaton, J. et. al., LabTutorOxford < w:st="on">University Press, 1995

More texts are listed at http://www.natinst.com/library

The author wishes to thank Dr. Mansour Zenouzi for his help in winning the NSF grant; Mr. Thanh Vo for his help in LabVIEW programming, and Scott Buckner, E.I.T. and Ted Burke, PE for help in lab development.