Chapter 5 223
Storing and Retrieving Test Results
Using Records to Store Mixed Data Types
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.
1. Create the test name by selecting
Data ⇒ Constant ⇒ Text and
entering
Test1 in the input field. Rename the object Text Constant.
Iconize
Text Constant.
2. 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.
3. Select
Data ⇒ Constant ⇒ Real64 and place it below now().
You can turn this
Scalar Real64 into an Array 1D by clicking
Properties... in the Real64 object menu and choosing 1D Array.
4. 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.
5. 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.)