39179784 Labview Internet

7
___________________________________________ * Copyright © 2003 by the Consortium for Computing in Small Colleges. Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage, the CCSC copyright notice and the title of the publication and its date appear, and notice is given that copying is by permission of the Consortium for Computing in Small Colleges. To copy otherwise, or to republish, requires a fee and/or specific permission. 79 LABVIEW PROGRAMMING FOR INTERNET-BASED MEASUREMENTS * Korinne Resendez and Ray Bachnak Texas A&M University –Corpus Christi [email protected], [email protected] ABSTRACT Advances in networking technologies and the introduction of recent software development tools have made Internet-Based measurements a reality. This paper shows how LabVIEW can be used to perform data acquisitionand remotely control hardware devices through the Internet. A front panel displays the real-time results and allows storage of acquired data for later processing. Applications may be monitored and controlled from any web browser, anywhere in the world. INTRODUCTION The inability to control and monitor processes from remote locations makes proper and timely analysis impossible. PC-based data acquisition is used for online and off-line analysis. Advances in networking technologies and development of measurement hardware and software has turned PCs into platforms capable of continuous remote monitoring using the Internet [3]. A popular and suitable software program that facilitates the developments of such applications is LabVIEW [1, 2]. LabVIEW 6.1 offers a user-friendly interface that aids in the monitoring of different systems. A user can publish data on the web with little to no programming experience [7]. The software allows embedding a user interface on a web page to give the user access to the system [9]. Access can be granted using security features available though the software. Features such as password protection can prevent private information from being viewed by the general public. These features are especially useful for offering online experimentation when students

Transcript of 39179784 Labview Internet

___________________________________________

* Copyright © 2003 by the Consortium for Computing in Small Colleges. Permission to copywithout fee all or part of this material is granted provided that the copies are not made ordistributed for direct commercial advantage, the CCSC copyright notice and the title of thepublication and its date appear, and notice is given that copying is by permission of the Consortiumfor Computing in Small Colleges. To copy otherwise, or to republish, requires a fee and/orspecific permission.

79

LABVIEW PROGRAMMING FOR INTERNET-BASED

MEASUREMENTS*

Korinne Resendez and Ray BachnakTexas A&M University –Corpus Christi

[email protected], [email protected]

ABSTRACT

Advances in networking technologies and the introduction of recent softwaredevelopment tools have made Internet-Based measurements a reality. This papershows how LabVIEW can be used to perform data acquisition and remotely controlhardware devices through the Internet. A front panel displays the real-time resultsand allows storage of acquired data for later processing. Applications may bemonitored and controlled from any web browser, anywhere in the world.

INTRODUCTION

The inability to control and monitor processes from remote locations makes proper andtimely analysis impossible. PC-based data acquisition is used for online and off-line analysis.Advances in networking technologies and development of measurement hardware and softwarehas turned PCs into platforms capable of continuous remote monitoring using the Internet [3].A popular and suitable software program that facilitates the developments of such applicationsis LabVIEW [1, 2].

LabVIEW 6.1 offers a user-friendly interface that aids in the monitoring of differentsystems. A user can publish data on the web with little to no programming experience [7]. Thesoftware allows embedding a user interface on a web page to give the user access to the system[9]. Access can be granted using security features available though the software. Features suchas password protection can prevent private information from being viewed by the generalpublic. These features are especially useful for offering online experimentation when students

JCSC 18, 4 (April 2003)

80

need to gain access to inaccessible laboratories outside of their class time. This paper presentsthe process of developing online measurement experiments in a step by step approach using adata acquisition system that was developed for use in a Control Systems course at Texas A&MUniversity-Corpus Christi.

SYSTEM COMPONENTS AND DESIGN

The basic flow of data in a data acquisition system is shown in Fig. 1. The process beginswith a reading from a set of sensors or instrument. This reading is then passed to a signalconditioner that transmits the information to the data acquisition board attached to the computer.It is then sent through LabVIEW's web server, where the front panel is published over theInternet.

The system consists of a data acquisition board that uses a thermocouple to acquiretemperature and send data to the computer. The computer compares the acquired data to ahigh or low temperature setting that has been programmed into LabVIEW. If the temperatureis higher than the high limit a fan will turn on to cool the thermocouple. LabVIEW sends the userinterface through its web server and into the university's server linking the interface to everycomputer on campus. This allows anyone from anywhere on campus to monitor and control thetemperature received from the thermocouple.

Building the System

Fig. 2 shows the major components of the system. It consists of a data acquisition board(PCI-MIO-16E- 4), terminal blocks (SCXI 1303 and SCXI 1325), signal conditioninghardware (SCXI 1102), and a digital-to-analog conversion module (SCXI 1124). Thesecomponents are described in the NI catalog [6]. The PCI-MIO-16E-4 delivers highperformance and reliable data acquisition capabilities and has the following specifications:

• NI-DAQ driver with Measurement & Automation Explorer for easy configuration for Win2000/NT/Me/9x and Mac OS Fig. 1: Overall Process.

• Two 12-bit analog outputs; 8 digital I/O lines; two 24-bit counters • Up to 16 analog inputs; 12-bit resolution; up to 500 kS/s sampling rate

It is important that the required drivers are installed before using the board. The drivers areavailable on the CD that accompanies the board.

CCSC: South Central Conference

81

The SCXI 1102C is ideal for higher bandwidth analog signals. Each channel can beconfigured for a gain of 1 or 100 allowing any combination of thermocouples to be used. Thismodule has the following specifications:

• 10 kHz low-pass filter on every channel • 32 channels, up to 333 kHz scanning rates • For low-bandwidth mV, volt, and current inputs (1102B, 1102C) • Over voltage protection to +/-42V • Programmable instrumentation amplifier on every channel

The SCXI 1303 connects to the SCXI 1102C is designed for high accuracythermocouple measurements. This module has the following specifications:

• Isothermal construction minimizes errors caused by thermal gradients • Mounts to front of SCXI module • Open-thermocouple detection circuitry • Recommended for high-precision thermocouple temperature measurement applications • Recommended for use with the SCXI-1100/1102/1102B/1102C

The SCXI 1000 houses all of the component and power modules that will be used in thisproject. Its architecture includes the SCXI bus, which routes analog and digital signals whileacting as a communication conduit between modules. The chassis has the followingspecifications:

• 120 VAC • Low noise environment for signal conditioning • Rugged, compact chassis • Forced air cooling • Combination chassis for SCXI and PXI/Compact PCI modules • Chassis to house all SCXI modules

Assembling the system requires the use of the SCXI 1349 shielded cable assembly andthe SCXI 1357 high-voltage backplane. These are made specifically for the four slot chassisin the DAQ system. The cable assembly connects to the front-end of the signal conditioningSXCI. The high voltage backplane has the following specifications:

• Cable lengths up to 2 m • Connects SCXI systems to measurement devices

JCSC 18, 4 (April 2003)

82

• Includes 4-slot high-voltage analog bus • Mounting bracket for reliable connection to the SCXI chassis • Shielded for better accuracy; multi-chassis configurations available

The SCXI 1124 is a 6 channel isolated source for DC voltage or current signals. It is idealfor applications requiring isolated voltage or current outputs to a control process. The SCXI1124 comes with Fig. 2: DAQ System Configuration.6 isolated 12-bit channels that can beconfigured for any of the available unipolar or bipolar ranges. This module has the followingspecifications:

• 12-bit resolution • 6 isolated channels, 250 Vrms working isolation per channel • Combine output channels for larger voltage ranges • For isolated DC voltage and current output • Independently configure channels for voltage or current • Driver Software: NI-DAQ Software for Windows 2000/NT/Me/9x or Mac OS • Application Software: LabVIEW, Measurement Studio and Lookout

The final module in the DAQ system is the SCXI 1325. The SCXI 1325 is a screwterminal block that has 26 terminals for signal connections to the SCXI 1124 module. Thismodule has the following specifications:

• 26-screw terminals for signal connections • For isolated analog output applications • For use with the SCXI-1124 • Mounts to front of SCXI module • Shielded for quick, convenient signal connections

Installing the components involves the following easy steps. First, the data acquisitionboard (PCI-MIO- 16E-4) and all of its drivers are inserted into a PC. Second, the chassis(SCXI 1000) is attached to the board using the cable.

Once this is completed, the signal-conditioning module (SCXI 1124) and the 32 ChannelAmplifier (SCXI 1102C) can be inserted into the chassis. Finally, the Screw Terminal Block(SCXI 1325) is connected to the SCXI 1124 and the Isothermal Terminal Block (SCXI 1303)to the SCXI 1102C. Fig. 4 shows a picture of the actual system with wiring from thethermocouple to the input channel and from the output voltage to the LED. In this case the inputchannel was channel 11 of the SCXI 1303 and the output channel was channel 2 of the SCXI1325.

Measurement & Automation Explorer Configuration

The Measurement & Automation Explorer (MAX) is used to configure the dataacquisition system. MAX looks for modules or components that have been introduced to thesystem. It then asks the user for key information about what the modules will be used for, whatchannels will be used and what units will they be measuring in [1]. The instruction tree in MAXhas two important folders. One folder is called "Data Neighborhood". This folder is where

CCSC: South Central Conference

83

channels are assigned and are given values to use throughout data acquisition. The softwaregives the user the option to click on "Create New-Virtual Channel" and then choose the typeof channel needed. Analog Input, Analog Output and Digital I/O are all choices it provides. Theother folder is called "Devices and Interfaces". Here the modules that have been connectedshould be listed and configured by choosing properties. Once all of the modules and channelshave been configured they can be tested using the button called "Test Panel". This will show anerror if anything was done incorrectly.

The Temperature System Demonstration that is used in this project is a simulated VirtualInstrument (VI) provided by LabVIEW itself. In order to accomplish real time measurementsthe VI must be changed Fig. 3: I/O Experiment.to read data coming through the channels thatwere configured in MAX. Therefore, the wiring diagram is reprogrammed by removing therandomly assigned numbers given in the subVI "Temp" and inserting the subVI "Analog Input."When doing this, a DAQ channel control must be added. This of course only completes theinput portion of the VI. Finally, the diagram must be modified so that an output voltage of fivevolts is sent through to the LED.

INTERNET-BASED MEASUREMENTS

LabVIEW 6.1 comes with many Internet capabilities. It allows a user to publish a staticreport on the Internet, share data for processing, data storage, or data monitoring. The user cancontrol a process from a remote location while providing distributed execution of a program.If there is a program that needs to be broken up into sections, LabVIEW can generate theindividual programs that can be sent out while still working together.

The Web Publishing Tool

The Web Publishing Tool facilitates publishing a VI on the Internet while granting anddenying access to certain computers[4, 5, 8]. The following steps are necessary for publishinga VI to the Web.

1. First run the VI and make sure it is working as needed. Always keep the VI open on themain computer. The server will not recognize a closed VI.

2. Go to "Tools" and click on "Options". This will lead to a pull-down menu where bothconfiguration of the web server and browser access can take place.

3. Go through the pull down menu and click on "Web Server Configuration". 4. In this screen click on "Enable Web Server" to start up the server. Understand all other

default features before clicking OK. 5. After clicking OK head back to "Tools" and click on "Web Publishing Tool." 6. On this screen be sure to choose the VI that needs to be published. Choose the

embedded label, and type any text that is needed on the Web page. Once this isaccomplished click on "Save to Disk". A screen will pop up with a URL address thatshould be copied and pasted into either Netscape's or Internet Explorer's address bar.

JCSC 18, 4 (April 2003)

84

Once all the steps are completed, the VI should be seen on the web site. The main servercan grant anyone to take control of the VI but it also has the ability to regain control at any time.Denying access to a VI can be accomplished as follows. Go to the LabVIEW screen and clickon "Tools – Options" as noted before, but this time click on "Web Server Browser Access."Here you are given the options to allow viewing and controlling, only viewing, or to denyaccess. In the small window above these choices type the IP addresses of any computers thatshould not have access to this VI, and click OK. This will forbid any user at those computersfrom opening up the web site.

The Internet Toolkit

Although the Internet Toolkit is another easy way to publish a VI and an even better wayto add password protection, it does not allow a user to control the VI remotely. To use theInternet Toolkit, follow these instructions:

1. Go to the VI you want published, click on "Tools" and scroll down to "Internet Toolkit"and click on "Internet Toolkit Configuration." See Fig. 4.

2. Once in the Configuration menu, click on "User File Editor". Add the names you wish togrant access and assign them their passwords. Save this file under "users.txt" in theinternet/http/conf directory. See Fig. 5.

3. Repeat the steps for the "Group File Editor", but call it "groups.txt". Click "Done". 4. Create a directory called "special" in the internet/home directory and save the VI as a web

page in this directory. 5. In this menu click "New Panel" and choose the VI needed. Then click on "Edit

Directories" and find the directory it is located in. 6. Once all of the settings have been completed, click on "Start Server". Be sure that you

disable the Web Publishing Tool server. Two servers cannot work together.

Testing the System

The system was tested using Netscape. Typing in the address of the VI will display a userid and password screen as shown in Fig. 6. Typing in a proper ID and password will result in

CCSC: South Central Conference

85

displaying the image in Fig. 7. Running the VI will continuously display room temperature. If theLED is lighting up as the program states then everything is working correctly.

CONCLUSION

This paper shows how LabVIEW can be used to implement Internet-basedmeasurements. A data acquisition system was developed and used to illustrate publishing datato the Web and allowing remote control of applications. Using either the Internet Toolkit or theWeb Publishing Tool, a programmer can easily grant or deny access to networked computers.

REFERENCES

1. Bishop, R. LabVIEW Student Edition 6I, Prentice Hall, 2001.

2. Egarievwe, S.,Okobiah, O., Ajiboye, O., Fowler, L., Thorne, S., and Collins, W."Internet Application of LabVIEW in Computer Based Learning." European Journal ofOpen and Distance Learning. 2000.

3. Fountain, T. and Ryan Wright, "Internet Enabled Measurements,"http://www.realtime-info.be/magazine/00q4/2000q4_p072.pdf, 2000.

4. Kim, N., "Process Control Laboratory Experiments Using LabVIEW," 2001 ASEEAnnual Conference Proceedings, Session 3220, 15 pages.

5. N a t i o n a l I n s t r u m n t s , " L a b V I E W W e b S e r v i c e s , "http://software.oit.pdx.edu/math/labview/www/services.htm, 2002.

6. National Instruments. Measurement and Automation Catalog. 2002.

7. National Instruments. "Taking Your Measurements to the Web with LabVIEW,"http://www.ni.com/LabVIEW.

8. Sokoloff, L., "LabVIEW Implementation of ON/OFF Controller," 1999 ASEE AnnualConference Proceedings, Session 3659, 10 pages.

9. Travis, J. Internet Applications in LabVIEW, Prentice Hall, 2000.