Agilent VEE Practical Graphical Programming Agilent Technologies
Notices © Agilent Technologies, Inc. 2008 Warranty No part of this manual may be reproduced in any form or by any means (including electronic storage and retrieval or translation into a foreign language) without prior agreement and written consent from Agilent Technologies, Inc. as governed by United States and international copyright laws. The material contained in this document is provided “as is,” and is subject to being changed, without notice, in future editions.
In This Guide… This guide introduces you to the fundamentals of Agilent Visual Engineering Environment (VEE Pro), along with some complex examples 1 The VEE Pro 8 Fundamentals This chapter explores the fundamentals of VEE Pro 8. It consists of an explanation of Mouse use and navigation of tool bars and menus. The final two exercises show how to develop a noisy waveform and the generation of random numbers. It includes four exercises.
6 The Virtual Vehicle Radiator This chapter develops a virtual thermometer that displays temperature and a Vehicle Radiator that displays temperature and pressure changes. The final two exercises demonstrate how data are monitored and logged for a Vehicle Radiator. This unit consists of four exercises. 7 Program Preparation and Testing This chapter will develop a pulse program and show you how to add, restrict, vary, and change parameters. Use of the To File is also included in an exercise.
11 UserFunction Development This chapter will examine the development of user functions. UserFunctions will be called, edited, and used to monitor a variety of statistical parameters. 12 Excel™ Spreadsheets This chapter will examine the applications of Excel™ spreadsheets within VEE Pro. Vehicle Radiator data is then transferred to an Excel™ spreadsheet directly, via Globals, and then via a template. Finally, a series of sequential tests are displayed on an Excel™ spreadsheet.
17 VEE Pro Libraries This chapter will examine the use of VEE Pro UserFunction libraries. It will also show you how to import and delete selected libraries. Finally, a program will be developed to monitor Vehicle Radiator test limits. 18 Sequencer Usage This chapter will examine the various options of the Sequencer Object, how to pass data and explore global variables via the Sequencer. The final exercise will use the Sequencer to compare a waveform with a mask.
Contents Preface ii The VEE Pro 8 Fundamentals 1 The Mouse as Used in VEE Pro 2 Overview 3 Exercise 1.
Contents Changing internal object parameters 18 Changing the Waveform (Time) Mag scale 19 Exercise 1.
Contents Exercise 2.1 - Configuring a GPIB Instrument with a Panel Driver and Direct I/O 39 Reconfiguring an existing scope Panel Driver object 39 Exercise 2.2 - Calling Active X 44 Selecting ActiveX controls 44 Adding a control to VEE Pro 46 Exercise 2.3 - Working with the Web Browser 49 Using the Web Browser with ActiveX controls 49 Exercise 2.
Contents DotNet Control and Communications 73 Overview 74 Exercise 4.1 - Applying a dotNET Date-time Example 76 Applying the dotNET DateTimeConversion program 76 Exercise 4.2 - Selecting Alternate Ways of Choosing dotNET Files 78 Applying the OpenFileDialog class 78 Exercise 4.3 - Using dotNET Operations Builder for ListBox Examples 81 Exercise 4.4 - Using dotNET for Examining the Content of a Stack 85 Summary 89 Record Manipulation 91 Overview 92 Exercise 5.
Contents Agilent VEE 8 Features and Handy Tools The Virtual Vehicle Radiator 109 Overview 110 Exercise 6.1 - Simulating a Thermometer 111 Creating a virtual thermometer 111 Monitoring the thermometer UserObject 112 Modifying thermometer temperature-related parameters 113 Observing the effect of parameter changes to the thermometer program 114 Exercise 6.
Contents Program Preparation and Testing 133 Overview 134 Exercise 7.
Contents Test Data Analysis and Display 155 Overview 156 Exercise 8.1 - Modifying the Formula Object 158 Typing a statistical function into the Formula object 158 Calculating two parameters using one Formula object 159 Calculating a ramp function using the Formula object 160 Calculating standard deviations for a ramp function 161 Exercise 8.
Contents Displaying data via From File 190 Summary 192 Vehicle Radiator Statistical Calculations and Presentations 193 Overview 194 Exercise 9.1 - Calculating Statistical Parameters with a Formula Object 195 Displaying a waveform 195 Exercise 9.2 - Calculating and Displaying Multiple Statistical Parameters 198 Modifying the Vehicle Radiator program to include statistical calculations 198 Exercise 9.
Contents Exercise 10.2 - Customizing Test Databases 223 Performing a search and sort operation with DataSets 223 Exercise 10.3 - Using Operator Interfaces for Search Operations 226 Preparing for a search operation 226 Creating an operator interface 230 Summary 233 UserFunction Development 235 Overview 236 Exercise 11.1 - Merging Bar Chart Display Programs 237 Displaying VEE Pro data on a bar chart 237 Exercise 11.2 - Operating with UserFunctions 240 Creating a UserFunction 240 Exercise 11.
Contents Preparing and transferring data to a multi-column Excel™ spreadsheet 264 Exercise 12.3 - Transferring VEE Pro Data to Excel™ via Globals 272 Sending VEE Pro data to an Excel™ spreadsheet via ActiveX 272 Exercise 12.4 - Developing a VEE Pro to Excel™ Template 280 Creating an VEE Pro to Excel™ template 280 Exercise 12.5 - Documenting Four Sequential Vehicle Radiator Tests via Excel™ 283 Using Excel™ to document several test runs 283 Summary 287 Microsoft Word™ Reports 289 Overview 290 Exercise 13.
Contents Simulation and MATLAB® VEE Pro Application Simulations 307 Overview 308 Exercise 14.1 - Simulating an Instrumentation Amplifier 310 Generating a differential signal with an ideal instrumentation amplifier 310 Examining the ability of an IA to measure a small signal buried in noise 313 Changing the differential gain of the instrumentation amplifier by a factor of ten 314 Exercise 14.2 - Simulating a Strain Gauge 316 Constructing a four-element simulated strain gauge 316 Exercise 14.
Contents Examining pulse wave spectra 337 Examining noise spectra for different time samples 338 Adding fundamental and third-harmonic waveforms 340 Multiplying fundamental and third-harmonic waveforms 341 Showing two-sine-wave distortions of a fundamental 343 Exercise 15.2 - Simulating a Square Wave 345 Devising a virtual square wave 345 Changing the number of added sine waves for a wave shape display 347 Exercise 15.
Contents Exercise 16.3 - Exploring a Pre-Designed Digital Filter Program 367 Exploring the Agilent digital filter program 367 Exercise 16.4 - Using MATLAB® to Display the Pre-Designed Digital Filter 371 Displaying the Agilent digital filter output using MATLAB® 371 Summary 376 VEE Pro Libraries 377 Overview 378 Exercise 17.1 - Exploring UserFunction Libraries 379 Creating and saving a library of UserFunctions 379 Applying I/O transaction guidelines 383 Exercise 17.
Contents Exercise 18.1 - Examining the Sequencer Options 407 Importing a bitmap for a panel background 407 Exercise 18.2 - Passing Data via the Sequencer 409 Passing data via a UserFunction 409 Setting up (three) tests in the Sequencer to call Rand via an input terminal 410 Controlling test using the Slider 412 Exercise 18.3 - Exploring Global Variables with the Sequencer 414 Passing data using a global variable 414 Exercise 18.
Contents Exercise 19.4 - Selecting Data via Custom Menus 442 Using operator-interface menus to guide an operator 442 Summary 416 Graphical Operator Interfaces 449 Overview 450 Exercise 20.1- Executing the Order of Tests 451 Configuring and specifying a pass/fail test 451 Adding or inserting a configured test 453 Deleting a configured test 454 Accessing logged "record of records" test data 455 Exercise 20.2 - Creating a Status Panel 459 Creating a status panel for in-progress test 459 Exercise 20.
Contents xxvi Agilent VEE - Practical Graphical Programming
Agilent VEE Practical Graphical Programming 1 The VEE Pro 8 Fundamentals The Mouse as Used in VEE Pro 2 Overview 3 Exercise 1.1 - The Development Screen and Its Bars 4 Exercise 1.2 - Note Pads, Error Codes, and Object Views 13 Exercise 1.3 - Generating and Displaying a Noisy Waveform 20 Exercise 1.4 - Generating Random Numbers for Test Development 30 Summary 36 This chapter explores the fundamentals of VEE Pro 8. It consists of an explanation of Mouse use and navigation of toolbars and menus.
1 The VEE Pro 8 Fundamentals The Mouse as Used in VEE Pro The mouse is a major device for preparing and navigating a VEE Pro 8 program. The functions of the mouse as used in VEE Pro 8 are described below. The mouse controls a marker whose shape depends upon its application. The marker can be either one of the following: • a movable arrow that indicates where the marker is located on the screen.
The VEE Pro 8 Fundamentals 1 Overview Exercise 1.1 The Development Screen and Its Bars This exercise will show you how to open the VEE Pro 8 program, view the Title, Menu, Tool, and Status bars, and examine their titles, icons, menus, control buttons and/or indicators; examine three types of Note Pads, connect objects in a VEE Pro 8 program, use Undo and Redo, and run and save a program. Exercise 1.
1 The VEE Pro 8 Fundamentals Exercise 1.1 - The Development Screen and Its Bars Learn how to open the VEE Pro 8 program, view the Title, Menu, Tool, and Status bars, and examine their titles, icons, menus, control buttons and/or indicators; examine three types of Note Pads, connect objects in a VEE Pro 8 program, use Undo and Redo, and run and save a program. Opening the VEE Pro 8 program 1 Click Start; go to Programs; select Agilent VEE Pro 8.
The VEE Pro 8 Fundamentals NO TE 1 The bottom of your screen has Start as its left-hand label. It is the Microsoft Taskbar. When more than one program or file is open, then it displays their titles for easy access. The open program or file is depressed and is a lighter grey than are the other open programs or files. Examining Menu Bar titles 1 Examine the items listed beneath the light- blue bar. These are titles on the Menu Bar, starting with File, Edit, and so forth.
1 The VEE Pro 8 Fundamentals Figure 1-2 The Three Upper- Right Screen- Control Buttons Opening the Properties window and Program Explorer 1 Go to Menu Bar => View and select (with a check mark) Program Explorer and then Properties. The result of these selections is displayed in Figure 1- 3. The first item selected is the Program Explorer. Its display is on the top left side and shows the hierarchical location of the Main Work Area. This hierarchy will be expanded upon in later exercises.
The VEE Pro 8 Fundamentals 1 Verifying the display of the Toolbar and Status Bar 1 Go to Menu Bar => View => Toolbar and Menu Bar => View => Status Bar to verify that they have been selected via check marks. (These bars can be removed by deleting their check marks.) NO TE Click on sub-heads under Properties to see the explanation in the bottom of the Properties window. Viewing the Toolbar buttons 1 Examine the Toolbar which is the third row from the top of the screen. See Figure 1- 4.
1 The VEE Pro 8 Fundamentals Figure 1-5 The Hierarchy of "Device" from the Menu Bar Examining three types of Note Pads 1 See Figure 1- 6. Here are three types of Note Pads: The standard Note Pad from Menu Bar => Display => Note Pad (upper left), The Note Pad where the standard information has been erased and another expression has been typed by the user (upper right), and the Note Pad from Menu Bar => System => What is the System menu? (bottom).
The VEE Pro 8 Fundamentals 1 Figure 1-6 Three Types of Note Pads Agilent VEE - Practical Graphical Programming 9
1 The VEE Pro 8 Fundamentals Connecting objects in a VEE Pro 8 program 1 Go to Menu Bar => Device => Virtual Source => Function Generator. Place this object on the left side of the screen. NO TE Objects are individual units (blocks) in the development of a VEE Pro program that perform specific tasks. Each object (icon) contains software code. 2 Go to Menu Bar => Display => Waveform (Time). Place this object to the right of the Function Generator.
The VEE Pro 8 Fundamentals 1 Figure 1-7 Two Connected objects Using the Undo and Redo operations 1 Remove the connection by holding down Ctrl and Z at the same time. The connection will be removed. Note also the two curved arrows on the top right side of the toolbar (Figure 1- 8). The left- hand arrow is dark and will read "Redo Line Add" to indicate that it can be applied. Figure 1-8 Two Other Methods of Applying Undo 2 Reinstate the connection by holding down Ctrl and Y at the same time.
1 The VEE Pro 8 Fundamentals NO TE Redo will work only for the last Undo for both objects and connections. Figure 1-9 Two Other Methods of Applying Redo Saving a program to a personal disk 1 Save EXER01.1 to your personal disk as follows: insert your personal disk, Select Menu Bar => File => Save As… .; select your personal disk; go to the File Name field; type EXER01.1 if not named; click Save; close this saved exercise to your personal disk.
The VEE Pro 8 Fundamentals 1 Exercise 1.2 - Note Pads, Error Codes, and Object Views In this exercise, you will learn to select and enter data and/or text into a Note Pad, size that object and all other objects, examine how to access error codes via the Help menu, stop and correct a program, change between the Open View and Icon View, change object internal parameters, and change virtual oscilloscope scales. Open the VEE Pro program "EXER01.
1 The VEE Pro 8 Fundamentals 2 Type the following program description into your Note Pad editing area: The Function Generator generates a cosine waveform; when connected to Waveform (Time), it displays this waveform when the "Run" is keyed. NO TE If step 2 is done first, then highlight text with Ctrl+A and change font and color if desired. Sizing the Note Pad and all other objects 1 Size your Note Pad.
The VEE Pro 8 Fundamentals 1 Examining the use of the Note Pad via the Help menu 1 Right- click any place on the Note Pad and a drop- down menu will appear; click on Help; examine the description of this object and its use. NO TE When the property EditEnabled is True, it allows you to edit the text in the panel. When the property EditEnabled is False, no editing is allowed; the editing area is greyed out. This is useful when you do not want other users to modify your note.
1 The VEE Pro 8 Fundamentals Figure 1-11 Run Time Error Displayed 2 Click on Help within the VEE Run Time Error box. The explanation for the error code will appear. 3 or: select Menu bar => Help => Contents and Index to open VEE online help, under Search tab, type "Error Codes" into the upper- left search box, and click List Topics button. Then double- click on the words "Error Codes" on the list that displays.
The VEE Pro 8 Fundamentals 1 Figure 1-12 An Error Code example Stopping and correcting a program 1 Close the VEE Run Time Error box and stop the program. Restore the connection between the Function Generator and Waveform (Time). Changing between Open View and Icon View 1 Place your mouse on the title bar where the words "Function Generator" are displayed. NO TE This view of the Function Generator is the Open View. 2 Click the dot on the right end of the title bar - its icon "minimize" button.
1 The VEE Pro 8 Fundamentals Figure 1-13 The Function Generator Open View and Icon View Changing internal object parameters 1 Drag the mouse pointer across the Frequency numbers in the white area (data field); change the displayed numbers from 200 to 100 OR double- click on the Frequency white area (data field) and enter: 100. See Figure 1- 14. NO TE To save time and space, this instruction will be shortened to read as follows: "Edit Frequency to 100".
The VEE Pro 8 Fundamentals 1 Changing the Waveform (Time) Mag scale 1 Click on Waveform (Time) Mag box. Turn Automatic Scaling to off. Change the Maximum to 2 and the Minimum to - 2. Run this program with the new scale settings. 2 Run this program; compare its results with the previously settings. See Figure 1- 15. NO TE If the waveform amplitude is greater than the Waveform (Time) display and "Auto Scale" is on, the display will automatically adapt to the height and width of the waveform.
1 The VEE Pro 8 Fundamentals Exercise 1.
The VEE Pro 8 Fundamentals 1 8 Click on the Formula object Menu button; select Add terminal => Data Input. A second input pin will appear labelled "B". Naming terminals and pins to describe their function 1 Double- click on the Formula "A" input pin; change the pin name to Cosine. 2 Connect the Function Generator Func output pin to the Formula data input pin "Cosine". 3 Connect the Noise Generator noiseWF output pin to the Formula data input pin "B"; change the pin name to "Noise".
1 The VEE Pro 8 Fundamentals 7 Connect the Cosine + Noise Result output pin to the Temp output pin. See Figure 1- 16. 8 Go to the upper- right corner of the UserObject and click on the horizontal bar; it will send the UserObject, in the form of an icon, to the bottom left of the Main work area. Its Icon View will also appear in the Main work area. See Figure 1- 17.
The VEE Pro 8 Fundamentals 1 Displaying a running program with a virtual oscilloscope 1 Select Menu Bar => Display => Waveform (Time); place it to the right of the Noisy Cosine object. Change its Title to Oscilloscope. 2 Change its Y Scale name from Mag to Temp. 3 Change its Trace Info name from Trace 1 to Degree C. 4 Connect the Noisy Cosine output pin (Temp) to the oscilloscope input pin Degree C. 5 Move the oscilloscope so its display shows fully in the Main window.
1 The VEE Pro 8 Fundamentals ◊ Noting object parameter changes in the description box and with the red triangle To expand your knowledge, explore the following variations to this Exercise 01.3: 9 Open your saved program EXER01.3. 10 Click on the Temp label in the oscilloscope object; vary the scope screen amplitude; observe its effect on the waveform. NO TE The symbol ◊ informs you that the indicated step enables you to expand your understanding of the flexibility and functionality of VEE Pro 8.
The VEE Pro 8 Fundamentals 1 12 Double- click on the AlphaNumeric. Change its Title to Temperature in Degree C. Select Menu Bar => View => Program Explorer. Three views of the UserObject will appear as shown in Figure 1- 19.
1 The VEE Pro 8 Fundamentals Selecting Properties with your mouse right button 1 Click on Menu Bar => View => Properties; the UserObject Properties window will appear. 2 Open the oscilloscope description box again. See Figure 1- 20. Figure 1-20 UserObject Properties window Displayed with Description Showing Sizing an object 1 Go to the upper- right corner of the Noisy Cosine UserObject.
The VEE Pro 8 Fundamentals 1 Selecting and editing an object and converting it to an Icon View 2 Edit Frequency of the Function Generator to 100. 3 Click on the Function Generator upper- right button; it will reduce the Function Generator object to an icon. Move the Function Generator object to the left of the Work Area slightly above the center. 4 Click on the Noise Generator upper- right button; it will reduce the Noise Generator object to an Icon View.
1 The VEE Pro 8 Fundamentals Figure 1-21 Function & Object Browser pop-up dialog box and its Formula object 3 Click on Create Formula in the lower- left corner of the pop- up dialog box; a new formula "A+B" will appear. 4 Place "A+B" to the right of the Function Generator and the Noise Generator. NO TE This is another way to create the A+B (Formula) object. The Function & Object Browser object provides access to the VEE-determined library of math expressions.
The VEE Pro 8 Fundamentals 1 Saving a program via the Menu Bar 1 Select Menu Bar => File => Save As 2 Save this program to your personal disk; name it as EXER01.3; click OK.
1 The VEE Pro 8 Fundamentals Exercise 1.4 - Generating Random Numbers for Test Development This exercise will show you how to create a program that generates random numbers, displays them, and indicates the total time required to both generate and display the values. Open VEE Pro; clear your Work Area, maximize Main; toggle Program Explorer off.
The VEE Pro 8 Fundamentals 1 5 Connect the bottom pin of Do to the top pin of For Count; set the count value to 12. 6 Select Menu Bar => Device => Function & Object Browser => Type: Built- in Functions; Category: Probability and Statistics; Functions: Random. 7 Click on Create Formula; place the object to the right of For Count. See Figure 1- 22. Figure 1-22 Partial layout of Exercise 1.4 8 Go to the random Object menu and delete both input pins first low, then high.
1 The VEE Pro 8 Fundamentals 12 Select Menu Bar => Flow => Do; place it below For Count. Connect For Count sequence output (bottom) pin to the Do sequence input (top) pin. Applying the Collector object and accessing its Help explanation 1 Select Menu Bar => Data => Collector; place it below random(0,10); connect its Data (input) pin to the random(0,10) output (Result) pin.
The VEE Pro 8 Fundamentals 1 Validating the number of data points collected 1 Select Menu Bar => Display => AlphaNumeric; place it to the right of the Formula; change its Title to Final Count. 2 Connect the output of Formula to the input of Final Count adding "1" to For Count. Determining the elapsed time to run a program 1 Select Menu Bar => Device => Timer; place it to the right of Random Numbers; change its Title to Elapsed Time.
1 The VEE Pro 8 Fundamentals Figure 1-23 Generating and monitoring random data 6 Save this program as EXER01.4. Demonstrating the usefulness of Show Data Flow and Show Execution Flow buttons 1 Experiment with this program and assess the changes: • Change the value of For Count. • Change the range of the low, high values in random(0,10), both low and high. • Remove the Formula object; connect For Count directly to Final Count. • Turn on the Show Data Flow button in the Toolbar; monitor the data flow.
The VEE Pro 8 Fundamentals 1 Developing a faster random number generator 1 Open your VEE Pro 8 program and select Menu Bar => Flow => Start; place this object in the upper left corner. 2 Select Menu Bar => Flow => Do; place this object below Start. 3 Select Menu Bar => Device => Timer; place it to the right of Start; change its title bar to Elapsed Time.
1 The VEE Pro 8 Fundamentals Summary This chapter provides an introduction to the VEE Pro development screen and its bars; note pads, error codes, and different views of an object; how to generate a noisy waveform, and the generation of random numbers. The next four chapters examine hardware connectivity; Chapter 2 focuses on instrument control and communications. This completes Chapter 1.
Agilent VEE Practical Graphical Programming 2 Instrument Communication Overview 38 Exercise 2.1 - Configuring a GPIB Instrument with a Panel Driver and Direct I/O 39 Exercise 2.2 - Calling Active X 44 Exercise 2.3 - Working with the Web Browser 49 Exercise 2.4 - Communicating with USB, LAN, and RS-232 51 Summary 54 This chapter will examine the configuration of GPIB instruments with a Panel Driver and Direct I/O.
2 Instrument Communication Overview Exercise 2.1 Configuring a GPIB Instrument with a Panel Driver and Direct I/O This exercise will show you how to configure an instrument from the Menu bar, to use a Panel Driver, modify that instrument's name and controlling parameters, and save the configuration for later applications. Exercise 2.2 Calling Active X This exercise will show you how to call ActiveX and investigate some of its flexibilities and its many properties. Exercise 2.
Instrument Communication 2 Exercise 2.1 - Configuring a GPIB Instrument with a Panel Driver and Direct I/O This exercise will show you how to configure an instrument from the Menu bar, to use a Panel Driver, modify that instrument's name and controlling parameters, and save the configuration for later applications. Advantages of GPIB include a speed of 1 Mb/sec, shielded cable, will allow up to 14 instruments per system with addresses from 1 to 30, can be a daisy- chain configuration, and a stable system.
2 Instrument Communication Figure 2-1 The Instrument Manager window 2 Move the dialog box, by dragging its title bar, if you so desire; "My Configuration" should be highlighted. 3 Click Add under Instrument. This displays the Instrument Properties window, which presents the following fields: Add Interface/Device: Select GPIB from the following list - GPIB, ASRL, TCPIP, USB, NIDAQ, VXI, GPIO. Instrument Properties: Name: Enter scope name.
Instrument Communication 2 Board Number: The select code of the interface (GPIB) plus the local bus address of the instrument (which is a number from 0 to 31). Type 0 in the Board Number field because you are developing a program without an instrument present (NOT LIVE). VISA Alias: The alias for VISA address string. It must be the same as it is configured in Agilent IO library. Leave it empty here. VISA Address: Enter "GPIB0::14::INSTR" where GPIB0 is card #0.
2 Instrument Communication Figure 2-2 Instrument Manager programmed for a virtual scope 13 Click Open; then click OK when Advanced Instrument Properties appears. 14 Return to the Instrument Manager box; click the Save button. NO TE • An instrument object named Scope using the driver file hp54504a@(NOT LIVE) is now in your list of available instruments. It does not have a bus address specified because it is NOT LIVE at this time.
Instrument Communication NO TE 2 You are ready to connect a real instrument to your computer and select an active address. 16 Save this program as EXER02.1 to your personal disk. NO TE In Exercise 4 below, you will explore LAN and USB.
2 Instrument Communication Exercise 2.2 - Calling Active X This exercise will show you how to call ActiveX and investigate some of its flexibilities and many properties. Open VEE and clear your Work Area and maximize Main. Selecting ActiveX controls 1 Select Menu Bar => Device => ActiveX Control References. 2 Place checkmarks in those Registered Controls that you want to use with VEE Pro. NO TE Select only those Controls that will be used in your program as much memory space is consumed.
Instrument Communication 2 Figure 2-4 ActiveX Control References Box Agilent VEE - Practical Graphical Programming 45
2 Instrument Communication Adding a control to VEE Pro 1 Select Menu Bar => Device => ActiveX Controls => Calendar; see Figure 2- 5. Figure 2-5 Selected ActiveX Device (Calendar) 2 Release the selected Calendar; a calendar will appear; enlarge it so it becomes readable. See Figure 2- 6.
Instrument Communication 2 Figure 2-6 The Calendar NO TE • Controls (objects) can be placed on a VEE Pro Main, UserObject, or UserFunction screen. • Controls can be deleted by either selecting Cut (the scissors) from the Toolbar, highlighting the object and pressing the Delete key on your keyboard, or by right-clicking on the object and selecting "Delete Object" on the menu. 3 Right- click on Calendar and select the Properties window; then open its Control Properties window.
2 Instrument Communication Figure 2-7 The Two Properties windows for Calendar 4 Save this exercise as EXER02.2. 5 Select Menu Bar => Flow => Confirm (OK); place the OK button next to the Calendar control. This OK button will force the program to run as long as it is not pressed. 6 Select Menu Bar => Run; you can now select the new dates in the Calendar ActiveX control; then press the OK button to stop the execution of the program. 7 Close this program without saving it.
Instrument Communication 2 Exercise 2.3 - Working with the Web Browser This exercise will show you how to use ActiveX controls to access the internet. Open VEE and clear your Work Area and maximize Main. Using the Web Browser with ActiveX controls 1 Go to Help, select Open Examples, then open ActiveX controls. 2 Open the WebBrowser icon. See Figure 2- 8. 3 Click the Run button; the Agilent WebBrowser. WebBrowser1 will appear with information choices at the top and bottom.
2 Instrument Communication 5 Go to the icon object "WebBrowser Setup. You can change the address (that is in Red) where it says "WebBrowser1.Navigate". You may insert any desired web site address and reach that web site. As noted in Figure 2- 8 on the Note Pad, you may also reach an HTML help file on your local hard drive. 6 An example of using a different web site is given in Figure 2- 9 after changing the first line of the WebBrowser Setup object to http://www.agilent.com/find/adn.
Instrument Communication 2 Exercise 2.4 - Communicating with USB, LAN, and RS-232 This exercise will show you how to integrate your equipment with USB and LAN connections. Advantages of USB are: it is easy to connect and disconnect, requires no extra card, and cables are available at a modest price, and allows high- speed data transfer. However, LAN is not always easy to configure or control but it allows access to the World Wide Web. Open VEE and clear your Work Area and maximize Main.
2 Instrument Communication 5 Click on 82357B USB/GPIB Interface High- Speed USB 2.0 in the upper- left corner of the Product Comparison chart. 6 View the Demo video to catch a glimpse of how easy it is to connect your instrument using the 82357B Multimedia Demonstration. 7 Learn about the features of the USB/GPIB interface via the Agilent I/O Hardware Family Datasheet. 8 Click on IO Libraries Suite 14.
Instrument Communication 2 Connecting to a USB networked hub 1 Go to the USB Product Comparison table; Figure 2- 10 again, and select the E5813A Networked 5- Port USB Hub. 2 Interface a variety of GPIB, RS- 232, and USB devices as necessary to complete your test system. (GPIB and RS- 232 devices require attachment of a converter to the E5813A). See Figure 2- 12. Figure 2-12 Networked Five-Port USB hub 3 Apply power where appropriate.
2 Instrument Communication Summary This chapter showed you how to configure GPIB instruments, how to call ActiveX controls, how to use controls to access the Internet, and explained how to integrate your equipment via USB and LAN communications. The next chapter will describe how to connect hardware with other controls. This completes Chapter 2.
Agilent VEE Practical Graphical Programming 3 Instrument Controls Overview 56 Exercise 3.1 - Selecting an Instrument 57 Exercise 3.2 - Monitoring Passive Devices 59 Exercise 3.3 - Interacting with Equipment 65 Exercise 3.4 - Integrating National Instruments Hardware 68 Summary 71 This chapter will examine how to select and configure an instrument driver and simulate how to set up and measure temperature using a thermocouple.
3 Instrument Controls Overview Exercise 3.1 Selecting an Instrument This exercise will show you how to set the parameters within VEE Pro to configure an actual instrument driver, such as an oscilloscope. Exercise 3.2 Monitoring Passive Devices This exercise will show you how to set up and measure temperature using a thermocouple and a digital multimeter for VEE Pro access. Exercise 3.
Instrument Controls 3 Exercise 3.1 - Selecting an Instrument This exercise will show you how to set the parameters within VEE Pro to configure an actual instrument driver, such as an oscilloscope. Open your VEE program and clear your Work Area and maximize it. 1 Open EXER02.1. It should look like Figure 3- 1. Save it as EXER03.1 immediately. NO TE EXER02.1 showed you how to add new instruments to the Instrument Manager.
3 Instrument Controls Configuring a virtual instrument to a real instrument 1 Select Menu Bar => I/O => Instrument Manager. 2 Choose scope(Agilent54504a(@(NOT LIVE)). 3 Open Properties; double- click on the VISA Address field; change the address to GPIB0::9::INSTR. NO TE • The "9" in the address signifies the default address for oscilloscopes and "0" is the GPIB board card number. • Click on Advanced under Properties; toggle the Live Mode to ON; click OK twice.
Instrument Controls 3 Exercise 3.2 - Monitoring Passive Devices This exercise will show you how to set up and measure temperature using a thermocouple and a digital multimeter for VEE Pro access. Reference: Practical Temperature Measurements, Agilent Technologies Application Note 270, Publication Number 5965- 7822E. Installing the 34970A data acquisition switch unit 1 Turn off your computer. 2 Install the 34970A unit in the appropriate slot as noted in your card list.
3 Instrument Controls Figure 3-2 The 34970A Data Acquisition/Switch Unit 3 Turn on your computer.
Instrument Controls 3 Configuring the interface Open your VEE program and clear your Work Area and maximize Main. 1 Select Menu Bar => I/O => Instrument Manager… . 2 Select "My configuration" if it is not the default folder. 3 Select AGILENT34970A from the "My configuration" list. NO TE We have assumed that the unit for this instrument has been installed on your computer; see step 2 above. 4 Obtain a J- type thermocouple and install it into one of the channels on the 20- channel multiplexer (34901A).
3 Instrument Controls Figure 3-4 Thermocouple setup with its ice bath and equivalent circuit 7 Place a beaker of water on a hot plate; insert the( J- type) thermocouple (J1). 8 Set the controls on the Data Acquisition/Switch Unit to cause its panel to display temperature readings. (See the 34970A manual for guidance.) 9 Turn on the hot plate; note the temperature changes via the panel readout, set as advised in Application Note 290. 10 Turn off the hot plate.
Instrument Controls 3 Figure 3-5 Partial program for temperature graphing 5 See Figure 3- 6 for a simulated output of temperature data. NO TE The lines on the graph were inserted to illustrate the output; the input pins are not connected so the program, as shown, will not run. 6 Close your partial program, saving it only if you plan to connect equipment.
3 Instrument Controls Figure 3-6 Simulation of the graphing program after running NO TE 64 For further information, see Agilent 34970A Data Acquisition/Switching Product Overview publication 5966-4443EN obtained via the Agilent Web site: www.agilent.com/find/assist.
Instrument Controls 3 Exercise 3.3 - Interacting with Equipment This exercise will show you how to send a single text command, or an expression list, to an active instrument using Direct I/O. Open your VEE program and clear your Work Area and maximize Main. Sending a single text command to an active instrument 1 Select Menu Bar => I/O => Instrument Manager… 2 Select funcgen(@(NOT LIVE)); click on Direct I/O to create a Direct I/O object; place the object in Main.
3 Instrument Controls Sending an expression list to an active instrument 1 Select Menu Bar => I/O => Instrument Manager… 2 Select funcgen(@(NOT LIVE)); click on "Direct I/O"; place it to the right of the Work Area. 3 Double- click on its transaction bar to obtain its Dialog Box. 4 Select WRITE TEXT, and type "FR",A,"HZ" with EOL ON; click OK. NO TE • FR represents frequency; A represents the frequency value at input terminal A, and HZ represents the frequency unit: "Hertz".
Instrument Controls NO TE 3 • The Function Generator will start at 10 Hz, increase in steps of 50 kHz, and stop at 2.1MHz. • This subprogram is designed to work with the Agilent3325B Function Generator. Set the Instrument Manager to call the live instrument. When the Agilent3325B is connected, change the transaction box Title to "LIVE". 8 Save this program as EXER03.3a. 9 Run this program only if the Agilent3325B is attached.
3 Instrument Controls Exercise 3.4 - Integrating National Instruments Hardware This exercise will demonstrate how to set up National Instrument drivers in VEE Pro. Open your VEE program and clear your Work Area and maximize Main. Using National Instruments Data Acquisition in VEE Pro 1 Go to Menu Bar => Help; search for "Using NI"; select "Using NI Data Acquisition in VEE".
Instrument Controls 3 Figure 3-9 Selection of the Function Panel for NIDMM 8 Open Function Help; read all material that applies to your planned NI instrument program. 9 Return to "Using NI Data Acquisition in VEE"; read the sections titled "SCXI Support" and "NI- DAQ Asynchronousity Issues". 10 Go to "NI- SCOPE Fetch/Read Functions" and read all material that applies to your planned NI instrument program.
3 Instrument Controls Fetching/Reading Data to a scope 1 Prepare the AGniScope sub- program as shown in Figure 3- 10. Figure 3-10 A multi-fetch two-channel data acquition sub-program 2 Prepare the remainder of your program as guided by the NI Help topics within VEE and NI materials. 3 Save your final program as EXER03.4.
Instrument Controls 3 Summary This chapter showed you how to select and configure an instrument driver and simulated how to set up and measure temperature using a thermocouple. It also demonstrated how to interact with equipment using direct I/O and how to set up National Instrument drivers in VEE Pro. The next chapter will show how to communicate with .NET. This completes Chapter 3.
3 72 Instrument Controls Agilent VEE - Practical Graphical Programming
Agilent VEE Practical Graphical Programming 4 DotNet Control and Communications Overview 74 Exercise 4.1 - Applying a dotNET Date-time Example 76 Exercise 4.2 - Selecting Alternate Ways of Choosing dotNET Files 78 Exercise 4.3 - Using dotNET Operations Builder for ListBox Examples 81 Exercise 4.
4 DotNet Control and Communications Overview Exercise 4.1 Applying a dotNET Date-time Example This exercise applies DateTimeConversion to demonstrate how dotNET can be used to insert date/time into a VEE Pro 8 program. Exercise 4.2 Selecting Alternate Ways of Choosing dotNET Files This example demonstrates how to use the OpenFileDialog class to display and apply a Windows standard open file dialog box. Exercise 4.
DotNet Control and Communications 4 Exercise 4.4 Using dotNET for Examining the Content of a Stack The Stack example is used to demonstrate one of the built- in data structures in .NET Framework. A stack is a last in, first out collection. This example shows how to add (push) objects to the stack and remove (pop) them. The .NET (pronounced dot net) capabilities were developed by Microsoft. Some of its capabilities are applicable to VEE Pro 8.
4 DotNet Control and Communications Exercise 4.1 - Applying a dotNET Date-time Example This exercise applies DateTimeConversion to demonstrate how dotNET can be used to insert date/time into a VEE Pro 8 program. Open VEE Pro 8, clear your Work Area, and maximize Main. Applying the dotNET DateTimeConversion program 1 Go to Help => Open Example => DotNET => DateTimeConversion. Rearrange the objects as shown in Figure 4- 1.
DotNet Control and Communications NO TE 4 It is easy to convert UTC time to local time. The System namespace is imported to save typing. 3 Run this program. It should look like Figure 4- 2 but with your current date and time inserted. Figure 4-2 .NET to VEE portion of conversion program 4 Insert these three objects into whatever program you desire to include VEE Pro date and time. 5 Save Figure 4- 2 as EXER04.1; close your modified program.
4 DotNet Control and Communications Exercise 4.2 - Selecting Alternate Ways of Choosing dotNET Files This example demonstrates how to use the OpenFileDialog class to display and apply a Windows standard open file dialog box. Clear your Work Area and maximize Main. Applying the OpenFileDialog class 1 Go to Help => Open Example => DotNET => SelectFiles. See Figure 4- 3. This figure offers the Select Files program included in one object.
DotNet Control and Communications NO TE 4 This program could be developed as a single object (above) or by using the Function & Object Browser and selecting the appropriate categories. Figure 4-4 Generating the "openfielddialog" object with the Function & Object Browser 3 Devise the program shown in Figure 4- 5 in the same Main area of Figure 4- 4; it will perform the same as Figure 4- 3; run this program.
4 DotNet Control and Communications Figure 4-5 SelectFiles program with separate objects after running 4 Save this program as EXER04.2.
DotNet Control and Communications 4 Exercise 4.3 - Using dotNET Operations Builder for ListBox Examples The ListBox and CheckedListBox examples can be used to select specific items from lists either by highlighting the item or by checking it. 1 Clear your Work Area and maximize Main. 2 Select Menu Bar => Help => Open Example => DotNETControls => ListBox. See Figure 4- 6 and arrange objects as shown. Figure 4-6 ListBox before running 3 Save it as EXER04.
4 DotNet Control and Communications Figure 4-7 ListBox while running 4 Increase the Text Array via its Property box to six and add two more colors to the Text Array box. See Figure 4- 8. NO TE 82 The two added colors were automatically alphabetized as noted in the ListBox.
DotNet Control and Communications 4 Figure 4-8 Expanded ListBox with two of six colors selected 5 Save this figure as EXER04.3a and close this program. 6 Select Menu Bar => Help => Open Example => DotNETControls => CheckedListBox. See Figure 4- 9; add two colors and arrange objects as shown. NO TE • The two colors are not alphabetized in the CheckedListBox below. • Only one color at a time is displayed.
4 DotNet Control and Communications Figure 4-9 CheckedListBox after being expanded and while running 7 Save this program as EXER04.3b. NO TE 84 To build your own Add an Item object, select Menu Bar => Device => Windows Forms Controls => ListBox => right-click on ListBox, generate .NET Operation Builder; double-click to Add an Operation; select Accessibility object; go to Items; select Add; click OK twice - the item Add is then added as "System.Windows.Forms.ListBox".
DotNet Control and Communications 4 Exercise 4.4 - Using dotNET for Examining the Content of a Stack The Stack example can be used to demonstrate one of the built- in data structures in .NET Framework. A stack is a last in, first out collection which is in contrast to a queue. A queue is a first in, first out collection. This example shows how to add (push) objects to the stack and remove (pop) them. Stacks may be coupled to other programs such as a Payroll data base.
4 DotNet Control and Communications 2 Open all icons, arrange the objects, and change the Text object information as shown in Figure 4- 11. Figure 4-11 Modified Stack Example before running 3 Save this program as EXER04.4. 4 Run this program; it should look like Figure 4- 12; note that the stack output is the reverse of the Text icon.
DotNet Control and Communications 4 Figure 4-12 Modified Stack Example after running 5 Modify the For Count from 8 to 7; change the array size from 8 to 7 via its Properties window. 6 Change the Title of the Logging AlphaNumeric to Names of Employees. 7 Change the content of the Text object; our choices are shown in Figure 4- 13; save this as EXER04.4a. 8 Run this program.
4 DotNet Control and Communications Figure 4-13 Names and size of Text object modified 9 Close this program.
DotNet Control and Communications 4 Summary This chapter uses four dotNET and dotNET control examples to demonstrate the flexibility of a multitude of dotNET applications. Additional examples can be found in three locations: 1 Open VEE Pro Help, click on Guide to Agilent VEE Example Programs under Contents tab; select .NET examples. These examples demonstrate .NET's power and flexibility and are rated by difficulty. 2 Select Menu Bar => Help => Open Example => DotNET.
4 90 DotNet Control and Communications Agilent VEE - Practical Graphical Programming
www.agilent.