Using Web-Based Resources To Incorporate LabVIEW into an

Apr 1, 2009 - Using Web-Based Resources To Incorporate LabVIEW into an Instrumental Analysis Course ... in a final programming project of the students...
3 downloads 0 Views 207KB Size
On the Web edited by

Computer Bulletin Board 

  Steven D. Gammon Western Washington University Bellingham, WA  98225

Using Web-Based Resources To Incorporate LabVIEW into an Instrumental Analysis Course Mark B. Jensen Department of Chemistry, Concordia College, Moorhead, MN 56562; [email protected]

300

other ACS journals Analytical Chemistry

250 200 150 100

(VIs) for data acquisition and analysis applications. Numerous examples of data acquisition and data analysis with LabVIEW VIs in the teaching laboratory have been reported (3–17). These examples range from students using previously written code, to altering previously written code, to writing their own code. Recently, two articles illustrating the power of LabVIEW for simulating experiments in physical chemistry have appeared in this Journal (18, 19). With the growing popularity of LabVIEW in chemical research, a strong case emerges for the importance of introducing undergraduate students to LabVIEW programming. Figure 1 shows the number of articles containing the word “LabVIEW” published in ACS journals from 1991 to 2007. Results are shown for all ACS journals and for Analytical Chemistry alone. A steady increase in LabVIEW popularity is clear, both in analytical research (from 1 reference in 1991 to 83 in 2007) and overall chemical research in general (5 to 270). Of the 1960 references to LabVIEW in ACS journals in this time period, 33% were from Analytical Chemistry, 21% from the Journal of Physical Chemistry (including A, B, and C ), 10% from Langmuir, 8% from the Journal of the American Chemical Society, and the remaining 28% from more than 20 other journals combined. In the senior-level instrumental analysis course at Concordia College (Chem 431), LabVIEW is incorporated throughout the course in several ways. In addition to using LabVIEW for data acquisition in the laboratory, particular emphasis is placed on both LabVIEW programming and in-class LabVIEW simulations. Students learn LabVIEW programming through the completion of a ten-assignment tutorial (which culminates in a final programming project), and in-class demonstrations using LabVIEW VIs are employed to simulate particular concepts related to the course material. A Web site has been created to make the Chem 431 LabVIEW resources available to a wider audience. This site can be found at http://www.cord.edu/faculty/jensen/LabVIEW/index. htm. It contains both the complete LabVIEW tutorial, and the classroom demonstrations in downloadable forms for both LabVIEW and nonLabVIEW users alike. LabVIEW Tutorial

50

07

06

20

05

20

04

20

03

20

02

20

01

20

00

20

99

20

98

19

97

19

96

19

95

19

94

19

93

19

19

19

19

92

0 91

Count “LabVIEW” References

Computer-assisted data acquisition has transformed modern chemical instrumentation. Commercial instruments with prepackaged data acquisition hardware and software now allow users with minimal training to efficiently collect large amounts of data with high accuracy and precision, and then perform a number of high-level analysis routines on the data. This transformation has been reflected in the teaching laboratory as well. Students routinely use computers to collect and analyze data from an FT–IR, NMR, GC–MS, HPLC, or UV–vis spectrophotometer. Even smaller, less-expensive instruments such as thermometers, pH meters, and voltmeters are commonly interfaced to a computer. The ease and efficiency of computer-based data collection and analysis can translate into better laboratory results, as well as more time for student learning and creativity. One disadvantage, however, is that students may begin to see the entire data acquisition process as a black box. They are rarely forced to ask fundamental questions about signal generation, signal type, noise reduction, digitization, and so forth. This is especially unfortunate in analytical chemistry courses because professional analytical chemists are commonly required to design new instruments, build or modify data acquisition interfaces to existing instruments, and troubleshoot data acquisition problems. Over the past decade there have been several reports in the literature of various methods for teaching data acquisition principles. While articles in this Journal have reported using the Matlab (1) and LabWorks (2) programming platforms for this purpose, most utilize LabVIEW (3–9). LabVIEW is a programming environment that uses an intuitive graphical programming language designed to create “virtual instruments”

Publication Year Figure 1. Distribution of articles published in ACS journals from 1991 to 2007 containing the word “LabVIEW”. Results were collected using the search engine from the ACS publications Web site, and are shown for all ACS journals and for Analytical Chemistry specifically.

In Chem 431 the LabVIEW tutorial runs parallel to the traditional course structure of lecture and laboratory. Students purchase a LabVIEW text (20) in addition to the principal course text, and the first laboratory period is used to introduce students to LabVIEW and simple data interfacing concepts. After this, however, no laboratory or lecture time is devoted to LabVIEW instruction. Student access to LabVIEW comes principally through a departmental 10-user teaching site license.

© Division of Chemical Education  •  www.JCE.DivCHED.org  •  Vol. 86  No. 4  April 2009  •  Journal of Chemical Education

525

On the Web

The tutorial has 10 assignments, each designed to introduce students to an important aspect of LabVIEW programming:

1. An Introduction to LabVIEW (completed during laboratory period 1)



2. LabVIEW Foundations



3. Working with Sub VIs



4. Controlling Your VI with Loops



5. Shift Registers and Time Recording



6. Introducing Arrays



7. Graphing Data in Real Time



8. Saving Your Data



9. Reading Your Saved Data

10. Working with Real Signals

Each assignment page consists of a programming project with related pages in the LabVIEW textbook. A list of programming hints is provided, along with a picture of the VI front panel interface. A link is also given to a downloadable working version of the VI (the code in the block diagram is not accessible). Students in Chem 431 are given due dates for each of the assignments, generally one per week. The completed VIs are emailed to the course instructor. Students are encouraged to consult with each other, with the restriction that each must do his or her own programming. The first two assignments are designed to introduce students to LabVIEW fundamentals. (Assignment 1 can be considered optional because it is a general introduction written specifically for resources on hand at Concordia.) In Assignment 3 (Working with Sub VIs), students build a simple temperaturemonitoring VI that uses a simulated thermocouple signal. In Assignments 4–10, features are added to this VI so that by the end, the VI will read a temperature from an actual thermocouple, display the temperature in various units, plot temperature versus time, activate appropriate LEDs when warning temperatures are exceeded, display the maximum and minimum temperatures recorded, and save the data in an Excel-ready format complete

Figure 2. Screenshot of the front panel of the temperature-monitoring VI completed in the final assignment of the LabVIEW tutorial.

526

with time stamp and user name. A sample front panel from this final assignment is shown in Figure 2. Following completion of the tutorial assignments, students design, complete, and present a LabVIEW-related final project of their own choosing (usually with guidance from the instructor). These projects have typically included VIs to control instruments, acquire data, assist in data analysis, or simulate an experiment. Students normally work individually, however they may work in pairs if the project is particularly ambitious. LabVIEW activities account for 25% of the students’ overall course grade, with 15% coming from the tutorial assignments, and 10% from the final project. Classroom Demonstrations Several LabVIEW-based demonstrations have been developed for use as in-class illustrations of concepts commonly covered in an instrumental analysis course. These demonstrations include:

• Signal-to-noise ratio



• Boxcar averaging



• Noise power spectrum



• Analog-to-digital conversion



• Nyquist frequency



• Ensemble averaging



• Digital filtering

The front panel of the boxcar averaging demonstration is shown in Figure 3. In this demonstration a “raw data” array of 2000 points is created consisting of four complete sine wave cycles on a background of Gaussian white noise. An array of “boxcar averaged data” is created with a user-selected boxcar size (5 in the case shown). Both the raw and averaged data are plotted. The VI updates continuously, thereby simulating realtime data acquisition and emphasizing the effect of a change in the boxcar size. Each of the seven demonstrations can be downloaded directly as a LabVIEW VI (they require LabVIEW to run), or as a

Figure 3. Screenshot of a downloadable LabVIEW demonstration of boxcar averaging.

Journal of Chemical Education  •  Vol. 86  No. 4  April 2009  •  www.JCE.DivCHED.org  •  © Division of Chemical Education 

On the Web

stand-alone executable for nonLabVIEW users. (Executables require the free LabVIEW runtime engine, available from National Instruments and linked from our Web site.) Each demonstration Web page includes a short description of the principle illustrated and a brief description of how the VI is constructed. Other LabVIEW users are encouraged to create and submit similar demonstrations to be included on this site, thereby making it a clearinghouse for tested LabVIEW demonstrations for use in instrumental analysis courses. Student Response Student response to LabVIEW in Chem 431 has been very positive. Table 1 shows the results of student assessment surveys regarding various LabVIEW-related portions of the course for two different semesters. Students were asked to rate the effectiveness of the assignments, final project, and quizzes on a scale of 1–7 with 7 being the highest. (Written programming quizzes were given in the fall of 2003—one quiz following each assignment. Student performance on the quizzes and student attitudes toward the quizzes were both poor, so they were discontinued.) We have yet to collect assessment information regarding the effectiveness of the classroom demonstrations. The data from Table 1 indicate that students feel both the assignments and the final project are very effective. It should be noted that the assignments in 2003 were slightly different from those given in 2007. In 2007 the assignments were made less time-consuming and more interrelated. This did lead to a slight numeric increase in student attitudes toward the assignments, however this increase was not significant. Written comments were generally quite positive, supporting the ratings reported in Table 1. Students have, however, expressed frustration with the amount of time required for the assignments. One student in 2007 seemed to reflect this attitude by writing: [It] got very tedious at times but was a great learning experience.

Another wrote: They were good, and I like doing them. But, it might be nicer if you were to give hints on them, or something to help us on them, because some of them took a long time to do.

Although a formal assessment of graduates regarding LabVIEW has not been attempted, several former students have commented that their LabVIEW experience has proven very valuable. Some have taken graduate level courses that incorporate LabVIEW, and they have felt far ahead of their peers in their programming abilities. Others have used LabVIEW to write VIs for use in their research projects. Literature Cited 1. Antler, M.; Salin, E.; Wilczek-Vera, G. J. Chem. Educ. 2005, 82, 425–427. 2. Bryant, P. A.; Morgan, M. E. J. Chem. Educ. 2004, 81, 113– 115. 3. Drew, S. M. J. Chem. Educ. 1996, 73, 1107–1111.

Table 1. Student Ratings of Elements of LabVIEW Integration Course Elements Assignments Final project Quizzes

Term and Number of Students (N )

Mean Ratings

Standard Deviations

Fall 2003  (11)

5.7

0.9

Fall 2007   (6)

5.9

0.8

Fall 2003  (11)

6.9

0.3

Fall 2007   (6)

6.3

0.8

Fall 2003  (11)

4.0

0.8

Fall 2007   (6)

Quizzes discontinued

Note: The effectiveness rating scale ranged from 7 (high) to 1 (low).

4. Economou, A.; Papargyris, D.; Stratis, J. J. Chem. Educ. 2004, 81, 406–410. 5. Gostowski, R. J. Chem. Educ. 1996, 73, 1103–1107. 6. Muyskens, M. A.; Glass, S. V.; Wietsma, T. W.; Gray, T. M. J. Chem. Educ. 1996, 73, 1112–1114. 7. Ogren, P. J.; Nelson, S.; Henry, I. J. Chem. Educ. 2001, 78, 353–355. 8. Ogren, P. J.; Henry, I.; Fletcher, S. E. S.; Kelly, I. J. Chem. Educ. 2003, 80, 699–703. 9. Ogren, P. J.; Jones, T. P. J. Chem. Educ. 1996, 73, 1115–1116. 10. Allerhand, A.; Dobie-Galuska, A. Chem. Educat. 2000, 5, 71–76. 11. Bailey, R. A.; Desai, S. B.; Hepfinger, N. F.; Hollinger, H. B.; Locke, P. S.; Miller, K. J.; Deacutis, J. J.; VanSteele, D. R. J. Chem. Educ. 1997, 74, 732–733. 12. Jensen, M. B. J. Chem. Educ. 2002, 79, 345–348. 13. Marcotte, R. E.; Wilson, L. D. J. Chem. Educ. 2001, 78, 799–800. 14. Spanoghe, P.; Cocquyt, J.; Van der Meeren, P. J. Chem. Educ. 2001, 78, 338–342. 15. Walczak, M. M.; Dryer, D. A.; Jacobsen, D. D.; Foss, M. G.; Flynn, N. T. J. Chem. Educ. 1997, 74, 1195–1197. 16. Walters, J. P. Anal. Chem. 1991, 63, 1179A –1191A. 17. Rupright, M. E.; Smith, E. T. Chem. Educat. 2006, 11, 283–286. 18. Belletti, A.; Borromei, R.; Ingletto, G. J. Chem. Educ. 2006, 83, 1353–1355. 19. Belletti, A.; Borromei, R.; Ingletto, G. J. Chem. Educ. 2008, 85, 879. 20. Travis, J.; Kring, J. LabVIEW for Everyone: Graphical Programming Made Easy and Fun, 3rd ed.; Pearson Education: Upper Saddle River, NJ, 2007.

Supporting JCE Online Material

http://www.jce.divched.org/Journal/Issues/2009/Apr/abs525.html Abstract and keywords Full text (PDF) Links to cited URLs and JCE articles Supplement Web pages that provide a LabVIEW tutorial and classroom simulations as either LabVIEW virtual instrument demonstrations or as stand-alone, executable (.exe) files

© Division of Chemical Education  •  www.JCE.DivCHED.org  •  Vol. 86  No. 4  April 2009  •  Journal of Chemical Education

527