Beruflich Dokumente
Kultur Dokumente
Agilent Technologies
Notices
© Agilent Technologies, Inc. 2003 Warranty 1987). U.S. Government users will receive
No part of this manual may be reproduced in no greater than Limited Rights as defined in
The material contained in this docu- FAR 52.227-14 (June 1987) or DFAR
any form or by any means (including elec- ment is provided “as is,” and is sub- 252.227-7015 (b)(2) (November 1995), as
tronic storage and retrieval or translation ject to being changed, without notice,
into a foreign language) without prior agree- applicable in any technical data.
in future editions. Further, to the max-
ment and written consent from Agilent imum extent permitted by applicable
Technologies, Inc. as governed by United Safety Notices
law, Agilent disclaims all warranties,
States and international copyright laws. either express or implied, with regard
to this manual and any information
Manual Part Number contained herein, including but not
CAUTION
E2011-90011 limited to the implied warranties of
merchantability and fitness for a par- A CAUTION notice denotes a haz-
Edition ticular purpose. Agilent shall not be ard. It calls attention to an operat-
liable for errors or for incidental or ing procedure, practice, or the like
Version 7.0 consequential damages in connec-
Eighth edition, February 2004
that, if not correctly performed or
tion with the furnishing, use, or per-
formance of this document or of any adhered to, could result in damage
Printed in USA
information contained herein. Should to the product or loss of important
Agilent Technologies, Inc. Agilent and the user have a separate
815 14 Street SW
data. Do not proceed beyond a
written agreement with warranty
Loveland, CO 80537USA terms covering the material in this
CAUTION notice until the indicated
document that conflict with these conditions are fully understood and
terms, the warranty terms in the sep- met.
arate agreement shall control.
Technology Licenses
The hardware and/or software described in
WA R N I N G
this document are furnished under a license
and may be used or copied only in accor- A WARNING notice denotes a
dance with the terms of such license. hazard. It calls attention to an
operating procedure, practice, or
Restricted Rights Legend the like that, if not correctly per-
If software is for use in the performance of a formed or adhered to, could result
U.S. Government prime contract or subcon- in personal injury or death. Do not
tract, Software is delivered and licensed as
“Commercial computer software” as proceed beyond a WARNING
defined in DFAR 252.227-7014 (June 1995), notice until the indicated condi-
or as a “commercial item” as defined in FAR tions are fully understood and
2.101(a) or as “Restricted computer soft- met.
ware” as defined in FAR 52.227-19 (June
1987) or any equivalent agency regulation or
contract clause. Use, duplication or disclo-
sure of Software is subject to Agilent Tech-
nologies’ standard commercial license
terms, and non-DOD Departments and
Agencies of the U.S. Government will
receive no greater than Restricted Rights as
defined in FAR 52.227-19(c)(1-2) (June
Table 1
File Computer font represents text that you will see on the
screen in Figures, including menu names, features, and
buttons.
Introduction
Introduction .......................................................................... 2
Overview of Agilent VEE ............................................................... 3
Advantages of Using Agilent VEE for Test Development ................................. 3
Creating Operator Interfaces in Agilent VEE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Leveraging Existing Test Programs with Agilent VEE .................................... 9
Controlling Instruments with Agilent VEE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Improving Test Capabilities with Agilent VEE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Installing and Learning About Agilent VEE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Installing Agilent VEE and I/O Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Learning about Agilent VEE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Ordering Free Evaluation Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
MATLAB Script Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Signal Processing Toolbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
About Full-Featured MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Obtaining Agilent VEE Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Obtaining Information on the World Wide Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Sources of Additional Information for MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
10 Test Sequencing
Test Sequencing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Using the Sequencer Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Creating a Test Execution Order ....................................................... 366
Lab 10-1: Configuring a Test ....................................................... 366
Adding or Inserting or Deleting a Test ............................................... 372
Accessing Logged Test Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Passing Data in the Sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
Lab 10-2: Passing Data Using an Input Terminal ...................................... 377
Passing Data Using a Global Variable ............................................... 380
Comparing a Waveform Output with a Mask ......................................... 384
Analyzing Data from the Sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Lab 10-3: Analyzing Several Runs of Data from the Sequencer . . . . . . . . . . . . . . . . . . . . . . . . . . 390
Storing and Retrieving Logged Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Lab 10-4: Using the To/From File Objects with Logged Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Using the To/From DataSet Objects with Logged Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Chapter Checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
Glossary
Introduction
This chapter introduces Agilent VEE and its major features. You
also learn how to install and learn about VEE, and how to
obtain VEE support.
In Figure I-2, some objects are displayed in detail, and some are displayed
NOTE with only the name showing. The objects that are displayed in detail are
shown in open view. Open view allows you to see the details of the object.
To save space and increase program execution speed, you can iconize
objects, or reduce them so that only the names are showing.
For example, in Figure I-2, the object labeled Random Number is shown as
an icon. The object labeled Create Array is shown using an open view. The
open view is larger and more detailed.
The program and its operator interface are different views of the same VEE
NOTE program. You can go back and forth from one view to the other by clicking
the detail view and panel view buttons in the window title bar in VEE. Any
edits or updates that you make to a program (detail view) are automatically
made to the operator interface (panel view). You can also secure the
operator interface from unwanted changes.
The VEE programs for many of the lab exercises and programming
NOTE examples in this manual are included in VEE, under Help ⇒ Open
Example... ⇒ Manual ⇒ UsersGuide.
1
Using the Agilent VEE Development
Environment
Overview 21
Interacting with Agilent VEE 22
Working with Objects 29
Understanding Pins and Terminals 46
Connecting Objects to Make a Program 52
How Agilent VEE Programs Work 65
Chapter Checklist 72
Overview
In this chapter, you will learn how to start VEE, how to use
menus, and how to work with objects. You will learn about
pins and terminals in VEE. You will connect objects together
to build a simple VEE program, and learn how VEE
programs work.
Supported Systems
This version of VEE is supported on the following operating
systems:
• Windows 98, Windows 2000, Windows NT 4.0, and
Windows XP on a PC.
The right mouse button is used less frequently. You are advised if you need
NOTE to click the right mouse button. If your mouse has a middle button, you will
not use it for VEE.
Title Bar
Menu Bar
Tool Bar
Properties
Work Area
Status Bar
Screen Description
Descriptors
Title bar The top line in the window contains the VEE icon, the
window name, and the minimize, maximize, and close
buttons. Move the window by dragging the title bar. Click
the VEE icon to get the window’s menu.
Menu bar The second line contains menu items, each of which
provides VEE commands or objects.
Toolbar The third line contains icons, or buttons, that provide direct
access (or “shortcuts”) to the most commonly used menu
commands. (Place the mouse pointer over a button and VEE
displays its function.)
Program Explorer A region on the left side of the VEE window showing the
structure of the VEE program. The upper corner shows the
current program name, such as myprog.vee, or it displays
Untitled.
Main window A window that contains a work area where you develop
and edit VEE programs. There can be other
programming/editing windows, such as UserObject.
Status bar The bottom line displays messages about VEE status,
including four status indicators in the right corner. The
indicators (from left to right) show:
The execution mode
The state of the profiler
MOD appears when the program has been modified
Web server is enabled.
Getting Help
VEE provides an online Help system for the VEE
environment, and online Help for individual objects and
topics. In addition, you can get help in the documentation
that came with the computer and its operating system. The
PC online Help includes information about topics such as:
• Choosing commands on the menu bar
• Selecting and dismissing menu items
• Using toolbars
• Understanding title bars and status bars
• Clicking icons and buttons
• Working with dialog boxes
• Working with various types of windows
• Using online help
To begin, you may want to start with the Help ⇒ Welcome
screen, where you can access the VEE Multimedia Tutorials.
The Welcome screen is shown in Figure 2.
Table 2
Table 2
About Agilent VEE Support Provides information about getting support for
VEE.
Installing and Distributing Explains how to distribute the VEE Pro RunTime
Agilent VEE Pro Runtime environment.
Subsequent exercises assume you have started the VEE software. Refer
NOTE back to this page or to the section called “Starting Agilent VEE” on
page 23 for instructions on starting VEE.
The arrow to the right of Virtual Source indicates a submenu. Three dots
NOTE after a menu item indicate that one or more dialog boxes will follow. For
example, File ⇒ Save As... operates this way.
Having placed an object in the work area, you can move the
object by dragging its title bar, just as you move a window.
Minimize button
The iconic view conserves space in the work area and makes
programs more readable. The open view provides more detail
and allows you to edit the properties and settings of an
object.
1 To switch from an open to iconic view, click the Minimize
button (the box on the right end of the object's title bar).
2 To return to an open view, double- click the object icon
view (anywhere on the object).
The object menu also has Minimize and Restore selections. To display the
NOTE object menu, click on the Object Menu button on the left end of the title
bar, or right click anywhere on the object.
Not all objects have the same structure or parts, but you can
edit objects in their open views and save space in their icon
views.
Object Menu
You can also select the object menu by placing the mouse
pointer anywhere on the object body and clicking the
right mouse button. This works for both the open and
icon views.
Moving an Object
1 To move the Function Generator object, click Move in the
object menu, then click and hold the left mouse button.
An outline of the object appears.
2 Move the outline to the new location while continuing to
hold the mouse button down, as shown in Figure 9.
Release the mouse button, and the object moves to the
new location.
“Object Location Information, located on the status bar (at the bottom of
NOTE the VEE window) gives the X and Y position (in pixels) of the upper-left
corner of the outline relative to the upper-left corner of the workspace. To
view an object’s exact location, left click on an object to select it and hold
the left mouse button down. The location is displayed in the status bar.
Use this information when you need to place an object in an exact
position.
Copying an Object
This action copies an object to the clipboard, so you could
Paste it to VEE or another application such as MS Paint or
MS Word.
Click on an object to highlight it, then click Edit ⇒ Copy.
- OR-
Click on an object to highlight it, then press Ctrl-C.
Deleting an Object
To delete an object from the work area, go to the object
menu for the object you want to delete and click Delete. For
example, go to the object menu for the Function Generator
and click Delete. The object disappears from the work area,
but it is saved in the buffer.
Open the object menu, and select Delete.
- OR-
Select the object (click on it) and press Ctrl-X.
- OR-
Place the mouse cursor over the object menu and
double- click.
Pasting an Object
To paste a copied object back into the work area, follow
these steps.
You can save time by using standard keyboard and mouse editing
NOTE techniques. For example, in the Properties dialog box Title field, if you click
at the extreme left edge of the edit area the cursor will appear there. You
can then add new text without deleting the existing title.
The word “select” is also used to indicate choosing a menu item, but the
NOTE context makes the meaning obvious.
In VEE, objects that you cut or copy are also placed on the Clipboard. You
NOTE can paste them into other Windows applications that support the
Windows Clipboard.
Editing Objects
There are several ways to edit objects in VEE. Different
editing menus display different choices. Choose an editing
menu or icon as follows:
Click Edit on the VEE menu bar to display the Edit menu,
and select the operation you want. The commands in the
Edit menu are the same for all of VEE.
- OR-
Click on an icon on the VEE toolbar. The VEE toolbar
contains icons for frequently used editing commands such as
Cut, Copy, and Paste.
- OR-
Open the object’s object menu by clicking on it, and select
the operation you want. Object menus include editing
operations specific to an object, such as the Properties
menu, that are not located in the main Edit menu. The
commands in the object menu also vary depending on the
type of object. For example, compare the object menus for
the Device ⇒ Formula and I/O ⇒ To ⇒ File objects. The two
menus contain different choices that are specific to the
object.
- OR-
Place the mouse pointer anywhere on a blank work area
space and click the right mouse button. A pop- up Edit
menu appears.
Inactive menu items appear in a different shade than active items (they are
NOTE “grayed out”). For instance, the Cut, Copy, and Clone operations in the Edit
menu appear in a different shade from active menu items until an object is
highlighted in the work area
Scroll bars appear if your program is larger than the work area, as shown in
NOTE Figure 16.
If you click near a terminal, a line or “wire” may appear. If this happens,
NOTE move the pointer to an open area and double-click.
Vertical
Scroll Bar
This dialog box has tabs that let you select options to edit.
General The default tab when the Default Preferences dialog box
appears (shown previously). You can change the values of
the displayed parameters; for example, Environment and
Execution Mode.
Printing Lets you set the values of the parameters for a printer.
Web Server Lets you enable the built-in Web server to monitor and
troubleshoot a program from a remote Web browser.
Table 4
Data Input Pin The pin (or pins) on the left-hand side of an object.
Data Output Pin The pin (or pins) on the right-hand side of an object.
Adding a Terminal
You can add terminals to an object. For example, you can
add a second data input terminal to the Formula object.
Open the object menu and select Add Terminal ⇒ Data Input.
- OR-
With Show Terminals turned on, you can place the mouse
pointer in the “terminal area” (the left margin of the open
view object) and press Ctrl+A (press the Ctrl and A keys
simultaneously).
Figure 21 shows the Formula object menu open to add a
data input terminal, and another Formula object that has a
second terminal already added. The new terminal is labeled
B. If the data inputs are tied to particular functions, as with
instrument drivers, you are given a menu of these functions.
Otherwise, the terminals are named A, B, C... .
You can now edit the terminal. The dialog box has three
kinds of fields:
Table 5
status field A field with a gray background that cannot be edited. For
example, the Mode field cannot be edited.
selection field A field with a white background that has an arrow on its
right-hand side. Clicking the field or its arrow displays a
drop-down list. For example, if you click Any (or the arrow)
in the Required Type field, you can select another data type
from the list by clicking the list as shown in Figure 23.
If you select a data type other than Any for a data input
terminal, only the specified type of data or data that can be
converted to that type will be accepted by the terminal. Most
of the time it is best to leave the Required Type and
Deleting a Terminal
Open the object menu and select Delete Terminal ⇒ Input...
or Delete Terminal ⇒ Output, choose the input or output to
delete, and click OK. For example, Figure 24 shows the
dialog box that appears when you choose Delete Terminal ⇒
Input....
- OR-
Place the mouse pointer over the terminal and press
CTRL-D.
If you decide you did not want to delete the terminal, select
the Undo button from the Taskbar.
You may have to size the Note Pad, depending upon the
screen. To size an object, open the object menu, select
Size, move the sizing arrow cursor to a corner of the
object and drag. You can also click and drag any corner of
the object.)
2 Add the Function Generator object. Select Device ⇒ Virtual
Source ⇒ Function Generator, position the outline on the left
side of the work area, and click to place the object. Edit
the frequency to 100 by clicking in the Frequency field
and typing 100.
3 Add the Waveform (Time) object. Select Display ⇒
Waveform (Time) and place the object to the right side of
the work area as shown in Figure 25.
Running a Program
5 Continuing with the same exercise, click the Run button
on the toolbar to run the program, or use Debug ⇒ Run.
The program displays a 100 Hz Cosine wave in the
Waveform (Time) display as shown in Figure 26. (Your
object might have a different frequency, which is not
important to the example.)
Table 6
Pause Ctrl+P
Resume Ctrl+G
Step Into Ctrl+T
When you click OK, VEE prints the screen on the default
printer named in the dialog box. You can select another
printer, change the print range, and enter the number of
copies. Click the Properties button for more selections.
Different print drivers may use different dialog boxes. For
further information about using Windows dialog boxes, see
Microsoft Windows Help.
You can also click the Print Screen button on the toolbar to
print the screen directly.
Saving a Program
You can save a program at any time. (You can save whatever
is in the work area, whether it is a complete program or
not).
10 Continuing with the same example, select File ⇒ Save
As... and complete the dialog box.
A dialog box entitled Save File appears. Figure 31 shows
the format for this box.
You can use the long file names allowed by Windows 98, Windows 2000,
NOTE Windows NT 4.0, and Windows XP.
In the Save File dialog box, you can make changes to the
different fields as follows:
Save as type VEE programs are normally saved with the .vee extension,
but you can change the file type if you wish. If you type a file
name without the extension, the .vee is automatically
added.
Save colors and (Optional) If you have changed program colors and fonts,
fonts with using the Default Preferences menu, and you want others
program who load the program to get the colors and fonts you
selected (rather than their defaults), click to check this
item.
To re-save the program to the same file name, click the Save button or
NOTE press Ctrl+S at any time (File ⇒ Save). It is a good idea to save files
frequently while you are developing a program. To save a program that you
have edited to a different file name, press Ctrl+W or File ⇒ Save As.
Run Button
The command vee.exe -r filename starts VEE and automatically runs the
NOTE program specified by filename. For example, you could create an icon on
the Windows desktop and set its Properties ⇒ Shortcut to run a
particular VEE program. An operator could then double-click an icon on the
desktop to start VEE and run a program automatically. For more
information, refer to the Windows Help information about commands and
prompt paths.
Program
Explorer
Main
UserObject,
open view
UserObject,
icon view
User Object,
If you close the Main window in VEE, you can display the Main window
NOTE again by selecting View ⇒ Main.
The VEE programs for many of the lab exercises and programming
NOTE examples in this manual are included in VEE, under Help ⇒ Open
Example... ⇒ Manual ⇒ UsersGuide.
Show Execution Flow and Show Data Flow can be enabled together or
NOTE individually by clicking their toolbar buttons or their commands in the
Debug menu. Normally, you should turn these commands off because they
slow down the program.
You can display the value of an output by using the mouse to hover over
NOTE the line. For example, hovering over the line from the Real64 Slider object
to the Noise Generator displays a value of 0.401. Notice that the value on
the line (0.401) matches the value shown on the Real64 Slider, as shown in
Figure 39. (Note that the objects are shown in iconized view.)
Chapter Checklist
You should now be able to do any of the following tasks.
Review topics as needed, before going on to the next
chapter.
• Look up on- line help documentation from the main menu
bar and from the object menus.
• Start VEE.
• Identify the main menu bar, toolbar buttons, work area,
and status bar.
• Explain the Program Explorer and its purpose.
• Select menu items from the main menu and object menus.
• Perform the following operations on an object: moving,
renaming, iconizing, expanding, sizing, selecting,
deselecting, deleting, cloning, etc.
• Move the work area, clear the work area, and manage
multiple windows.
• Identify data and sequence pins on an object and explain
their purpose.
• Examine terminals and change their names.
• Connect objects to create a program to simulate waveform
data.
• Create, run, print and save a program.
• Exit VEE, and then reopen a program.
• Explain how data flows through a VEE program.
2
Agilent VEE Programming Techniques
Overview 75
General Techniques 76
Using Online Help 97
Debugging Programs in Agilent VEE 100
Practice Programs 115
Documenting Agilent VEE Programs 119
Chapter Checklist 125
Overview
In this chapter, you will learn selected VEE programming
techniques to help you build your own programs. For
example, VEE allows you to create customized objects called
UserObjects. You can also create interfaces for operators to
use that show only the necessary parts of the program.
These are displayed in the Panel view of the program.
You can write data from VEE to a file, and read data from a
file into VEE. Data files and their associated I/O
transactions can be used for many purposes, including
communicating with instruments, files, strings, the operating
system, interfaces, other programs, and printers.
VEE supports many data types and provides extensive
mathematical processing capabilities. There are multiple
ways for you to use VEE to communicate with instruments.
VEE also provides powerful debugging tools to debug any
problems in programs.
General Techniques
Inside the Main VEE program, you can create logical groups
of objects, called UserObjects. A UserObject object (called
UserObject hereafter) is created by placing a logical group of
objects in a UserObject window. Inside the UserObject
window, you connect inputs and outputs in the same way as
the main program. The UserObject itself is connected to
other objects in the main program with inputs and outputs,
like any other object.
The idea in developing a UserObject is to create a unique
context that performs a useful purpose within the main
program. Besides conserving space in the main work area,
you can make the program more understandable by giving it
structure.
A VEE program can contain many UserObjects nested within
the Main program. Each UserObject has an icon view which
resides in the Main window. To associate the icon views of
the UserObjects in the main program with their associated
UserObject windows, name UserObjects in their edit
windows, which also names them in their associated icon
view. For example, if you name a UserObject AddNoise, its
icon window in the Main program and the title bar on the
UserObject will both read AddNoise. The following exercise
teaches you how to create a UserObject.
The icon view of the UserObject always resides in the Main window, and
NOTE you can connect its pins to other objects in the Main window.
Before you begin, make sure Program Explorer in the View menu is
NOTE deselected to give yourself more screen space in Main
If you run the program again now, with the Real64 Slider object removed
NOTE and the input pin still on the Noise Generator, you will get a VEE error
message that the input pin Amplitude on the Noise Generator is not
connected. Remember, all input pins must be connected for a VEE program
to run.
You can use Edit ⇒ Clean Up Lines to clean up the line routing within a
NOTE program. This command is context dependent. To clean up the lines for the
UserObject, it must be the active window. Click the UserObject window,
then, use Edit ⇒ Clean Up Lines.
3 Open the Object Menu for the Function Generator, and choose
Add Terminal ⇒ Data Input. In the dialog box for Select input to
add, choose Frequency and click OK.
4 Connect the top output pin of the Int32 Input object to
the input pin on the Function Generator. Notice that
Frequency can only be changed through the input pin
now, and you can no longer edit the Frequency input
field. The program should look like Figure 46.
5 Run the program. The input box for Int32 Input appears,
with the instruction Enter Frequency:. Try running the
program with different frequencies in the input box. See
Figure 47, shown at run- time with the pop- up input box.
Simply click and drag the pop- up box to control where it
appears.
The VEE programs for many of the lab exercises and programming
NOTE examples in this manual are included in VEE, under Help ⇒ Open
Example... ⇒ Manual ⇒ UsersGuide.
You can connect one data output pin to several data input pins.
NOTE
5 Click the Run button on the tool bar again to test the
program. The program now displays the noisy cosine wave
output by the AddNoise UserObject and writes a container
of waveform data to the file wavedata.
Double- click the To File object to get the open view, then
double- click the input terminal a to examine its contents.
You should see an array of 256 points.
Add a From File object to the program to read the data
back.
6 Select I/O ⇒ From ⇒ File and place it in the Main work
area. Add a read transaction to READ CONTAINER x and
change the file name to wavedata (the procedure is the
same as for To File). Then, delete the line between
Figure 52 simple-program.vee
You can size and move the objects in the panel view to
appropriate locations to create a panel similar to the one
shown in Figure 53.
Normally, VEE automatically handles all data type conversions. For more
NOTE information, select Help ⇒ Contents and Index from the VEE menu bar.
Then, browse How Do I..., Tell Me About..., or Reference.
When you run the program, the Formula object takes the
waveform input A and the real value B, and adds B to the
absolute value of A. In effect, the expression abs(A)+B
“rectifies” the sine wave and adds a “dc offset.” You could
have produced the same effect by using the A+B and abs(x)
objects, but it is easier to read an expression in a Formula
object. (This also saves space.)
Try double- clicking the input and output terminals of the
Formula object. Note that the real scalar on input B is added
to each element of the waveform data (a one- dimensional
array) on input A, and the resulting waveform is output on
the Result terminal.
To review how to open the main Help facility and a listing of the Help
NOTE contents, refer to “Getting Help" on page 25.
VEE also includes other helpful features for developing and debugging
NOTE programs, such as line probe. For more information, refer to “Debugging
Programs in Agilent VEE" on page 100
(To turn it off, click it again.) When you run the program,
you will see small squares moving along the data lines to
indicate the flow of data.
When you run the program, you will see a colored outline
around the objects as they execute.
Use Data Flow and Execution Flow to understand how a
program is operating, but turn them off to get higher
performance. Combining these features with debugging tools
such as breakpoints will help you understand how a VEE
program works and where possible errors lie.
Line Tip
If you click on a data line, a dialog box appears with all the
information about the data on the line. For example, Figure
61 shows the dialog box that appears when you click on the
output of the Function Generator.
Examining Terminals
To examine a terminal, double- click it in the open view as
mentioned in “Understanding Pins and Terminals" on
page 46. If an object is iconized, place the mouse pointer
over the terminal, and VEE automatically pops up the name
of the terminal.
Using Breakpoints
A breakpoint causes a program to pause before it executes a
particular object. You can set breakpoints in a program to
examine the data. When a breakpoint is set on an object, the
object is highlighted with an orange colored outline. When
the program runs, it will pause before executing that object.
1 Set a breakpoint on a single object. Double- click the title
bar of an object to get the Properties dialog box, then
select Breakpoint Enabled and click OK. Then select Debug
⇒ Activate Breakpoints. Run the program. It will pause at
the object with the breakpoint.
2 Set additional breakpoints on several other objects. Select
the objects. (Press Ctrl and click on each object.) Click
the Toggle Breakpoint(s) button on the tool bar as shown in
Figure 62. (You could also press Ctrl-B.) Run the
program again. The program pauses at the first object
with a breakpoint set.
Resume Button
(same as Run Button)
Resolving Errors
If you get an error message when you run a program, VEE
automatically puts a red outline around the object where the
error was found.
You can either correct the error and the outline will
disappear, or you can click the Stop button, which will
remove the red outline, and then fix the error. If you click
Stop, you can look at the error again before resuming, with
View ⇒ Last Error.
1 (if connected)
4
2
1 If the sequence input pin is connected, the object will not operate until
it receives a message to execute (a “ping” in VEE terms). However,
the sequence input pin does not have to be connected.
2 All data input pins must have data before the object operates. (You
can add data input/output pins to most objects. Click on the
Add/Delete Terminal menu in any object menu to find out the pins
that can be added.)
3 The object performs its task. In this case, A is added to B and the
result is placed on the output pin.
4 The data output pin fires. The object waits for a signal from the next
object that the data is received before its operation is completed.
Therefore, a given object does not fire its sequence output pin until all
objects connected to its data output pin have received data.
Figure 71 Step Into, Step Over, and Step Out Buttons on the Toolbar
For more information about the step functions, refer to online Help. For
NOTE more information about UserFunctions, refer to Chapter , “Using Agilent
VEE Functions,” on page 329.
Practice Programs
The practice programs in this section illustrate more VEE
features.
As you move the mouse pointer with the line attached near the target pin,
NOTE a box highlights the pin. Then you click again to complete the connection.
If for some reason you want to terminate the line connecting operation
NOTE before you have completed the link, double-click the mouse and the line
will disappear.
6 Click the Run button on the tool bar, and you will see a
random number displayed as shown in Figure 72.
This exercise uses one of the Constant objects for an input dialog box by
NOTE simply changing its title to a prompt. This is a common technique for
getting user input. You could use Data ⇒ Dialog Box ⇒ Real64 Input.
Also, you can double-click on the title bar to get the Constant Properties
dialog box.
7 Connect the Set num sequence output pin to the Get num
sequence input pin.
A global variable has to be set before you can use it. Therefore, you need
NOTE to use the sequence pins in this case to make sure that the variable num
has been set, before you retrieve it with Get num.
The entries in the Description dialog box will not be visible to users unless
NOTE they access them through the object menu. Also, notice that you can
insert a file in this dialog box.
M: Main
Device Type : Main
Description :
1. The program, Random, generates a real number between 0 and 1
2. and then displays the results.
Context is secured : off
Trig mode : Degrees
Popup Panel Title Text : Untitled
Show Popup Panel Title : on
Show Popup Panel Border : on
Popup Moveable : on
Popup Panel Title Text Color : Object Title Text
Popup Panel Title Background Color : Object Title
Popup Panel Title Text Font : Object Title Text
Delete Globals at Prerun : on
M.2: Main/Int32
Device Type : Constant
Output pin 1 : Int32
Wait For Event : off
Auto execute : off
Initialize At Prerun : off
Initialize at Activate : off
Constant size fixed : off
Password masking : off
Indices Enabled : on
Int32 Value :0
M.4: Main/Int32
Device Type : Constant
Output pin 1 : Int32
Wait For Event : off
Auto execute : off
Initialize At Prerun : off
Initialize at Activate : off
Constant size fixed : off
After you run the Save Documentation command, run a File ⇒ Print
NOTE Program command to put identification numbers on the objects, so you
can match the text documentation to the printer output.
Chapter Checklist
You should now be able to perform the following tasks.
Review topics, if necessary, before proceeding to the next
chapter.
• Create a UserObject, and explain how UserObjects give
programs structure and save space on screen.
• Create pop- up dialog boxes and sliders (or knobs) for
user input.
• Use data files to save data to a file and load data from a
file.
• Create an operator interface, using a Panel view of the
program.
• Use different data types and data shapes.
• Use mathematical operators and functions.
• Use online Help.
• Show the data flow and the execution flow in a program.
• Debug programs by examining data on a line, terminals,
and alphanumeric displays.
• Use breakpoints.
• Resolve errors with the GoTo command.
• Resolve errors using the Call Stack.
• Use Step Into, Step Over, and Step Out to trace and debug
a program.
• Use the Find feature.
• Document objects with description dialog boxes.
• Generate a documentation file.
3
Easy Ways to Control Instruments
Overview 129
Configuring an Instrument 133
Using a Panel Driver 142
Using Direct I/O 147
Using PC Plug-in Boards 157
Using a VXIplug&play Driver 163
Other I/O Features 168
Chapter Checklist 169
Overview
In this chapter, you will learn how to use VEE to control
instruments. With VEE, you can control instruments in several
ways:
• “Panel” drivers give you a simple user interface (or “front
panel”) to control an instrument from your computer screen.
When you change parameters in the VEE panel driver, the
corresponding state of the instrument is changed. Panel
drivers are provided by Agilent Technologies with VEE and
cover over 450 instruments from different vendors.
• The Direct I/O object allows you to transmit commands
and receive data over many supported interfaces.
• I/O libraries can be imported to control PC Plug- in boards
and then call functions from that library using the Call object.
These libraries are usually shipped as Dynamic Link
Libraries (DLLs).
• VXIplug&play drivers can be used to call C functions to
control instruments. These are provided by Agilent
Technologies and other vendors with their supported
instruments.
This chapter is designed to give you the fundamentals of
controlling instruments to cover most situations. For more
complete information, refer to the VEE Pro Advanced Techniques
manual.
Panel Drivers
Agilent VEE includes over 450 panel drivers for different
instrument vendors. A panel driver works by using a display in
the VEE program that controls the settings in the corresponding
physical instrument. Panel drivers provide maximum
ease- of- use and save the most development time. Figure 78
shows an example of a panel driver.
VXIplug&play Drivers
VXIplug&play drivers are supplied by the instrument vendor or
by Agilent Technologies. (For a list of VXIplug&play drivers
available from Agilent Technologies, refer to the VEE literature or
the VEE Pro Advanced Techniques manual. Contact your instrument
vendor for other VXIplug&play drivers.) VEE enables you to
control an instrument with a VXIplug&play driver by making
calls to the driver. Figure 81 shows an example of calls to a
VXIplug&play driver from VEE.
Configuring an Instrument
With VEE you can develop programs without the instruments
present. In this exercise, you will configure an oscilloscope for
use with a panel driver. Then you will add the physical
instrument to the configuration.
If you have any instruments connected and powered on, VEE can find the
NOTE instruments and automatically find the drivers for them. For more
information about automatically finding and configuring instruments, refer
to the online Tutorials under Help ⇒ Welcome ⇒ Tutorials in the main
VEE screen.
Entry Description
Address The logical unit of the interface (GPIB is usually 7) plus the
local bus address of the instrument (a number from 0 to 31).
If you leave the address at 0, it means that you are
developing without an instrument present.
Entry Description
Description Enter any description here. For example, if you want the
instrument number on the title bar, enter the number.
4 Toggle Live Mode to OFF. Then click the Panel Driver folder,
and the dialog box appears as shown in Figure 85.
You need to install the panel drivers from the VEE CD-ROM to complete
NOTE the example. The *.cid files signify the compiled instrument driver files.
Sub Address Leave this field blank. Sub Address is used only by non-VXI
cardcage instruments for identifying plug-in modules.
Error Checking Leave the default setting ON. Error Checking can be turned
off for extra throughput, but then it does not check for I/O
errors.
Incremental Mode Leave the default setting ON. Incremental Mode can
also be turned off, which sends the entire instrument
command string for the instrument state each time you
change a setting.
In the Instrument Manager, you can often create different types of objects
NOTE under Create I/O Object, depending on the type of instrument configured.
For example, if you had chosen Direct I/O rather than Panel Driver for this
exercise, you would get a Direct I/O object with the name scope(@(NOT
LIVE)).VEE also provides a Component Driver, which uses a subset of the
functions provided by a Panel Driver. (For more information, refer to the
VEE Pro Advanced Techniques manual.)
3 Place the outline of the scope panel and click to place it. The
display should look similar to Figure 87.
You may now use the panel driver in the program like any other
VEE object.
3 Click Advanced: and toggle Live Mode to ON, then click OK.
Click OK to close the Instrument Properties box.
4 Click Save to save the changes.
Setting Description
Name Edit to fgen and press the Tab key twice to move to the
Address field.
4 Under Create I/O Object, click Panel Driver. Place the object on
the left side of the workspace. (This process would be the
same regardless of the instrument, as long as the instrument
had been configured and added to the list.)
1 Place the mouse pointer over the data input area of the
function generator instrument panel, and press CTRL-A to
add a data input terminal. A list box of the instrument
components appears.
2 Select the desired component from the menu presented.
You could also open the object menu and select Add Terminal by
NOTE Component ⇒ Select Input Component. Then select the desired
component field on the driver.
You could also open the object menu and select Delete Terminal ⇒
NOTE Input... from the object menu and choose the appropriate input from the
menu presented.
On Your Own
Set a state on the HP 3325B Function Generator, or any other
function generator available. Change the Function setting to a
Square wave. Add input components for Amplitude and
Frequency. Create input dialog boxes for the amplitude and
frequency and modify the titles to prompt the operator. Enter
different values for the amplitude and frequency, and run the
program to see if the settings have changed after operator
inputs. (If an instrument is attached, then its settings will
change if Live Mode is ON.)
In most cases, the process will be the same for sending text
commands to instruments. However, there are instruments that
specify characters sent at the end of each command or at the
end of a group of commands. You need to get this information
from the instrument documentation, then include it in the
Direct I/O Configuration dialog box.
Amplicon
Amplicon has a wide range of analog and digital I/O PC
plug- in boards within the 200 Series, all with VEE support.
The software interface is part of Amplicon’s AmpDIO driver
package, a 32- bit API with a multithreaded DLL for
Windows and support for interrupt driven acquisition. The
API contains over 100 calls for efficient and flexible
programming as a Compiled Function using a VEE- specific
definition file and the facility to utilize up to eight boards in
one program.
In addition to Amplicon’s own range of plug- in boards,
which includes serial communication devices, Amplicon can
supply boards from a wide range of other manufacturers for
data acquisition, serial communication, and GPIB
applications.
ComputerBoards PC Plug-ins
ComputerBoards offers low cost, powerful PC plug- in boards
that are compatible with VEE. (For a complete list of
supported PC plug- in vendors, see VEE literature or VEE
Pro Advanced Techniques.)
You simply install the board and its I/O library, and
configure the board using a program supplied by the
manufacturer. Follow the instructions to connect the board
to the device. In VEE, import the library, and you are ready
to call the measurement functions in the ComputerBoards
I/O library. See the figures below from a demonstration
program supplied by the manufacturer.
Finally, in the third menu, the actual functions are located, such
as me3000AISingle. Figure 104 shows the function panel.
VEE automatically initializes the instrument. You do not have to use an init
NOTE function, as you would in other languages.
Chapter Checklist
You should now be able to perform the following tasks. Review
the appropriate topics, if necessary, before going on to the next
chapter.
• Explain the benefits of using instrument drivers and Direct
I/O.
• Explain the process for controlling instruments.
• Configure an instrument for a state driver.
• Configure an instrument for Direct I/O.
• Change settings on an instrument driver.
• Add and delete component inputs and outputs.
• Move to different panels on an instrument driver.
• Use Direct I/O to write commands to an instrument.
• Use Direct I/O to read data from an instrument.
• Upload and download instrument states using learn strings.
• Use VXIplug&play drivers to communicate with an
instrument.
• Explain two methods for controlling PC plug- in boards.
4
Analyzing and Displaying Test Data
Overview 173
Agilent VEE Data Shapes and Data Types 174
Agilent VEE Analysis Capabilities 177
Using Built-In Math Objects 178
Creating Expressions with the Formula Object 182
Using MATLAB Script in Agilent VEE 188
Displaying Test Data 195
Customizing Test Data Displays 197
Chapter Checklist 201
Overview
In this chapter, you will learn about VEE analytical and display
capabilities. You will learn how to locate the right math objects
for your applications and how to display test results, so that you
can turn data into useful information easily and quickly.
You can also use other familiar applications such as MS Excel to
analyze the data using ActiveX Automation. (For more
information, refer to Chapter , “Creating Reports Easily
Using ActiveX,” on page 247.) You can use display
capabilities external to VEE using ActiveX controls. (For
more information, refer to “Lab 11- 4: Using an ActiveX
Control" on page 432). This chapter focuses on VEE's own
core set of tools and the MATLAB Script object included
with VEE.
Real32 A 32-bit floating point number that conforms to the IEEE 754
standard (+/-3.40282347E+/-38).
Real64 A 64-bit floating point number that conforms to the IEEE 754
standard (+/- 1.797693138623157 E308).
PComplex A magnitude and phase component in the form (mag,
@phase). Phase is set by default to degrees, but can be set
to radians or gradians with the File ⇒ Default Preferences
⇒ Trig Mode setting.
Complex A rectangular or Cartesian complex number having a real
and imaginary component in the form (real, imag). Each
component is Real64. For example, the complex number 1 +
2i is represented as (1,2).
Enum A text string that has an associated integer value. You can
access the integer value with the ordinal(x) function.
Record A composite data type with a field for each data type. Each
field has a name and a container, which can be of any type
and shape (including Record).
Variant Used only for ActiveX Automation and Controls, a data type
that is required for some ActiveX method calls as a By Ref
parameter type.
description
of function
You can go directly to the Function & Object Browser dialog box by
NOTE pressing the fx icon on the tool bar, shown in Figure 113, or by pressing
Ctrl-I.
The sdev(x) object is defined as the square root of the variance of x, and x
NOTE may be of the type UInt8, Int16, Int32, Real32, Real64, Coord, or Waveform.
The Function Generator outputs a Waveform data type.
You can type in a Formula expression on more than one line. If a Formula
NOTE expression contains a Return, it is interpreted as a multi-line single
expression. If a Formula contains statements separated by semi-colons (;),
they are interpreted as multiple expressions in the Formula.
The Formula box is an Rich Text Format box and you can
use standard editing commands to edit expressions in a
Formula. For example, you can drag the mouse to highlight
characters, use Ctrl-C for copying the characters, Ctrl-V
for pasting, and Ctrl-X for deleting as well as using End,
Insert, Delete, Backspace, etc.
Input field
All the functions created from the Devices ⇒ Function & Object Browser
NOTE Built-in type are simply Formulas that already have their expressions set
appropriately. They can be modified to combine functions and add (or
delete) inputs. You can also do multiple-line entry in the Formula object,
and assign values to output terminals.
You can put line breaks at any point in a Formula object. The formula is
NOTE read as one expression as long as there are no semi-colons. For example,
you could enter a single expression as
B=sdev
(A)
On Your Own
Complete the following exercises and check the results as
shown in Figure 119.
1 Create an array of numbers from 1 to 2048 using the ramp
object in the Generate category of Built- in Functions.
Calculate the standard deviation of this array and display it.
2 Do the same exercise described in the previous step, using
the ramp() function in a Formula object instead of the ramp
object.
3 Do the same exercise described in the previous step by
nesting the functions. Use only two objects.
For the second and third exercises, you have to delete the input
terminal A on the Formula object to avoid an error message,
because all data input pins must be connected and have data
before an object can operate.
If you already have MATLAB installed, VEE will use your installed
NOTE MATLAB to process MATLAB Script. However, if you do not have the
Signal Processing Toolbox, you will not be able to use those functions
from VEE unless the MATLAB Script Engine that ships with VEE is
registered. To register MATLAB, change directory (CD) to
<VEE_installation_dir>\MATLAB\bin and execute
MATLAB.exe /regserver.
For more information about MATLAB functions, from the main VEE
NOTE window, select Help ⇒ MATLAB Script ⇒ Help Desk.
Table 15 Displays
Display Description
Label An object used to put a text label on the Panel View. The
colors and fonts may be easily adjusted through
Properties... in the object menu while in the Panel View.
Table 15 Displays
Display Description
Displaying a Waveform
1 Select Device ⇒ Virtual Source ⇒ Noise Generator.
2 Select Display ⇒ Waveform (Time).
3 Connect the data output of the Noise Generator to the
data input of Waveform (Time) and run the program. It
should look like Figure 124.
You can get and set the values of the markers at runtime. See the online
NOTE Help topic under Contents and Index ⇒ How Do I... ⇒ Display Data for
more information.
You will see two white arrows pointing up and down at one
of the data points on the waveform. Also, notice that the
display records the x and y coordinates of these markers at
the bottom of the display. To measure the x or y distance
between two peaks, click- and- drag the arrows to the peaks
you want to measure. You will see one of the markers move
to those new peaks with the new coordinates recorded at
the bottom of the display, as shown in Figure 125.
You can also change these values at run time by using the Traces or
NOTE Scales control inputs. For more information, see the VEE Pro Advanced
Techniques manual.
VEE also includes Plot in the display object menus, which allows you to
NOTE plot test results on the display without printing out the rest of the program.
Chapter Checklist
You should now be able to do the following tasks. Review
topics as needed, before going on to the next chapter.
• Describe the main data types in VEE.
• Describe some of the main areas of analytical capabilities
in VEE.
• Find an online Help explanation for any object in the
Function & Browser dialog box.
• Describe the relationship between input pins and variables
in a VEE math object.
• Evaluate a mathematical expression using the Formula
object, and then evaluate two expressions using the
Formula object. (Remember to use a semicolon after the
first line.)
• Use a VEE function in a mathematical expression in the
Formula object.
• Use the MATLAB Script object.
• Describe major display capabilities in VEE.
• Customize a graphical display in terms of the scales used,
the part of the waveform seen, the markers used, and the
color of the trace.
5
Storing and Retrieving Test Results
Overview 205
Using Arrays to Store Test Results 206
Using the To/From File Objects 210
Using Records to Store Mixed Data Types 222
Using DataSets to Store and Retrieve Records 232
Customizing a Simple Test Database 237
Chapter Checklist 246
Overview
In this chapter, you will learn the fundamentals of storing and
retrieving test data. You will create arrays of the right data type
and size to hold your test results, and then access the data or
part of the data for analysis or display.
This chapter also describes the To/From File objects, the Record
data type, and Dataset files. The To File and From File objects
read data to and from files based on I/O transactions. The
Record data type can be used to store several types of data in a
single structure. You can use the Dataset to store one or more
records in a file, and perform search and sort operations on
datasets.
The To File object is also described in “Lab 2-3: Using Data Files” on
NOTE page 85 of Chapter , “Agilent VEE Programming Techniques.”
Indexing for arrays is zero- based in VEE, and brackets are used
to indicate the position of the array element. For example, if the
array A holds the elements [4, 5, 6], then
A[0] = 4, A[1] = 5, and A[2] = 6
The syntax for arrays is as follows:
Table 17
The To File object is also described in “Lab 2-3: Using Data Files” on
NOTE page 85 of Chapter , “Agilent VEE Programming Techniques.”
Action Description
READ Reads data from the specified source using the specified
encoding and format.
There are also a number of actions for I/O ⇒ Advanced I/O Operations
NOTE that you can examine by exploring the objects in the menu.
Encoding Explanations
BINBLOCK Uses IEEE488.2 definite length block headers with all VEE
data types in binary files.
CONTAINER Uses VEE specific text format with all data types.
Operation Description
filename Use the default file myFile. The default file can be changed
by clicking the To File input field to get a list box of files in
the home directory.
Clear File At Check this box. By default, VEE appends new data to the
PreRun & Open end of an existing file. Checking the box clears the file
before new data is written.
Entry Description
HH:MM:SS Click and toggle to HH:MM (from the hour, minute, and
second format to the hour, minute format).
You can also store and retrieve data using To DataSet or From DataSet,
NOTE which does not require you to know the type of data in the file. Datasets
are described in the section “Using DataSets to Store and Retrieve
Records" on page 232
Now add two more transactions to read back the time stamp
and the real array.
5 In the same From File object, double- click below the first
transaction bar. The I/O Transaction dialog box appears.
Double- click on the expression list input field to highlight x
and type y, for the second transaction to read data back to
pin y. (If this pin were left as “x” then the second transaction
would overwrite the data that the first transaction put into
“x,” instead of appending it.) Change REAL64 FORMAT to
STRING FORMAT, then click OK.
To read the time stamp back as a text string, use the STRING FORMAT.
NOTE The TIME STAMP FORMAT converts the time stamp data back to a Real
number.
6 In the same From File object, double- click below the second
transaction bar to display to the I/O Transaction dialog box.
Set entries as follows:
Entry Description
(expression field) Edit x to z, so that the Real array is read back to the Z
output terminal.
SIZE: Now the I/O Transaction box adds a SIZE button. In this
case, the array has four elements. Replace 10 with 4 and
click OK.
If you do not know the size of an array, you may toggle SIZE to TO END.
NOTE This will read data to the end of the file without VEE knowing its exact
size. For example, you could use this feature to read the entire contents of
a file as a string array to examine the file contents.
Notice that the first Alphanumeric displays the title, the second
displays the time of the test, and the third lists the numbers in
the array.
Building a Record
Build a Record with three fields: the name of a test stored as a
String, a time stamp stored as a Real Scalar, and simulated test
results stored as a four element Array of Reals. When you
retrieve these fields in the next exercise, you will see that you
can convert the time stamp into a number of different formats
for display.
Create the test name by selecting Data ⇒ Constant ⇒ Text and
entering Test1 in the input field. Rename the object Text
Constant. Iconize Text Constant.
9 Select Device ⇒ Function & Object Browser. Click Built- in
Functions under Type, Time & Date under Category, select
now under Functions, and click Create Formula. Place the
object below Text Constant.
10 Select Data ⇒ Constant ⇒ Real64 and place it below now().
11 You can turn this Scalar Real64 into an Array 1D by clicking
Properties... in the Real64 object menu and choosing 1D
Array.
12 Open the Constant Properties box by double- clicking on the
Real64 title bar. Select 1D Array under Configuration, change
the Size to 4, then click OK.
Enter four values into this array by double- clicking next to
element 0000 to highlight the first entry, then input the
values 2.2, 3.3, 4.4, 5.5 using the Tab key between
each entry. Iconize Real64.
13 Select Data ⇒ Build Data ⇒ Record and place it to the right
of the three other objects. Add a third data input terminal so
you can input three fields. Open each terminal by
double- clicking over the terminal and rename the three input
terminals to testname, time, and data.
The Output Shape on the Build Record object toggles between
Scalar and Array. The Scalar default will be the correct
choice for the majority of situations. (For more information,
see the VEE Pro Advanced Techniques manual.)
14 Connect the Text Constant object to the testname terminal,
the now() object to the time terminal, and the Real64 object
to the data terminal on the Build Record object.
15 Run the program. Double- click on the Record data output
terminal to examine the record. It should look like Figure
134.
You can see the three fields and their values. If you click on the
Real64: Array 1D button, a list box shows the actual values.
Notice that the time stamp has been stored as a Real64 Scalar.
In the next exercise, you will convert it to a more readable form.
Click OK to close the Output Terminal Information dialog box.
Save the program as records.vee.
Notice that the second display lists the weekday, the date, and
the time expressed in hours, minutes, and an a.m. or p.m.
designation.
4 Select Data ⇒ Access Record ⇒ Get Field and place the object
under the Set Field (rec.field=b) object. Edit the Get Field
object expression from rec.field to rec.data. Connect the
data output of rec.field = b to the data input of rec.field.
You could also use a Formula object with A.data in the expression field.
NOTE
You can modify any Record fields as shown in this example. You
could also modify part of the field. For example, try changing
the expression in rec.field = b to rec.data[1]=20. Then delete
the rec.field = b input b. Run the program again and you should
see the array: 2.2, 20, 4.4, 5.5.
Notice that the Name List pin gives the names testname, time, and
data of the three fields in the record, just as the Type List
identifies testname as Text, and time and data as Real64 types.
4 Select the Function & Object Browser icon from the tool bar.
a Choose Built- in Functions, Probability & Statistics, and
random to create the random (low, high) object. Place the
object below the Formula object.
b Delete the input terminals, and change the input
parameters from low to 0, and from high to 1.
c Rename the object Random Number, and connect its data
output to the B terminal of Build Record.
5 Connect the Formula sequence output pin to the sequence
input pin of Random Number. Connecting the sequence pins
ensures that each iteration of the program puts a new
random number into the B field of the particular record.
6 Select Data ⇒ Constant ⇒ Real64. Place the Real64 object
below the Formula object.
a Open the object menu and click Properties. Type Real
Array for the title, under Configuration click 1D Array, and
change the Size to 3. Click OK.
b Highlight each entry in the array by double- clicking and
typing in the numbers 1, 2, and 3.
c Connect the Real Array data output to the C terminal on
Build Record.
7 Select I/O ⇒ To ⇒ DataSet and place the object under Build
Record. Connect the data output of Build Record to its data
input. Leave the default file name myfile, and check Clear File
At PreRun.
8 Run the program. It should put an array of ten records into
the DataSet called myFile, as shown in Figure 139.
Now retrieve the array of records and display it using the From
DataSet and Record Constant objects.
9 Select I/O ⇒ From ⇒ DataSet and place the object below For
Count. Leave the default file name, myFile. Click the Get
Records field to toggle from One to All. Finally, leave the
default of 1 in the expression field at the bottom.
With these settings, VEE looks at the DataSet in myFile and
finds all the records that fit the criterion in the expression
field. If you set Get Records to One, VEE would output the
first record that met the criterion in the expression field. The
1 signifies a TRUE condition meaning that all of the records fit
the criterion, so the entire array of records in the file will be
put on the output pin labeled Rec. Other uses of the
expression field are explained in other exercises. Consult
Help in the object menu for more information.
Connect the For Count sequence output pin to the sequence
input on the From Data Set object. This ensures the part of
the program that sends data to myFile executes before the
data is read from the file. You can turn on Show Data Flow to
show the order of events.
10 Select Data ⇒ Constant ⇒ Record and place the object below
To Data Set. Open the object menu and select Add Terminal ⇒
Control Input. Click Default Value from the list box presented,
then click OK. Resize the Record object to be larger, so you
can see the results when you run the program.
The record received will become the default value. In this
case, Record will receive an array of records from the From
Data Set object, and it will format itself to display that array
of records.
11 Connect the From Data Set output pin Rec to the Default
Value pin on Record. If you would like to see this terminal,
open the object menu and select Properties, then Show
Terminals, then OK. A dotted line appears between From
Data Set and Record.
.
A dotted line between two objects indicates a control line.
NOTE
A From Data Set object must include at least one record that meets the
NOTE criterion, or VEE issues an error message. To avoid an error, add an EOF
(end-of-file) output pin to the object which activates if no records meet the
criterion. You can then add actions to the program when the EOF results.
To add an EOF pin, you could also open the object menu, and click Add
NOTE Terminal ⇒ Data Output....
the For Count sequence input pin. The program should look
like Figure 142.
Element Description
Element Description
The test name comes from the Test Menu as an Enum data
type. Quotes are required to put the correct formula into the
From DataSet object.
If the Add to Panel selection is grayed out, it means that you do not have
NOTE any objects selected in the work area.
To secure the operator interface and program from changes, select File ⇒
NOTE Create RunTime Version.... Enter a name for the program and VEE will
automatically add a *.vxe extension to separate it from unsecured
versions.
Chapter Checklist
You should now be able to perform the following tasks. Review
topics, if necessary, before proceeding to the next chapter.
• Explain the basic notation for using arrays.
• Create an array using the Collector object.
• Extract elements from an array using the Formula object.
• Send a string, time stamp, and real array to a file.
• Retrieve a string, time stamp, and real array from a file.
• Use the function now() for a time stamp.
• Format time stamps in a variety of ways for display.
• Build and unbuild a record.
• Get and set fields in a record.
• Store a record to a DataSet.
• Retrieve a record from a DataSet.
• Perform a search operation on a DataSet.
• Perform a sort operation on a Record field.
• Combine VEE tools to create a simple test database.
6
Creating Reports Easily Using ActiveX
Overview 249
ActiveX Automation in Agilent VEE 250
Sending Agilent VEE Data to MS Excel 255
Creating an Agilent VEE to MS Excel Template 264
Using MS Word for Agilent VEE Reports 270
Chapter Checklist 277
Overview
In this chapter, you will learn how to generate reports in other
applications, such as MS Excel, by sending data from the VEE
program to the MS Excel program. VEE uses ActiveX
Automation to control other applications, which provides a fast
process for creating detailed and effective reports.
The first lab exercise describes how to send data to an MS Excel
spreadsheet automatically using ActiveX Automation. The
second exercise describes a generic template for generating
reports, and how to expand on the functionality of the basic
template. The final exercise uses ActiveX in VEE to send a
screen dump and test data to an MS Word document. (The
principles are the same for other spreadsheet and word
processing programs that support ActiveX Automation.)
ActiveX replaces the use of DDE in VEE. However, DDE is still supported in
NOTE VEE. To use DDE in legacy applications, refer to the second edition of
Visual Programming with VEE.
There are also other related lab exercises in this manual: “Lab 11-4: Using
NOTE an ActiveX Control" on page 432, and “The Callable VEE ActiveX
Automation Server" on page 474. For more detailed information about
Automation terminology and concepts, refer to the VEE Pro Advanced
Techniques manual.
The syntax for data type Objects looks similar to the VEE syntax for getting
NOTE a Record field, rec.field, and calling a UserFunction, myLib.func(), so it is
important to assign descriptive names to variables.
The VEE programs for many of the lab exercises and programming
NOTE examples in this manual are included in VEE, under Help ⇒ Open
Example... ⇒ Manual ⇒ UsersGuide.
Command Description
set sheet = The keyword set is used to assign or set whatever is on the
right-hand side of the assignment operator (in this case, the
equal sign) to the variable on the left-hand side of the
expression. For example, set app sets the application
sheet.application, which has been defined as an Excel
worksheet.
worksheets(1); Now that Excel is running with a new workbook in it, with
CreateObject("Excel.Sheet"), you want to address the
first worksheet in it. Add worksheets(1) to the
statement, so the entire statement reads:
setsheet =
CreateObject("Excel.Sheet").worksheets(1);
set app = Asks Excel for a pointer to the entire application, and not
sheet.application; just the worksheet itself, by asking the worksheet for its
property Application and setting it to the variable app.
app.visible = true; Sets the app’s visible property to true in order to display
Excel on screen (so that you can see it).
Command Description
For more information about the Application Server libraries, refer to the
NOTE many books available about ActiveX Automation and MS Visual Basic. You
can probably find information on the World Wide Web about ordering
books such as Office 2000 or the Office 97 Visual Basic Programmer’s
Guide. The books will help you with VEE as well, since VEE syntax is very
similar to MS Visual Basic.
Formula Description
sheet.cells(1,1) = Refers to the first row and column in the Excel worksheet.
“DC Volts” The text DC Volts will be placed there. This sets the
default property (which is value) of cell (1,1), to "DC
Volts".
Formula Description
from 1 thru 20, As the For Range object outputs the integers from 1 to 20,
step 1 (the Fill in Cells puts the random number in the specified cell.
For Range object)
Entry Description
set range = Sets the VEE variable range to reference the range
sheet.range(“A2:A21"); A2 to A21 on the Excel worksheet. (A refers to the
first column in a worksheet.)
Entry Description
You can re- use this program as a template for displaying test
results in MS Excel. You simply put the test data into arrays and
modify the rest of the template to fill in the appropriate cells in
the right format.
To find additional methods and properties in the MS Excel
library, look at the Function & Object Browser and choose the
ActiveX Objects under Type and Excel under Library. You can
choose a Class or Member and press Help to get Help provided
by the Automation Server author (in this case, Microsoft). For
more complete information about these libraries, consult
Microsoft documentation.
On Your Own
Generate a waveform and strip out the Time Span to get an
array. Create a VEE object for MS Excel with a worksheet
and set it to an Object variable. Make the application visible.
Then put the 256 point array into the worksheet range
"A1:A256" in one step, instead of one cell at a time.
Use an Unbuild Waveform object. Use the [a] build array
syntax to create a 2D array from a 1D array. Then call the
function transpose() to make it a 256 x 1 array instead of a
1 x 256 array for Excel to accept it in one step, as shown in
Figure 157.
Item Description
MS Excel Window Notice the Drop-Down List in the upper right work area.
Size This allows you to choose one of three options
xlMaximized, xlMinimized, xlNormal to select the size
of the worksheet window inside Excel when it comes up.
Each window size is associated with a number, which VEE
calculates and puts in the wndState variable. This value is
then assigned to the windowState property in the Excel
library.
Item Description
sheet.SaveAs The SaveAs() method is being called from the Excel library
(filename) to automatically save the worksheet. Notice that a File
Name Selection box (from the Data ⇒ Dialog Box
menu) is used to display the pop-up Save As box from VEE.
The file name you select is then used as a parameter in the
Excel SaveAs() method call.
Press to Kill Excel The Confirm (OK) button has been used to signal when you
want to close Excel.
In Figure 161, notice that you can nest property and method
calls together with the Object’s dot notation. Refer to
ActiveX documentation to find the right properties in the
target applications. You can use the properties and methods
described in this chapter to begin generating test and
measurement reports. The entries in the Formula object are
as follows:
Entry Description
Entry Description
Set Wnd = Takes the document in the active window and assigns it to
App.Active the Object variable Wnd.
Window;
Set Sel = Puts focus (selection) into the document and assigns this
App.Selection; to the Object variable Sel. This allows you to insert text.
Sel.TypeText(*** Puts the title *** Test Results *** in the document and
Test Results ***), issue a carriage return/line feed.
Sel.TypeParagrap
h();
Set Bmp = Puts the panel.bmp bitmap into the document and assigns
Doc.Shapes. this call in the Shapes Class to the Object variable Bmp.
AddPicture(FileN
ame);
Object Description
10 Run the program. It should look like Figure 163. (If the
colors look strange in the screen dump, iconize any open
applications, so the PC has a full palette of colors to work
with.)
Chapter Checklist
• You should now be able to perform the following tasks.
Review topics, if necessary, before going on to the next
chapter.
• Describe the basic concept behind ActiveX Automation in
VEE.
• Send data from VEE to MS Excel.
• Use a generic template to send arrays of test data to an MS
Excel worksheet. (Make sure you know how to send an array
to the spreadsheet in one step.)
• Employ some of the extended capabilities of the MS Excel
library, such as finding out the memory used by a program.
• Send text, a time stamp, and a display bitmap to MS Word
from VEE.
7
Using .NET with VEE
What is .NET?
Visual Studio .NET is Microsoft’s latest development
platform. Unlike previous products, such as Visual Studio 6,
.NET addresses the needs of both desktop programmers and
World Wide Web developers. The strength of .NET from a
VEE perspective is the free .NET Framework that is
distributed with VEE 7.0. In fact, this free runtime is
integral to several of VEE’s new features.
The key features and benefits of the .NET Framework for
VEE are the Framework Class Library (FCL) and the COM
interop technology. The Framework Class Library is of
particular value to VEE programmers. There are 100’s of
new properties and methods that are now available through
the Function&Object Browser. This new feature enables your
code to derive functionality such as File and Directory
management; simpler String managment; the simplified views
of the Operating System environment; the manipulation of
Web pages; access to Operating System processes; reading
the registry; and many, many more.
.NET also provides a native COM interop technology. This
means a COM component can be accessed as a .NET object
and a .NET object can be accessed as a COM component.
At the end of this chapter is a set of definitions for
Microsoft terminology that is used throughout this chapter.
Please refer to it as necessary.
Go ahead and select the COM tab. This may take some time
as VEE scans your registry for COM type libraries. Now
select the Microsoft ActiveX Plugin.
You are now prompted for the namespaces to import. This is
an optional step, but go ahead and select
Interop.ActiveXPlugin, System, and System.IO.
The Import .NET Namespaces dialog box will come up every time unless you
NOTE uncheck the check box in the .NET Assembly References dialog box.
From the Device menu, open the Function & Object Browser.
One of the menu selections is .NET/CLR Objects. Select this
option. Note how the Assembly window in Figure 165 reflects
the two selections you made earlier.
Programming Practices
Table 31 Converting .NET scalar data types to VEE data types in VEE 7.0
System.Byte Uint8
System.Double Real64
System.Int16 Int16
System.Int32 Int32
System.Single Real32
Set dotNetString =
asClrType(veeText,
System.String);
ModifiedString =
dotnetString.Replace(“ “,”_”);
System.Object Object
Table 32 Converting VEE data types to .NET scalar data types in VEE 7.0
<scaler of type *> System.Boolean Use asVariantBool() on any scalar VEE data
type that can be cast to an Int16, (UInt8, Int16,
Int32, Real32, Real64, Text). You may also use
the more generic asClrType(), e.g.,
asClrType(veescalar,
System.Boolean).
Date/Time System.DateTime VEE’s Date/Time is stored as type Real64.
Use asClrType(veeDateTime,
System.DateTime).
See examples\dotnet\
DateTime.vee.
Object System.Object If VEE holds a pointer to a .NET Object.
Table 33 Converting .NET array data types to VEE data types in VEE 7.0
Table 34 Converting VEE array data types to .NET data types in VEE 7.0
< type *> Array System.Boolean Array Use asVariantBool() on any VEE data type
that can be cast to an Int16, (UInt8, Int16,
Int32, Real32, Real64, Text). You may also
use the more generic asClrType(), e.g.,
asClrType(veeArray,
System.Boolean).
Date/Time Array System.DateTime Array VEE’s Date/Time is really of type Real64.
Use asClrType(veeDateTimeArray,
System.DateTime). See examples\
dotnet\DateTime.vee.
ref, out, ByRef Either scaler or array of Use the VEE keyword ByRef. Not using the
the type indicated by ByRef keyword will not cause a .NET
the mapping table operation exception, but the passed-in
above parameter will not be changed. This is
probably not what the .NET class designer
intended.
Figure 170 Creating a .NET Object and Accessing Its Instance Member
Assemblies
Updating an Assembly
If you have already referenced the shared assembly in your
VEE program, you need to do a File/New or restart VEE
again before the new version of the shared assembly will be
loaded by VEE. If it is not a shared assembly but a private
assembly, you need to do a File/New or restart VEE after
manually copying the new version of the private assembly
into your current VEE program directory. See the section
“Distributing the VEE Runtime" on page 314 for additional
information.
.NET Terminology
You will find these terms throughout the chapter, so use
these Microsoft definitions as a resource while you read or
you can review them now.
Assembly
“Components are packaged in assemblies. Assemblies are the
reusable, versionable, self- describing building blocks of .NET
applications. The simplest assembly is a single executable
that contains all the information necessary for deployment
and versioning. An Assembly is the fundamental building
block of the .NET Framework. It takes the form of an
executable (.exe) or dynamic link library (.dll) file.”
Namespace
“.NET Framework types use a dot syntax naming scheme
that connotes a hierarchy. This technique groups related
types into namespaces so they can be searched and
referenced more easily. The first part of the full name — up
to the rightmost dot — is the namespace name(*). The last
part of the name is the type name. For example,
System.Collections.ArrayList represents the ArrayList type,
which belongs to the System.Collections namespace. The
types in System.Collections can be used to manipulate
collections of objects.”
*Nested classes are an exception to this general rule. Please
see MSDN documentation for further details.
Reference
To use an Assembly, you must add a reference to it.
Class
“If you are familiar with object- oriented programming, you
know that a class defines the operations an object can
perform (methods, events, or properties) and defines a value
that holds the state of the object (fields). Although a class
generally includes both definition and implementation, it can
have one or more members that have no implementation.
An instance of a class is an object. You access an object's
functionality by calling its methods and accessing its
properties, events, and fields.”
Instance Member
An instance member is tied to a specific instance of a class.
Changes to its value affect the object it is associated with
and no other objects.
Chapter Checklist
You should now be able to perform the following tasks.
Review topics, if necessary, before proceeding to the next
chapter.
• Know the basic terminology of .NET
• Know how to import a namespace into VEE
• Define a PIA
• Know how to distribute the VEE Runtime
• Know how to adjust .NET security to accomodate VEE
8
Integrating Programs for the PC
Overview 321
Understanding the Execute Program Object 322
Using a System Command 324
Chapter Checklist 328
Overview
In this chapter, you will learn the easiest way to integrate
compiled programs and operating system commands with VEE.
One of the great advantages of VEE is that it integrates well with
other applications and programs. Furthermore, by using
ActiveX, you can use components from other programs. (For
more information, refer to the Chapter , “Creating Reports
Easily Using ActiveX.”)
In VEE, the Execute Program object specifies programs and
parameters and uses operating system commands. There is an
Execute Program object for the PC. This chapter includes a lab
exercise with the Execute Program object for PC.
Use the Execute Program object to run the following from VEE:
• Compiled programs written in other languages
• *.BAT or *.COM files
• MS DOS system commands, such as dir
Wait for prog exit Specifies when to fire the sequence pin.
• When set to Yes, the sequence pin is not fired until the
program finishes executing.
• When set to No, the sequence out pin fires before the
specified program is done executing.Note that when
launching documents or URLs, if the document or web
site is loaded into an application that is already
running,VEE does not wait until the application exits.
Prog with params (Program with parameters) This field holds the same words
you would type at a DOS prompt. For example, to run a
program in C, enter the executable file name -
myprog.exe. (You can omit the .exe extension.)
• If the program has parameters, they would follow the
executable file name preceded by a hyphen, such as
myprog -param1 -param2.
• To run a DOS system command, first run the DOS
command interpreter with the /c option. For example,
for Windows 98, enter the command command.com
/c <system command>.
• For Windows NT 4.0, Windows 2000, and Windows XP,
enter the command cmd /c <system command>
This option tells the command interpreter to read the
string following the /c as a system command.
whichOS Determines the operating system and sends out one of the
following strings: Windows_98, Windows_2000,
Windows_NT, Windows XP.
Chapter Checklist
You should now be able to perform the following tasks. Review
topics, if necessary, before going on to the next chapter.
• Explain the purpose of the Execute Program object.
• Give an overview of the configuration settings on the Execute
Program object.
• Explain the general process of how the Execute Program
object sends data to/from a program on a PC platform.
• Run operating system commands from VEE.
• Create a program that will use the whichOS(),
whichplatform(), or whichVersion() object so that it will run
on different operating systems.
9
Using Agilent VEE Functions
Overview 331
Using Functions 332
Using Libraries With Agilent VEE UserFunctions 344
Finding Functions in Large Programs 356
Merging Agilent VEE Programs 358
Chapter Checklist 360
Overview
In this chapter, you will learn about VEE UserFunctions,
compiled functions, and remote functions. Functions are
re- usable, modular code that can help you significantly reduce
the time it takes to develop tests. By re- using functions that
have been created in previous programs, you can leverage
existing work, reduce the code size of programs, and make it
easier to maintain test programs. You can also use functions in
groups, as libraries, which you can create and then merge into
new programs. You can share functions among multiple
programs and multiple developers.
Using Functions
Like many programming languages, VEE uses functions to
create subprograms that perform specific tasks. The lab
exercises in this chapter describe how to create, call, and edit
VEE user- defined functions. You will also learn how to create
libraries of functions, which can be merged into programs in the
development phase or imported at runtime.
Creating a UserFunction
1 Select Device ⇒ Formula, delete its default input pin, and
change its default expression to ramp(1024,1,1024).
This will create a 1024 element array with values from 1
to 1024.
2 Select Device ⇒ UserFunction. Rename it ArrayStats.
a Add one data input terminal for the array
b Add four data output terminals for the results.
c Rename the output terminals: Max, Min, Mean, and
Sdev. Select max, min, mean, and sdev from the
Probability & Statistics category in the Function &
Object Browser box.
d Place them in ArrayStats, and connect their data inputs
to A and their data outputs to the appropriate output
terminals. Make the ArrayStats window smaller to see
both of the Main and ArrayStats windows. See Figure
181.
Editing a UserFunction
In this exercise, edit ArrayStats to deliver a record with four
fields giving the array statistics.
1 Delete the four AlphaNumeric displays.
2 Select Edit ⇒ Edit UserFunction... and select ArrayStats
from the Edit UserFunction list box. All of the
UserFunctions in the program are displayed.
3 Open the ArrayStats object menu, click on size, and
enlarge the editing window. If you need to resize objects,
click and drag any corner of the object.
4 Delete the four lines going to the output terminals. (Press
Ctrl-Shift and click on the line you want to delete.)
In order to update the number of pins, you must open the object and click
NOTE Configure Pinout whenever you change the number of inputs or outputs in
a UserFunction. Or you can manually update the Call object’s input and
output pins, but using Configure Pinout is much simpler. You can use Find
to find all the Call objects and expressions that call a UserFunction. For
more information, refer to “Finding Functions in Large Programs" on
page 356.
Program Explorer
The four UserFunctions are a library. You can see them listed by
clicking Edit ⇒ Edit UserFunction.... Click Cancel to close the
list box.
2 Program the four UserFunctions as shown in the following
figures.
Figure 192 shows the BuildRecAry UserFunction. It includes
a Formula object with the triadic expression testing if
A<=5. If the expression evaluates to TRUE, then the object
outputs "PASS". Otherwise, the object outputs "FAIL".
(Note that the parentheses are required.)
Library Type The menu in the Library Type field allows you to select a
UserFunction, a Compiled Function, or a Remote Function.
In this case you want a UserFunction library, so leave the
default.
Library Name The Library Name shows myLib as a default. This name is
used as a “handle” by the VEE program to distinguish
between different libraries being imported. The Delete
Library object uses this name to identify the library to be
deleted. You can use the default name.
File Name The File Name field shows a dialog box for the user program
directory by default. Specify the file that holds the library of
functions.
Click the default name myFile to get the list box. Select
RepGen.vee (from “Lab 9-2: Creating and Merging a
Library of UserFunctions" on page 344). This file will be in
the directory you specified for your programs during
installation.
3 Open the object menu and select Load Lib to import the
library immediately instead of waiting until runtime. This
command is very useful in the development stage. (In the
next step, you will notice that when choosing Select Function
in the Call object, the functions are designated with the
library handle first, such as myLib.BuildRecAry.)
To display the library of imported functions, use the Program
Explorer.
Because you have imported the library, you can only view the
NOTE UserFunction and set breakpoints for it. You cannot edit the UserFunction.
To add a UserFunction to a program that can be edited, use the Merge
Library... command.
You can use Find to locate any object or text such as variables,
titles, settings on objects, etc. Double- click on any line in the
Find Results box to locate an object.
Find can also be used by placing the mouse pointer over objects in the
NOTE Program Explorer and clicking the right button. This will limit the scope of
the search to the particular UserFunction or UserObject.
Notice that the Bar Chart Display takes a one- dimensional array
and displays the values as vertical bars. It uses the number of
bars necessary to display the values in the array. To see how the
program is created, open the detail view of the display. You can
look at examples in the library directory for more ideas about
programs.
Chapter Checklist
You should now be able to perform the following tasks. Review
topics, if necessary, before going on to the next chapter.
• Define a UserFunction and compare it to a Compiled
Function and a Remote Function.
• Create, call, and edit a UserFunction.
• Create, merge, import, and delete UserFunction libraries.
• Use the Find feature in one of the game programs.
• Merge an entire VEE program with the current program.
10
Test Sequencing
Overview 363
Using the Sequencer Object 365
Creating a Test Execution Order 366
Passing Data in the Sequencer 377
Analyzing Data from the Sequencer 389
Storing and Retrieving Logged Data 393
Chapter Checklist 396
Test Sequencing
In this chapter you will learn about:
• The Sequencer object
• Configuring a test for the Sequencer
• Creating a test execution order based on run time results
• Accessing data logged by the Sequencer
• Ways to pass data to or from Sequencer tests
• Performing analysis on logged data from the Sequencer
• Storing Sequencer test data
Average time to complete: 2 hours
Overview
In this chapter, you will learn the fundamentals of using the
Sequencer object. The Sequencer object can execute a series of
sequence transactions, each of which may call a UserFunction,
Compiled Function, or Remote Function. Typically, the
Sequencer is used to perform a series of tests.
Some of the benefits of using the Sequencer include:
• Easy development of a test plan
• Wide array of branching capabilities between tests
• Major component for building a customized test executive
• Ability to call tests in VEE and other languages
• Automatic logging of test results
The first lab shows you how to configure a test for the
Sequencer object, to add or insert or delete a test in the test
execution flow, and to access the test data that has been logged
by the Sequencer. The lab simulates test results with the
random() function.
In the second lab, you will learn how to structure data passed to
tests using global variables, to call UserFunctions from the
Sequencer, and to log Sequencer data to files. Finally, you will
analyze parts of the data.
To use a status panel that updates through a sequence of tests, see “Lab
NOTE 11-5: Creating a Status Panel" on page 434.
In addition to the lab exercises in this chapter, you can get more practice
NOTE in using the Sequencer by completing the exercise in “Test
Sequencing" on page 541 in Appendix , “Test Sequencing 541.”
As you edit the fields, remember to click on new fields to modify them or
NOTE use the Tab key to move forward to different fields. Use the Shift-Tab
keys to move the cursor backward. Press the Enter key only when you
are done editing the dialog box.
TEST: The default name is test1, which you can use. This is just
the label for the test in the Sequencer. It is not the test
function itself.
SPEC NOMINAL: Represents the expected test value. The default is .5.
Change this to .25, and then alter the upper RANGE
field (on the far right) from 1 to .5.
You may leave the other defaults. This configuration will lead
to a PASS result in approximately half of the runs. The dialog
box should look like Figure 203.
Click OK to close the dialog box. You will see the transaction
test1 0 <= (.25) <= .5
on the first transaction bar. This means that test1 will pass if
the returned value is in the range from 0 to .5 with the end
points included. The expected result is about .25.
4 Run the program. It should display the name of the test, the
test result, and the pass- fail indicator (1 for PASS, 0 for FAIL)
in the display, as shown in Figure 204.
Sequence Description
Transaction Field
Sequence Description
Transaction Field
FUNCTION: Specifies the test to run. You can call UserFunctions,
Compiled Functions, Remote Functions, or you can write in
an expression to be evaluated. The result of the function
you call (or expression you evaluate) is tested against the
specifications.
Sequence Description
Transaction Field
THEN CONTINUE Determines test branching.The drop-down menu THEN
CONTINUE (for IF PASS and IF FAIL) contains six branching
options:
• THEN CONTINUE executes the next test configured in
the Sequencer.
• THEN RETURN: tells VEE to stop executing tests and
put the specified expression on the Return output pin of
the Sequencer.
• THEN GOTO: jumps to the test named in its field.
• THEN REPEAT repeats the current test up to the number
of times specified in the MAX TIMES: field. If the
PASS/FAIL condition still exists after the maximum
number of repeats, then VEE continues with the next
test.
• THEN ERROR: stops execution by generating an error
condition with the given error number. An error can be
trapped with the Error output pin on the Sequencer. No
other output pins will send data.
• THEN EVALUATE: calls the specified UserFunction,
which must return a string that states a branching menu
option. Valid string results from the UserFunction are:
"Continue", "Return <expr>", "Goto <name>", "Repeat
<expr>", "Error <expr>", where <expr> is any valid VEE
expression and <name> is the name of a test in the
sequence. This option allows you to ask the user what to
do next.
IF FAIL Branching instructions. If the test fails, VEE goes to this line
for branching instructions. IF FAIL toggles to IF FAIL
CALL:. Options are the same as for IF PASS.
Item Description
RANGE In the drop-down menu, select LIMIT:. Choose < for the
operator. Change 1 to .5 for the limit.
You could also add a transaction after the highlighted one by selecting
NOTE Add Trans... from the object menu.
Field Description
Click OK. You will now see Insert 0 <= (.5) <= 1 on the second
transaction bar. Run the program to see the three records
from the three tests. (You may have to enlarge the display to
see all the entries.)
3 Now delete Insert by clicking the Insert transaction bar,
placing the mouse pointer over the Insert transaction bar,
and pressing Ctrl-K.
You could also click the target transaction bar and select Cut Trans from
NOTE the object menu. You can also paste a transaction that has been cut by
choosing Paste Trans from the object menu (Ctrl-Y is the shortcut).
And in a similar fashion, you can copy a transaction with the Copy Trans
selection.
4 Run the program and note the two records of data from the
two tests. Save the program as seq1.vee. The program should
look like Figure 205.
Each test creates a record, named with the test name, as it executes
NOTE within the Sequencer. This record can be used in subsequent tests. For
example, you could enable test2 if test1 passed (ENABLED IF: test1.pass
== 1). If you need to access test data in an expression field while the test
is still running, test data is stored in the temporary record thistest.
Closing the window does not remove the UserFunction. If you want to
NOTE check this, just click on Edit ⇒ Edit UserFunction and you will see Rand
come up in a list box of UserFunctions to edit. Or you can iconize the Rand
function and you will see the icon for it in the bottom of the VEE screen.
You could also use a Sequencer input terminal name, such as A, to pass
NOTE data to any of the expression fields within the Sequence Transaction box.
For example, you could use A to pass data to RANGE: and SPEC
NOMINAL:.
If you place the OK button below the Set Variable object it causes a logic
NOTE error. That is because VEE sends the old value on the Slider to the Set
Variable object and pauses until the OK button is pressed. Any new value
you entered on the pop-up panel is ignored. When OK is connected above
the Real64 Slider, VEE waits to set the global variable until after the OK is
pressed, and therefore uses the new Slider value. You can turn on Show
Data Flow to watch the execution order.
10 Save the program as seqdat2 and run it. When the pop- up
panel appears, select a value and press OK. It should look
like Figure 212.
The pop-up panel will appear in the center of the screen by default. To
NOTE move it, click and drag the title bar.
waveform. You will use the Coord object in the Data ⇒ Constant
menu to create a straight line mask at 0.6, which the Sequencer
will use to test the noisy waveform.
1 Create the UserFunction called noisyWv, as shown in
Figure 213 in the Detail view.
Field Description
FUNCTION Type in noisyWv().
RANGE Click and select LIMIT from the pop-up menu. Leave the
<=, and the LIMIT terminal name field type mask. All of
the other defaults are fine, so click OK.
test1 will get a result from noisyWv() and test it against the
limit value at the input terminal named mask. If the noisy
wave is less than or equal to the mask at all points, it will
pass. Otherwise, it will fail.
Property Description
6 In the Coord object, you now see two indices for pairs of
coordinates. Double- click the first index, 0000: and a cursor
will appear. Type in the coordinates separated by a comma,
and VEE adds the parentheses automatically. Type 0, 0.6
Tab 20m, 0.6 and then click on the work area outside the
object. The entries are as follows:
• The x axis (time axis) for the Noise Generator in
noisyWv() goes from 0 to 20 milliseconds; hence, the two x
values of 0 and 20m.
• The two y values are both 0.6, since you want a straight
line mask.
You can create any mask waveform by configuring the proper number of
NOTE coordinate pairs and filling them in.
8 Save the program as seqdat3 and run it. It should look like
Figure 215.
• Within the record Test1 there are three fields: Name, Result,
and Pass. The same holds for the record Test2.
• Therefore, Log.Test1.Result gives an array of four values, each
representing one of the four runs. Log[0].Test1.Result outputs a
scalar value, the Result of Test1 in the first run (Log[0]).
The logged array of records simplifies analyzing and
investigating the data. For example, you might want to know
how many tests passed in a particular run. Or you might want
to average the results of Test2 in all runs. Or you might want to
see all of the data on Test1 in the fourth run. All of these queries
are possible with this data structure. The next exercise
performs some analysis operations on data.
Lab 10-4: Using the To/From File Objects with Logged Data
1 Open the seqdat2 file and delete the data line to the display.
2 Select Flow ⇒ Repeat ⇒ For Count and place it to the left of the
Sequencer. Change the For Count number to 3, and connect
its data output pin to the sequence input pin on the
Sequencer.
3 Enlarge the work area vertically and place the AlphaNumeric
display near the bottom. Select Data ⇒ Collector and place it
in the left work area. Connect the Sequencer Log pin to the
Collector data input pin. Connect the For Count sequence
output pin to the Collector XEQ pin.
The Collector will create an array of records of records from
the Sequencer. Using the WRITE CONTAINER transaction in
the To File object you can write any VEE data container to a
file quite easily.
4 Select I/O ⇒ To ⇒ File and place it to the right of the
Collector. Select I/O ⇒ From ⇒ File and place it below the To
File object. Add an input terminal to the To File object and
connect the Collector output to it. Connect the To File
sequence output to the From File sequence input pin.
Connect the From File data output to the display.
Check Clear File At PreRun & Open in To File, and configure a
WRITE CONTAINER a transaction. Configure a transaction
in the From File object like the following: READ CONTAINER
x.
You can use the default data file for storage.
5 Run the program. It should look like Figure 218.
Remember to change the Get records field in From DataSet from One to
NOTE All.
Chapter Checklist
Use the following checklist to determine whether there are
topics you need to review before going on to the next chapter.
• Describe the Sequencer object conceptually.
• Configure a test for the Sequencer.
• Add, insert, and delete operations for a Sequencer test.
• Access logged data from the Sequencer.
• Use Sequencer input terminals to pass data to tests.
• Use Global variables to pass data to tests.
• Compare a waveform output to a mask.
• Analyze several runs of data from the Sequencer.
• Store data using the To/From File objects.
• Store data using the To/From DataSet objects.
11
Using Operator Interfaces
Overview 399
Key Points Concerning Operator Interfaces 400
Using Operator Interface Objects 403
Common Tasks In Creating Operator Interfaces 419
Overview
In this chapter, you will learn more about operator
interfaces, including adding menus, customizing interfaces,
adding warning signals, and importing bitmaps. This chapter
expands on the exercises in previous chapters, where you
created operator interfaces and pop- up panels.
Some benefits of using VEE operator interface features are:
• Maximum ease of use for the operator
• Improved program performance
• Security from unauthorized changes
• Clarity through visual aids
You must create a Panel view of the program to have the panel view button
NOTE displayed in a window title bar.
Figure 220 Panel View Button and Detail View Button in Title Bar
Color Alarms
Color alarm objects are located in the Display ⇒ Indicator
menu. They can be configured for three different limits with
color and a text message, and as squares or circles. Alarms
are often used to simulate an “LED,” or to warn operators
of a situation that demands their attention.
Graphic Images
You can import bitmaps into the panel view by setting the
PanelBackgroundPicture property. VEE imports *.jpeg,
*.png, *.wmf, *.GIF, and *.bmp files to serve as the
background for your Main, UserObject, or UserFunction
panel.
When a bitmap is set as the background picture, other VEE
objects will appear on top of the picture. (For more
information about how to do this, refer to “Lab 11- 2:
Importing Bitmaps for Panel Backgrounds" on page 425.)
Images may be scaled, tiled, cropped, or centered.
Figure 222 shows a background picture that has been tiled.
You can also change bitmaps for any icon using the Properties ⇒ Icon tab.
NOTE
For each of the objects shown in Figure 224, you can also
customize the object’s look and feel. For example, see the
Real64 Knob Properties dialog box in Figure 225. To
configure the object, choose a property such as ForeColor
and make selections.
With ActiveX you can also use controls and displays from other
NOTE applications, as shown in the example “Lab 11-4: Using an ActiveX
Control" on page 432.
The input boxes for Int32 and Text, which are also located in
Data ⇒ Dialog Box, are similar to the Real64 Input. In
addition, the Data ⇒ Dialog Box menu includes choices for
Message Box, List Box, and File Name Selection.
Figure 228 shows a dialog box that pops up to display a
message.
Table 45
Ctrl-P Pause
Ctrl-T Step
When you create a run time version of a VEE program, the run time version
NOTE cannot be edited. (You cannot display the Detail view.) Therefore, make
copies of the original program before you begin this process and follow the
instructions carefully.
To access an object menu when Show Title Bar is turned off, click the right
NOTE button over the object.
Although VEE defaults to the bitmaps subdirectory, you could use a bitmap
NOTE from any directory.
You should now have a picture of a die with one dot on its
top.
4 Select Flow ⇒ Confirm (OK) and place it below the die.
Connect the Picture sequence output pin to the OK
sequence input pin.
5 Select the Picture and the OK objects (press Ctrl and
click the objects to create a shadow). Open the pop- up
Edit menu by placing the mouse pointer on the
background and pressing the right mouse button. Select
Add to Panel.
6 Change the UserFunction Title and Panel Title to die1.
Arrange the objects and size them as desired.
To move objects in Panel View, right-click on the object and select Move or
NOTE highlight the object (the object should show a gray border) and drag it to
its new location.
There are six menu formats for data selection control. Radio Buttons
NOTE displays entries as buttons. The operator's selection is output in text
format as an Enum data type. Cyclic Button cycles through the
enumerated values one at a time as the operator clicks the button. List
displays all of the enumerated values in a list with the selected item
highlighted. Drop-down list, Pop-up list, and Slider list are the other three
choices.
The Call input terminal requires a Text Scalar, so VEE converts the Enum
NOTE Scalar to a Text Scalar.
When a program uses Auto Execute and the sequence pins, the operator
NOTE does not have to click the Run button to begin the program.
There are a few things to note before the next lab exercise:
• You can use the same techniques in the exercise above to
create menus for any program.
• Radio Buttons could also be used to select a compiled
language program by using the Execute Program object
with a control pin (“Command”) that indicated the
program to call. If you had imported a library of compiled
functions, you could also use the Call object to run a
function from the library.
• You could optimize this program by using the File Name
data input pin on the Picture object inside a single
UserFunction, and then sending the appropriate bitmap
file to the object. If you are using many different bitmaps,
this is a more efficient way to program.
Font Choose a larger font with bold type, and click OK.
Check Automatically Resize Object on Font Change.
You do not need to connect the Beep object to anything. It activates when
NOTE the function executes.
Property Description
ShowTitleBar False
EditEnabled False
ActiveX Control object menus have both Properties and Control Properties.
NOTE The Properties menu sets the VEE properties of the object. The Control
Properties are supplied by the Control and can be different for each type of
ActiveX Control.
Examine all the control examples that ship with VEE to get
a better understanding of how they work. Then look for
other controls and displays in the marketplace you might
want to add to enhance the user interface capabilities in
VEE.
Figure 246 shows another example of VEE incorporating a
control from MS Chart. After you have selected a control
library in the Device ⇒ ActiveX Controls References dialog box,
you can use the Function & Object Browser or the Declare
Variable Object to identify a control's properties and
methods.
there are a number of tests and you want to see the results
as they are returned. You will use the function random(),
which returns a real value between 0 and 1, when using the
default settings.
1 Click Device ⇒ Sequencer. Double- click the transaction bar,
and configure your test using the default name, test1, and
replacing the FUNCTION: field with random(). See Figure 247.
Chapter Checklist
You should now be able to perform the following tasks.
Review, if necessary, before going on to the next chapter.
• Summarize the key points concerning operator interfaces.
• Use a menu to select tests on an operator interface.
• Import a bitmap for an operator interface.
• Create a status panel.
• List some of the operator interface features that VEE
provides.
• Secure a program.
• Create a high impact warning.
• Create an ActiveX Control and find its properties and
methods in the Function & Object Browser.
12
Optimizing Agilent VEE Programs
Overview 443
Basic Techniques for Optimizing Programs 444
Overview of Compiled Functions 450
Using Dynamic Link Libraries 453
Agilent VEE Execution Modes 460
The Agilent VEE Profiler 468
Chapter Checklist 470
Overview
In this chapter, you will learn how to improve the execution
speed of VEE programs. There are three basic components in
test program performance: the speed of taking the
measurement, the rate at which the data is transferred to the
computer, and the speed at which the program processes the
data. By optimizing the VEE program, you can increase its
processing speed.
In the first section, you will learn the basic principles for
optimizing a VEE program. You will also learn about Dynamic
Link Libraries (DLLs). The next section describes how to
optimize using compiled functions. Then, there is an overview
of the VEE compiler. Finally, there is a section on the VEE
profiler.
The techniques in this chapter apply whether or not you use the compiler.
NOTE
To ensure faster execution, always make sure you are using the most
NOTE recent execution mode in VEE. To do this, click File ⇒ Default
Preferences (or use the button on the tool bar). Select VEE6 under
Execution Mode and click Save. In the status bar at the bottom of the VEE
window, you should see VEE6 listed.
• Collect data for graphical displays and plot the entire array
at once rather than plotting each individual scalar point. If
the X values of a plot are regularly spaced, use an XY Trace
display rather than an X vs. Y Plot.
• Use one If/Then/Else object with multiple conditions instead
of multiple If/Then/Else objects.
• Set graphical displays to be as plain as possible. The settings
that allow the fastest update times are Grid Type ⇒ None and
nothing checked in the Properties dialog box. Only use
AutoScale control pins where necessary, and turn off the
Automatic AutoScaling if not needed (in the Scales folder).
• When reading data from a file, use the ARRAY 1D TO END: (*)
transaction instead of performing READ transactions on one
element at a time and using the EOF pin.
• Use the Sequencer to control the flow of execution of several
UserFunctions instead of separate Call objects.
• When using the Sequencer, only enable logging for
transactions where the Log record is required.
• When using Strip Charts and Logging AlphaNumeric
displays, set the Buffer Size in Properties to the smallest
number possible for your application.
• Use the triadic operator, (condition ? expression1 :
expression2), instead of the If/Then/Else object with Gates
and a Junction.
• When using bitmaps, set them to Actual or Centered rather
than Scaled, since Scaled will take a few moments longer.
• When using indicators such as the Fill Bar or Thermometer,
turn off Show Digital Display.
• When using Color Alarms, if you are switching between
colors rapidly, turn off Show 3D Border.
In addition to the techniques already mentioned, linking
compiled functions in other languages to your VEE programs
can increase execution speed. Using compiled functions on PCs
(as DLLs) are described in the next section.
Only the Compiled Function's return value (Ret Value in the Call object)
NOTE can be obtained from within an expression. If you want to obtain other
parameters returned from the function, you will have to use the Call object.
VEE supports both the "_cdecl" and "_stdcall" calling conventions. Most
NOTE customer-written DLLs use the _cdec1 calling convention. Most Win32
API calls use _stdcall. VEE supports both naming conventions, so you can
use most off-the-shelf DLLs as well as your own.
Field Description
Library Name The name VEE uses to identify the library. Generally, this is
used if you want to delete the library after it has been used
in the program.
You can also load a library manually during the development phase by
NOTE selecting Load Lib from the object menu.
You can also call a DLL function from an expression field, provided the
NOTE library has been loaded. When used in this way, you must enclose the
parameters in parentheses after the function name, and the function only
sends back its return value. Any parameters passed by reference can only
be retrieved by using the Call object. For example, you might use the
following expression in a Formula object:
2 * yourFunc(a,b)
The a and the b would refer to two input pins on the Formula object, and
the return value of yourFunc would be multiplied by 2 and placed on the
output pin.
<installation directory>\EXAMPLES\MANUAL\MANUAL49.
Element Description
Import Library Before the first call to the compiled function Call Function,
the DLL must be loaded using the Import Library object (in
the Device menu).
Element Description
totSize The totsize object (in the Math & Functions box) is used to
determine the size of the waveform, which is output to the
arraySize input pin on Call myFunc.
XY Trace The XY Trace object displays both the original and the new
waveforms
Formula The Call object output pin labeled Ret Value holds the
size of the returned array, so that expression B[0:A-1] in
the Formula object correctly specifies this array to the
display object.
Run the program and notice that the second trace is one greater
than the first trace at all points on the waveform.
Another key point to notice in the program is the method used
for making it portable to all VEE platforms. Windows 98,
Windows 2000, Windows NT 4.0, and Windows XP, use a
Microsoft 32- bit compiler. These DLLs are all indicated using a
*.dll extension.
The UserObject called Shared Library Name identifies the
operating system being used, and then transmits the correct
library name to the Import Library object, as shown in
Figure 260
.
Compiled Functions
Compiled functions, using the Import Library and Call objects,
have these characteristics:
• Short start- up time
• Communication by passing on stack and memory space
shared with VEE
Synchronous execution
• Signals and exceptions not blocked or caught (such as GPF
messages)
• Compiler for textual language required
• More complicated to use. More risk in using. (An
out- of- bounds array error or overwriting memory will cause
VEE to crash.)
Execution mode
a new feature from VEE 6.0, you should change the execution
mode to VEE 6. Otherwise, the VEE 5.0 program may not run
correctly.
To change the execution mode, follow these steps:
1 From the main VEE menu, click File ⇒ Default Preferences, or
press the Default Preferences button on the tool bar as
shown in Figure .
Execution mode
set to VEE 6
Disable Debug
Features turned
OFF (not
checked)
Timer
Chapter Checklist
You should now be able to perform the following tasks. Review
topics, if necessary.
• Explain three basic techniques for optimizing VEE programs
and give examples of each.
• Explain at least two more techniques in addition to the three
above.
• Explain the basic concept of a DLL.
• Import a DLL, call a function within it, then delete the DLL.
• Step through a program using the VEE 6 execution mode or
the VEE 5, VEE 4, or VEE3 execution modes, and explain the
reasons you would choose one or the other.
• Use the VEE Profiler.
13
Platform Specifics and Web Monitoring
Overview 473
The Callable VEE ActiveX Automation Server 474
Web-enablement Technologies 475
Web Monitoring with Agilent VEE 479
Chapter Checklist 495
Overview
In this chapter, you will learn about one of the most
important techniques for incorporating VEE functions into
other applications or programs using the Callable VEE
ActiveX Automation Server. Finally, you will learn key
concepts in web monitoring.
The Callable VEE ActiveX Automation Server replaces the Callable VEE
NOTE ActiveX Control that was shipped with VEE version 5.0.
Web-enablement Technologies
You can use VEE to disseminate data you have collected in
programs, to monitor test systems, or to review test results
remotely. This section describes web- enablement technologies
for test and measurement applications, and how VEE supports
these technologies.
I/O HTTP
Host Application
Scripting
Document Objects Language
ActiveX Controls HTML Controls (VBScript,
JavaScript)
Enable Server When checked, Enable Server turns on VEE’s built-in Web
server. The Web server allows a remote user to view,
monitor and troubleshoot VEE programs on your system, by
using a Web browser to display your VEE program.
HTTP Port Specifies the port number for the VEE Web server. The
Number default port number is 80. The only time you need to change
the default port number is when another Web server, such
as another instance of VEE, is running on the same system,
or if you want to restrict the remote user access to your VEE
Web server.
• By specifying an HTTP port between 0 and 65535, you
can restrict who can access and view data on your
system.
• If you enter a different port number, the remote user that
views the VEE program must enter the same port
number in his or her browser. For example, if you set this
field to port 85, the remote user would type in the URL as
http://hostname:85. (There is more information about
the definition of hostname later in this chapter.)
Server Timeout Specifies the maximum time that the VEE Web server will
wait for VEE to process commands. By default, this field is
set to 60 seconds. If the VEE program takes longer than the
specified time to process a command, VEE sends a timeout
to the Web server.
Log File Specifies the log file where all incoming HTTP requests,
processed by the Web server, are recorded. The default
location for this file on a PC is C:\windows\TEMP\
http.log. If the log file does not already exist, it is created
when you make changes in the Default Preferences ⇒
Web Server dialog.
Save The values will be the default for future VEE Web sessions
until you change them again. To use the specified values
only for the current VEE session, click OK.
3 The remote user must enter a URL address for your system.
(You provide the address to the remote user, which is
explained in more detail below.)
The remote user does not have to be running VEE or even have VEE
NOTE installed in order to access VEE programs on your system.
The remote user connects to the network and runs the browser,
and enters a URL. You will tell the remote user the URL to enter
based on the following information. The formats you can have
the remote user enter are as follows:
http://hostname {:port}
Displays your VEE Web Server Home Page, where the remote
user can enter choices about how to view your VEE program.
http://hostname{:port}{/command}{?parameter}
Specifies a view or UserFunction for the remote user to view
in the VEE program. For example,
http://hostname/ViewMainDetail displays the Detail view of
your main VEE program.
http://hostname{:port}{/file}
Specifies a file that you have saved, such as a *.jpeg or
*.html file, that you want the remote user to view.
To display this menu on your own system, you can refer to your system as
NOTE localhost. For example, if you run VEE, run the network browser, and enter
http://localhost, the browser will display the VEE Web Server Home Page
shown in Figure 272. This is an easy way for you to check what the remote
user will display with different commands.
For this exercise, the Solitaire.vee program includes an error that is not in
NOTE the VEE program example. If you would like to view the program, it is
located in Help ⇒ Open Example... ⇒ Games ⇒ Solitaire.vee.
Make sure the file name is the file name of a VEE web command, and that
NOTE it is located in the Root Directory specified in Web Server.
You could also use an *.html file for other purposes, such as
putting password protection on a VEE program so that only
users with the password can view the program. Figure 277
shows an example of password protection.
Chapter Checklist
You should now be able to perform the following tasks:
• Explain how to use the Callable VEE ActiveX Automation
Server, and when you would use it.
• Explain how you could integrate VEE functionality into other
applications or programs.
• Explain the key concepts in using the web to monitor VEE
programs.
Apple Bagger
You want to know how many apples it takes to fill a ten pound
basket. Create a VEE program that counts how many apples it
takes to fill the basket. Each apple weighs between 0 and 1
pound.
Suggestions
This program can be created with 10 or fewer objects. Choose
from the following objects:
Start
Until Break
random() function
Accumulator
Break
Real64
Conditional (A>=B)
Stop
Counter
If/Then/Else
Alphanumeric
The VEE programs for many of the lab exercises and programming
NOTE examples in this manual are included in VEE, under Help ⇒ Open
Example... ⇒ Manual ⇒ UsersGuide.
Key Points
Until Break and Break Objects: Use these objects for loops that
require testing a condition. In this example, the loop should
stop when the total weight of the apples is greater than 10
pounds.
Key Points
Gate: The Gate is used to hold the output until another action
occurs and activates its sequence pin. Here, when the condition
A<=10 is no longer true, the Else pin on the If/Then/Else object
activates the gate.
Testing Numbers
Testing Numbers, Step 1
Start
Int32
Slider
Real64
If/Then/Else
Formula
Gate
Text
Junction
Alphanumeric
Message Box
Key Points
Auto Execute: All input objects such as the Int32 Slider have
an Auto Execute selection in the Properties Box. If chosen, the
object operates whenever its value is changed without needing
to press Start or the Run button.
want the value of A on the Result pin; otherwise, you want the
string “FALSE” on the Result pin. You would use the following
triadic expression: (A<10 ? A : "FALSE").
Solution—Testing Numbers, Step 3
Figure 282 shows the solution to the Testing Numbers
exercise using only three objects.
This could be implemented using a Real64 Input dialog box with its
NOTE automatic error-checking capability. However, the operator must enter a
valid number before the program can complete.
Start
For Range
Until Break
randomseed() function
random() function
Collector
Formula
Set Values
Alloc Int32
Logging AlphaNumeric
Strip Chart
Meter
Date/Time
Timer
Now()
Break
Do
Key Points
Key Points
Using Masks
Mask Test, Step 1
Create a 50 Hz sine wave with an adjustable amount of noise.
Test the noisy sine wave to be certain that it stays below the
following limits:
(0,0.5)
(2.2m, 1.2)
(7.2m, 1.2)
(10.2m, 0.5)
(20m, 0.5)
If the sine wave exceeds the limits, mark the failing points with
a red diamond.
Hints: You can change the format of the displays from lines to
dots to diamonds. (In Properties, choose the Traces tab for each
trace input, the line type can be solid, dashed, points only, etc.
Also the Point Type can be just a point, a diamond, box, or other
shapes.) You may find the Comparator object helpful.
Solution—Using Masks, Step 1
Figure 286 shows a solution for step 1.
Key Points
Key Points
Set Variable: Notice how easily you can set a global variable
called lastname, which can then be referenced in any
expression field, such as the Formula object in this example.
Optimizing Techniques
For this lab, you will build a VEE program two different ways
and note the difference in execution speed.
Optimizing Techniques, Step 1
Create a program that sends the range 0 to 710 step 10 through
both a sine function and cosine function. Put the results of the
functions on an X vs.Y display. Use the Timer object to clock how
long the program takes. (Set your default preferences for Trig
Mode to Radians.)
Solution—Optimizing Techniques, Step 1
Figure 289 shows a solution to step 1.
Clone all of the objects from the first program. Modify the new
set to collect the range into an array. Now, the sine and cosine
functions are run against an array of points, and only plotted
one time. Note the time savings.
Solution—Optimizing Techniques, Step 2
Figure 290 shows a solution to step 2.
Key Points
UserObjects
Do not use a virtual source inside the UserObject. Use objects such as
NOTE Build Waveform and Random to create the UserObject.
Key Points
Using UserFunctions
UserFunctions, Step 1
Create a function called NoiseGen that accepts an amplitude
value (0- 1) from a slider and returns a noisy waveform.
Do Not Use
Virtual Source
For Count
For Range
Do Use
Formula
Ramp
Build Waveform
Key Points
UserFunctions, Step 3
In the same program, call the AddNoise function again, this
time from a Formula object, taking the absolute value of the
result. Display the absolute value waveform on the same
display. Next prepare to edit the AddNoise function. Turn on
Debug ⇒ Show Data Flow. Leave the AddNoise window open and
run the program. Notice how useful this capability is for
debugging.
Solution—UserFunctions, Step 3
Figure 295 shows a solution for step 3.
UserFunctions, Step 4
Now change the program so that the slider sets a global variable
called Amplitude. Have the NoiseGen function use that global
(so NoiseGen will no longer require an input pin). Make the
program run correctly. Save this file as uflab.vee.
Solution—Using UserFunctions, Step 4
Figure 296 shows a solution for step 4.
Hint: Notice the Call AddNoise and Formula objects use the
global Amplitude, so both of the objects need to run after the Set
Amplitude object executes. Connecting the Sequence pins from
Set Amplitude to Call AddNoise, and Call AddNoise to Formula
ensure the objects execute in the required order.
Key Points
Key Points
Key Points
Gate: The Gate object only sends a value if the two numbers
are equal.
Key Points
Delay and Raise Error: After 10 seconds the Delay object pings
the Raise Error object, which will pause execution of the
program and display the Error Message you have typed in. A
red outline will also appear around the object that caused the
error, which goes away when you click on the Stop or Run
buttons on the main menu bar.
Key Points
Records
Manipulating Records
Manipulating Records, Step 1
Build a record with three fields holding an integer, the time
right now as a string, and a four element array of reals. The
fields should be named int, daytime, and rarry, respectively.
Merge this record with another that holds a random number
between 0 and 1, and a waveform. Name these fields rand and
wave.
Solution—Manipulating Records, Step 1
The resulting record should have five fields, as shown in
Figure 304.
Key Points
Key Points
The Sub Record Object: Notice the Text array of the fields on
the Sub Record input pin labeled fields. When you configure the
Sub Record object to include fields, it will output a record that
only contains the fields specified.
Manipulating Records, Step 3
Replace the integer input for the first field with a For Count
object and step through 10 iterations. Be certain to “ping” the
random number generator and the time function on each
iteration. Send the complete record into a To DataSet object. In
a separate thread, retrieve all records from the dataset where
the random value is greater than 0.5. Put the resultant records
into a record constant
Hint: You'll need a control pin for a Default Value on the Record
Constant object.
Solution—Manipulating Records, Step 3
Figure 306 shows a solution for manipulating records, step
3.
Key Points
Test Sequencing
Using the Test Sequencer, Step 1
Create a simple UserFunction called UpperLimit that is a
pop- up panel with a Real64 Slider and a Confirm (OK) object.
Send the output of the slider to a global variable called UpLimit
and also to an output terminal. Create a Sequencer object, and
configure test1 in the Sequencer as an EXEC transaction that
calls UpperLimit.
Create another function called AddRand that simulates the test
you might call. This function should add an input value to a
random value (0 to 1). It will have one input pin and one output
pin.
From the Sequencer, create test2 to call AddRand and send in a
zero. Test the return value to do a limit comparison less than
the global UpLimit value. If it passes, then return "PASS" +
test2.result. If it fails, return "FAILED" +
test2.result. Put an Alphanumeric display on the Return
pin of the Sequencer.
After the Sequencer object, ping a Get Variable object (UpLimit)
and another Alphanumeric display. Run the program several
times.
Solution—Using the Test Sequencer, Step 1
Figure 307 shows a solution for the first step of using the
Sequencer.
Key Points
Disable the first test. Assuming that you do not need the global
anywhere else, you can call the UpperLimit function directly.
Change test2 so that it compares the return value of
AddRand(0) against the result of the UpperLimit function.
Hint: For disabling the first test, use the Sequencer Transaction
box as shown in Figure 308.
Key Points
Key Points
The Data Format for Several Runs of the Sequencer (First Thread):
When the Sequencer executes once, it outputs a Record of
Records. The first record has field names that match the test
names, then each field holds a record containing the different
pieces of data for that particular test. When the Sequencer runs
several times, each Record of Records can be added to an array,
Key Points
Key Points
• The To String object is still being used to format the Real64
into a time stamp format.
• Notice the sequence line between the first "generate" Formula
and the second "evaluate" Formula. This ensures the second
Formula will not execute until it gets the new string to
evaluate.
Using the Test Sequencer, Step 8
Display only the records in which test 1 passed and test 2 failed.
Key Points
The EOF Pin on the From Data Set Object (Second Thread): The
EOF pin is added in case there are no records that fit the
criteria. If this happens then the EOF pin will fire, instead of
VEE halting the program with an error message.
Glossary
This Glossary defines terms used in this manual. For a
complete glossary of VEE terms, select Help ⇒ Contents and
Index. Next, select Reference. Then, select Glossary. In the
glossary, clicking a term displays a definition. When you
have finished reading the definition, click anywhere to clear
the text.
Cut Buffer The buffer that holds objects that you cut or
copy. You can then paste the object back into the work area
with the Paste toolbar button (Edit ⇒ Paste).
Data Shape Each data container has both a shape and type.
The data shape can be either a scalar or an array of one or
more dimensions. In VEE, a one- dimension array is called
Array 1D, a two- dimension array is Array 2D, and so forth.
Data Type Each data container has both a type and shape.
VEE supports many data types including Text, Real64,
Real32, and Int32.
Detail View The view of a VEE program that shows all the
objects and the lines that connect them.
Font VEE allows you to change the font size and style of
type used to display text for various VEE objects, titles, and
so forth.
Icon:
1 A small, graphical representation of a VEE object, such
as the representation of an instrument, a control, or a
display.
2 A small, graphical representation of an application, file,
or folder in the Microsoft Window operating system.
Menu Bar The bar at the top of the VEE window that
displays the titles of the pull- down menus from which you
select commands and objects.
Object:
1 A graphical representation of an element in a program,
such as an instrument, control, display, or
mathematical operator. An object is placed in the work
area and connected to other objects to create a
program.
2 A data type used for ActiveX Automation and Controls.
Title Bar The rectangular bar at the top of the open view of
an object or window, which shows the title of the object or
window. You can turn off an object title bar using Properties
in the object menu.
field
getting a field from a Record, 225 G
file
sending real array to, 217 gateway, 135
sending time stamp to, 215 Get field object, 225
To/From file objects, 210 Get Variable object, 116
File menu global variables
Default Preferences, 403 optimizing programs, 448
Merge, 358 passing data in Sequencer, 380
merge setting and getting, 116
Library, 344 setting before using, 118
Save As..., 59 Go To, 107
Save Documentation..., 119 GPIB, 135
files GPIO, 135
program, 59
fill bars, 403
Find feature, 356
H
flow
Show Data Flow, 69 Help
Show Execution Flow, 69 finding menu location for object, 98
Flow => Confirm (OK), 417 Object Menu, 33
flow, data, 71 online, 22, 26
fonts online Tutorials, 97
saving with program, 60 system, 28
format HH time stamp format, 216
I/O transaction, 212 hierarchy of program, 108
Formula object, 94 to 96, 182 highlight (select) objects, 39
creating expressions, 182 Home button to position objects, 79
evaluate expression, 183
evaluate simple expression, 183