advertisement
VEE User’s Guide
Storing and Retrieving Test Results Chapter 5
Lab 5-4: Using Records
This exercise describes how to use the Record datatype. You will learn how to build a record, how to retrieve a particular field in that record, how to set a chosen field, and how to unbuild the entire record in a single step. This exercise also uses the time stamp function now() in a different way.
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
223
5 Storing and Retrieving Test Results Chapter 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
224
Figure 134 Output Terminal Information on a Record
VEE User’s Guide
advertisement
Related manuals
advertisement
Table of contents
- 120 Using Data Types
- 121 Using Data Shapes
- 122 Using the Formula Object
- 174 Deleting Data Input or Output Terminals
- 174 On Your Own
- 251 Building a Record
- 253 Getting a Field From a Record
- 255 Setting a Field in a Record
- 258 Unbuilding a Record in a Single Step
- 284 More Specific Type Checking:
- 284 Catching Events:
- 431 Colors and Fonts
- 431 Color Alarms
- 431 Tanks, Thermometers, Fill Bars, Meters
- 487 Execute Program Object
- 487 Compiled Functions
- 487 Synchronous execution
- 511 How a Remote User Accesses Agilent VEE on Your System
- 514 Displaying the Agilent VEE Web Server Page
- 516 Lab 13-1: Practice Session with Agilent VEE Web Browser
- 519 Restricting Access to Programs Viewed over the Web
- 528 Optimal Solutions:
- 528 Until Break and Break Objects:
- 528 Accumulator:
- 528 Counter:
- 529 Start:
- 529 Shift Register:
- 529 Gate:
- 532 Auto Execute:
- 532 Consolidating Formulas:
- 535 Logging AlphaNumeric vs. AlphaNumeric:
- 536 Timing Pins:
- 537 Layout of Slider Objects:
- 537 XY Trace:
- 538 MovingAvg(x, numPts):
- 540 Mask:
- 540 Comparator:
- 541 TotSize:
- 541 Formula:
- 543 String Objects and Functions:
- 543 Formula Object:
- 543 Set Variable:
- 543 Optimizing:
- 548 UserObject:
- 548 Build Waveform:
- 550 Ramp():
- 550 Build Waveform:
- 555 Select Function:
- 555 Editing UserFunctions:
- 555 Set Variable Caution:
- 562 Generating an Array:
- 562 Time Stamp:
- 562 Storing Two Values in a Line:
- 562 Extracting a Value From a File:
- 562 Junction:
- 564 Time Stamp:
- 564 Configuring a Data Constant as an Array:
- 565 Naming Fields:
- 565 The Default Value Control Input:
- 566 Using a Conditional Expression:
- 566 The Sub Record Object:
- 568 The To DataSet Object:
- 568 The From DataSet Object:
- 583 Button
- 583 Cascading Menu
- 583 Checkbox
- 583 Click
- 583 Clone
- 583 Component
- 584 Component Driver
- 584 Container
- 584 Context
- 584 Cursor
- 584 Cut Buffer
- 584 Data Container
- 584 Data Flow
- 584 Data Input Pin
- 584 Data Output Pin
- 585 Data Shape
- 585 Data Type
- 585 Detail View
- 585 Direct I/O Object
- 585 Double-Click
- 585 Drag
- 585 Drop-Down List
- 585 Entry Field
- 585 Expression
- 586 Font
- 586 Grayed Feature
- 586 Group Window
- 586 Hypertext
- 586 Icon:
- 586 Main Window
- 586 Maximize Button
- 586 Menu Bar
- 587 Minimize Button
- 587 Object:
- 587 Object Menu
- 587 Object Menu Button
- 587 Open View
- 587 Panel Driver
- 587 Panel View
- 587 Pin (or Pins)
- 588 Pointer
- 588 Pop-Up Menu
- 588 Preferences
- 588 Program
- 588 Program Explorer
- 588 Propagation
- 588 Properties
- 588 Pull-Down Menu
- 588 Scroll Arrow
- 589 Scroll Bar
- 589 Select
- 589 Selection Field
- 589 Sequence Input Pin
- 589 Sequence Output Pin
- 589 Status bar
- 589 Status field
- 589 Terminal
- 589 Title Bar
- 590 Toolbar
- 590 Transaction
- 590 UserObject
- 590 Views
- 590 Windows 98, Windows NT 4.0, Windows 2000, Windows XP
- 590 Work Area
- 590 Work Space