advertisement
Appendix
Key Points
The To DataSet Object:
The Clear File at PreRun option only clears the file before data is sent the first time. Notice that the program sends 10 different records to the same file sequentially, and they are appended to the file.
The From DataSet Object:
This object is configured to retrieve all records where the rand field is greater than 0.5. In this case, five out of ten records meet that criterion and the first record is shown with an index number of 0.
540 VEE User’s Guide
Test Sequencing
Appendix
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.
VEE User’s Guide 541
Appendix
542
Figure 307 Using the Test Sequencer, Step 1
Key Points
Setting Global Variables with a UserFunction:
A typical use of the first Sequencer transaction is to call a UserFunction that sets the Global Variables, as it does in this case. Then you can utilize these variables in any test that follows, as is shown here.
The Sequencer Return Pin:
The Return pin in this example delivers a PASS or FAIL message plus the test value. You could use this pin to deliver any message or value from a particular test.
Using the Test Sequencer, Step 2
VEE User’s Guide
Appendix
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
VEE User’s Guide
Figure 308 Disable the First Test in the Sequence
Note that in Figure 308, the first test in the Sequencer is
“commented out” with two slashes to show that it is disabled.
Solution—Using the Test Sequencer, Step 2
Figure 309 shows a solution to using the test Sequencer,
step 2.
543
Appendix
544
Figure 309 Using the Test Sequencer, Step 2
Key Points
The UserFunction in an Expression Field:
In this example, instead of comparing a test result to the UpLimit variable, you can type the function name UpperLimit() in the expression field where the variable would go.
Using the Test Sequencer, Step 3
Edit the test2 Sequencer transaction that calls the VEE function
random (0,1). Compare the result against a limit less than 0.5.
Cut and paste the test1 transaction until you have a total of four tests.
Build a program to run the Sequencer five times. Record the data in a data set of records and collect the data in an array.
Using the array, find the minimum, maximum, mean, and standard deviation of the results of the second test.
VEE User’s Guide
Solution—Using the Test Sequencer, Step 3
Figure 310 shows a solution to Step 3.
Appendix
VEE User’s Guide
Figure 310 Using the Test Sequencer, Step 3
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,
545
546
Appendix which can then be investigated. If you use the
<record>[*].<record>.<field> format in the Formula object, you will get an array of data. In this case, you get an array of real values giving the test results for five runs of test2. You can then calculate the minimum, maximum, mean, and standard deviation from this array. You could specify a single run of test2 by indicating a particular element in the array of records of records. For example, to get the first run result of test2 you would use the expression: A[0].test2.result.
Using the Test Sequencer, Step 4
Add a timestamp field to the logging record. Add a delay so that each step runs one second apart. In a separate thread, get all the results of test2 and send them to a record constant.
The Delay Object (First Thread):
This object holds execution flow for the specified number of seconds. Here it is used to ensure the time stamp values vary between each run of the
Sequencer.
Adding a Time Stamp:
To add a time stamp, open the
Sequencer object menu and select Properties
⇒ Logging tab to check Record Fields to Log
⇒ Time Stamp. Figure 311 shows the
Properties
⇒ Logging tab dialog.
VEE User’s Guide
Appendix
VEE User’s Guide
Figure 311 Add a Time Stamp to the Logging Record
Solution—Using the Test Sequencer, Step 4
Figure 312 shows a solution to step 4 of using the test
sequencer.
547
Appendix
548
Figure 312 Using the Test Sequencer, Step 4
Hint: To display a record, click on the Record
⇒ Record: Scaler field for one of the tests and the Record Field Data dialog box
appears. Figure 313 shows the Record Field Data dialog box.
VEE User’s Guide
Appendix
VEE User’s Guide
Figure 313 Checking a Record
Using the Test Sequencer, Step 5
Print the time stamp fields from the records on a Logging
Alphanumeric display.
Hint: Use four Formula objects (one for each test). To show all four Formula results in one Logging Alphanumeric display, add a Junction object. Use a To String to format the 63G time stamp value into a more readable string.
Solution—Using the Test Sequencer, Step 5
549
Appendix
Figure 314 shows the program thread to print the time
stamps to a display, step 5 of using the test sequencer.
550
Figure 314 Using the Test Sequencer, Step 5
Key Points
Converting Time Stamp Formats:
The To String object before
Logging AlphaNumeric converts the time stamps from a Real format to a Time Stamp format for more clarity.
Using the Test Sequencer, Step 6
VEE User’s Guide
Appendix
If the Sequencer includes many tests, it can become cumbersome to use many individual Formula objects connected to a Junction. Instead, you can use a Formula that contains an expression, generate the expression at run time, and loop through the possible expressions.
First the example will generate the expression strings.
In a separate thread, use a Loop and a Formula to generate a test expression string. Output the information as a string in a
Logging Alphanumeric. The string generated in the Formula should be "a[*].test<x>.timestamp" where <x> goes from
1 to 4.
Solution—Using the Test Sequencer, Step 6
Figure 315 shows a solution for step 6.
VEE User’s Guide
Figure 315 Using the Test Sequencer, Step 6
Using the Test Sequencer, Step 7
Now take the Loop and the Formula you built in Step 6, and replace the four Formulas and Junction in the previous step with the Loop and Formula. Plus, you now want to evaluate the string you built. Send the string generated (the expression
"a[*].test<x>.timestamp" ) into a Formula to be evaluated at runtime.
551
Appendix
Formula Control Pin on the Formula Object:
The Formula you want to evaluate is generated by the Formula inside the Loop.
You can create a second Formula box with a control input for its
Formula expression. The expression the second Formula evaluates is generated at runtime.
Solution—Using the Test Sequencer, Step 7
Figure 316 shows a solution to step 7.
552
Figure 316 Using the Test Sequencer, Step 7
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.
VEE User’s Guide
Appendix
Solution—Using the Test Sequencer, Step 8
Figure 317 shows a solution to the final step in using the
test sequencer.
VEE User’s Guide
Figure 317 Using the Test Sequencer, Step 8
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.
553
Appendix
The Conditional Expression in the From Data Set Object (Second
Thread):
The expression is (Rec.test1.pass==1) OR
(Rec.test2.pass==0), with the same <record>.<record>.<field> format. Rec is the name of each record in the dataset as it is read and tested. Test1 and test2 specify which tests VEE should examine, and the field name pass is the default name for the pass- fail indicator (1 or 0) assigned by VEE. (You enable or disable different fields for all tests by selecting Logging tab in the Sequencer Properties box.)
554 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