0% found this document useful (0 votes)
119 views

Labview Manual

The document provides instructions for using LabVIEW software to control a Hewlett Packard digital multimeter via the GPIB interface bus. The instructions guide the user to: 1) Initialize the GPIB connection and specify the instrument address. 2) Add virtual instruments to initialize the device, perform multiple measurements, and close the connection. 3) Configure the program to take 20 sample readings per trigger and display the results.

Uploaded by

Adil Akhtar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views

Labview Manual

The document provides instructions for using LabVIEW software to control a Hewlett Packard digital multimeter via the GPIB interface bus. The instructions guide the user to: 1) Initialize the GPIB connection and specify the instrument address. 2) Add virtual instruments to initialize the device, perform multiple measurements, and close the connection. 3) Configure the program to take 20 sample readings per trigger and display the results.

Uploaded by

Adil Akhtar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 10

LabVIEW Manual

Using LabVIEW with the General Purpose Interface Bus GPIB, (The IEEE 488 Bus) Data Acquisition Lab Project
Communicating between Programmable Electronic Instruments and the PC
LabVIEW: Virtual Instrument Environmental Workstation- is an icon software program of National Instruments VI or vi: virtual instrument School of Physics and Astronomy, Tel Aviv University, Electronic Lab - Shenkar 301, Ramat Aviv. February, 2002 Notes by: Oren Zarchin, Avraham Semenkee, and Ralph & Rachel Rosenbaum,

A. Initial Preparations
1. Install the GPIB card into your PC motherboard; 2. Install LabVIEW program into your hard disk; 3. Connect up the GPIB Cables between your instruments and the GPIB card; inspect the cable plugs - are they OK? 4. Program each of your electronic instruments to respond to: a. b. GPIB or IEEE 488 bus and not the RS 232 bus. Give an address number between 1 to 22 to each of your instruments; remember which instrument has which address number. Avoid using the addresses of number 0 and/or number 7, often used by the GPIB controller card in the motherboard. c. d. On each electronic instrument, choose the programming command language - SCPI (Scientific Commands for Programmable Instruments). Connect up a voltage source or resistor to your digital multimeter to confirm that it is responding correctly to your front panel settings.

143438967.doc

Version, Feb. 2002

B. Starting up your PC
1. 2. Power up your PC Type in the following info:(valid as of February, 2002): Users Name: Pass Word: 3.

administrator lab

Click on the National Instrument LabVIEW Icon to get the following Window:

LabVIEW NOTE: For an introduction to LabVIEW, read the LabVIEW Tutorial. NATIONAL INSTRUMENTS LabVIEW New VI (Virtual Instrument) Open VI DAQ Solutions Search Examples LabVIEW Tutorial Exit 4. Click on the New VI button to get the following new window: Inside this window appears two screens - one is the Front Panel appearing in the Grey Color and the second screen is the Block Diagram appearing in the White Color. 5. Click on the White Color Screen or equivalently, the Block Diagram to bring it forward on the screen. The Front Panel or Grey Color Screen will go behind the Block Diagram and will be partially blocked off by it.

143438967.doc

Version, Feb. 2002

A LabVIEW Program to Control the Hewlett Packard Digital Multimeter the HP34401a

Front Panel

Block Diagram

143438967.doc

Version, Feb. 2002

6.

Now go to the Function Bar that appears near the top of the screen: File Edit Operate Tools Browse Window Help Click on the Window button to get the following dialog box: Click on the "Show Tools Palette" and move this Palette to one side of the screen. We will use it all the time to edit our programs

Show Panel Show Functions Palette Show Tools Palette Show Clipboard Show Error List Tile Left and Right Tile Up and down Full Size

7.

Click on the Show Function Palette button to get the following:

Functions Palette
The Functions palette is available only on the Block Diagram. The Functions palette contains the objects you use to program your VI, such as arithmetic, instrument I/O, file I/0, and data acquisition operations. Select Window Show Functions Palette or rightclick the block diagram workspace to display the Functions palette. You can place the Functions palette anywhere on the screen. 8. Now click on the 5th Icon that appears on the left-hand side.

143438967.doc

Version, Feb. 2002

9.

After clicking on the 5th Icon, we get a new menu dialog box: Instrument I/0 Inst/Lib Icon

Here appear other Icons

10.

Now click on the Inst/Lib Icon to get the Instrument Drivers programs that National Instruments have written for different electronic equipment (for example, Keithley, Hewlett Packard, Textronics, Fluke, ect.). Avraham has installed the drivers that we will use and need. If you are missing a particular driver for a particular instrument, ask Avraham to install it. Choose the driver program for our Hewlett Packard Digital Volt Meter, .the HP 34401A DMM or digital multimeter (the DMM): Instrument Driver 34401A Here appear other drivers

Picture of the DMM

11.

Now click on the 34401A driver program icon to get the new following menu dialog box: hp 34401a Initialize.vi hp 34401a Initialize with Options.vi We will use these three Icons in the following example Applications Configuration Measurement Utility (for detecting errors) hp 34401a Close.vi

143438967.doc

Version, Feb. 2002

12.

Go to the hp 34401a Initialize.vi button and drag its Icon onto the left side of the Block Diagram; you need first to double click on the left mouse button. Now go to the Application button to get the following drop-down Table: Getting Started.vi Single Point Measurement.vi Multi Point Measurement.vi Highlight the Multi Point Measurement.vi and drag its Icon onto the middle of' the Block Diagram. Now choose the hp34401a Close.vi button, highlight it and drag its Icon onto the right hand side of the Block Diagram. Your Block Diagram should have 3 Icons on it and should look like this:

hp34401a

Initialize
13.

MULT-PT MEAS

hp34401a

hp34401a

MEAS

Close

We now have to connect wires or electrical cables between these three Icons or Operational Blocks of the DMM. First, we need the wire tool which is called Connect Wire or Spool of Wire - Ralph's name which you find on the Tool Palette: There are two different terminals on each of' the above three Icons which need connecting - one terminal is called the Instrument Handle terminal and the second terminal(s) are labelled under the name Error Out or Error In. In order to connect the Instrument Handle terminals to one another, take the Connect Wire spool onto the right side of the Initialize Icon and various different terminals will be displayed as you move the Connect Wire tool up and down the right side of the Icon. Find the terminal labelled Instrument Handle terminal. Drag the spool to the second Icon - the MULT-PT MEAS Icon and find on its left side the corresponding Instrument Handle terminal. Click on the mouse to join these two terminals together. Using the same procedure, connect the Instrument Handle Out terminal on the right side of the MULT-PT MEAS Icon to the Instrument Handle terminal on the third and last Icon - the Close Icon.

143438967.doc

Version, Feb. 2002

Do the same procedure now to the Error terminals, connecting wires or cables between all the error terminals of the three Icons. Your block diagram should look something like this (see bottom part of page 3):

Initialize

MULT-PT MEAS

Close

14.

We now have to tell the LabVIEW GPIB program via the Initialize Icon what bus we will use (GPIB bus or HPIB or the IEEE 488 bus, all equivalent; but not the RS232 bus) and since we will use the GPIB bus, we must tell the program what is the address of our DMM, which we presumably set earlier to the address of 12. a) b) Take the Connect Wire tool to the left side of the Initialize Icon and find the Input terminal labelled by the name Resource Name. Stand on this terminal and click on the RIGHT Button of the Mouse, The following drop-down table should appear: Visible Items Help Description and Tips.... Set Break Point Create Constant Replace Control (used to input data on the Front Panel) .... Indicators (to display output data on Front Panel) Highlight the Create button and you will get the second drop-down table shown above on the right side; choose the Control button and Click it. The program should now jump back to the Block Diagram and just above your first Icon - the Initialize Icon there should appear a little window or table displaying: Resource Name (GPIB::14::INSTR). c) We need only to change the address from the default address of 14 to our chosen address of 12. To do this, go to the Front Panel by clicking on the Grey Color panel. There is a little window that appears with the name Resource Name. Using the edit tool White Color , change the details of the box to GPIB::12::INSTR. Now panel. Correct the label from GPIB:: 14::INSTR to

click the OK button . Lastly, go back to the Block Diagram by clicking on its GPIB::12::INSTR. 15. Now lets program our DMM to make 20 sample readings for each trigger. To do this, go to the middle Icon, the MULT-PT MEAS Icon and use the Connect Wire tool to scan the terminals on the bottom edge of this Icon. Find the terminal labelled by the name
143438967.doc

Version, Feb. 2002

Sample Count (1). Click again on the RIGHT Side Mouse button to get the Drop Down tables of step 14) again. Choose the Control button and repeat the steps of step 14) going to the Front Panel again and typing in the number 20 instead of 1 that appears in the little window or display labelled by Sample Count. Return to the Block Diagram again. 16. Finally, would it not be great to be able to read the twenty measured values? Of course, yes! Take the Connect Wire tool and again go to the right hand side of the Middle Icon - our MULT-PT MEAS Icon. Find the terminal labelled by the name readings. Again use the Right hand mouse button to get the two drop-down tables used in step 14. But this time, we chose the Indicator button instead of the Control button, since we wish to display OUTPUT data and not to enter INPUT data that requires using the Control button. After clicking on the Indicator button, go to the Front Panel and notice that there now appears a third readings window that will display one out of twenty of the measured values. To display each of the twenty readings use the hand tool, and position it on the UP or Down toggle switches located on the left side

of the display readings window. Note that the first reading is designated by the index 0 zero, and not by the index 1. 17. We're finally ready to run the program and take twenty voltage measurements. Hit the run button and see if the DMM responds. We hope it does! If the DMM doesn't respond check the following: a. Is the GPIB Cable connected? the language set to SCPI (Standard Commands for Programmable Instruments)? c. If there is no response, turn off the PC and reprogram it from the beginning! Sorry, but sometimes the PC hangs up and refuses to respond! 18. Assuming that the DMM response, by observing the * indicator flashing twenty times on the front panel of the DMM, go to the Front Panel of your program and read off the twenty readings. b. Is the DMM Programmed for the HPIB (GPIB) bus, is its address set to 12, and is

143438967.doc

Version, Feb. 2002

Controls Palette

The Controls palette is available only on the Front Panel. The Controls palette contains the front panel controls and indicators you use to create the user interface. Select Window show Controls Palette or right-click the front panel workspace to display the Controls palette. You can place the Controls palette anywhere on the Front Panel screen. Note that there are also Indicator icons as well as the Control icons in this palette.

Some Useful Buttons That Appear On One Of The Horizontal Upper bars

run button:

Also there is the Continuous run button:

There is the Stop button:

There is also the Pause button:

To DELETE, bring the hand cursor on the object you wish to delete. Now click on the left button of the mouse. Finally hit the Delete key on your keyboard.

143438967.doc

Version, Feb. 2002

Saving the Instrument Readings on a Diskette


Say that we are interested in analysing the 20 data readings that we received from our DMM. You can use some of the statistical and mathematical tools provided by LabVIEW; or you can choose to export the data to some program like MatLab. Lets try to export the data by writing it to a floppy diskette. There is a special icon called Write to Spreadsheet File.vi Icon that does this task. To find this icon, refer to page 4 and inspect the Function Palette. Notice on the Right hand side and on the Third row, there is a icon having a picture of a Floppy Disk. Click on this icon to get a drop-down table entitled File I/O. This table contains three rows of many icons. Choose the first icon that appears on the Upper Left hand corner it is named: Write to Spreadsheet File.vi. Drag this Write to Spreadsheet File.vi Icon onto your Block Diagram and attach a wire- cable between its input terminal entitled 1d data and between the output terminal of the MULT-PT MEAS Icon; refer to the Block Diagram on page 3 for details. The Write to Spreadsheet File.vi Icon will ask you where to export or to write the data (diskette, hard disk, spread sheet, ect.).

We hope this introduction to the GPIB Bus and LabVIEW will help you program more sophisticated interfacing applications in the future! In another write up, we explain how you can write your own driver programs using the SCPI commands (scientific commands for programmable instruments) and the two special VISA Write and VISA Read icons of National Instruments. Good luck!

143438967.doc

10

Version, Feb. 2002

You might also like