The To DataSet Object:. Agilent Technologies VEE Pro

Add to My manuals
602 Pages

advertisement

The To DataSet Object:. Agilent Technologies VEE Pro | Manualzz

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

box as shown in Figure 308.

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