Setting a Field in a Record. Agilent Technologies VEE Pro

Add to My manuals
602 Pages

advertisement

Setting a Field in a Record. Agilent Technologies VEE Pro | Manualzz

Storing and Retrieving Test Results Chapter 5

VEE User’s Guide

Figure 136 Using the Get Field Object

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.

Setting a Field in a Record

This exercise shows how to change data in specific fields of a record.

You can re-use the same Record with different tests.

N O T E

227

5 Storing and Retrieving Test Results Chapter

N O T E

1 Open the getfield.vee program.

2 Delete all objects after Build Record, by selecting objects and pressing Ctrl-X.

1 Select DataAccess RecordSet Field and place it to the right of Build Record. Connect the output from Build Record to the rec input of Set Field. The title will be rec.field

= b.

Set Field works by assigning the expression on the right side of the assignment symbol (=) to the left hand side. Therefore, the specified field of rec is modified to contain the value(s) from the right hand side. The rest of the record is unchanged.

You connect the incoming record to rec and the incoming new value to b. The modified record will be put on the data output terminal labeled rec.

The Set Field object is a Formula configured with inputs and an expression, like the formulas in the Function & Object Browser.

2 Edit the expression to rec.data[*]=b to change the value of the four element array in the data field. (You need to use the array [*] notation, because you are changing the whole array in the field of this record.) You will put the new values for the array on the input terminal b.

3 Select DataConstantReal64 and place it under the

Build Record object. Open the object menu, and select

Properties. Select 1D Array under Configuration, then edit the Size to 4, and click OK.

If the new values for the record field are contained in an array, it must have the same size as the current array.

Enter the values 1, 2, 3, 4 into Real64 by highlighting the first entry and using the Tab key to move to subsequent entries. (Do not press the Tab key after the last entry.)

Connect it to the Set Field (titled rec.field=b) input labeled b.

Now use the Get Field object to extract the field rec.data from the record and display the results.

228 VEE User’s Guide

Storing and Retrieving Test Results Chapter 5

N O T E

4 Select DataAccess RecordGet 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.

5 Select an AlphaNumeric display, size it to accommodate an array, and connect it to the rec.field output pin.

6 Run the program and save it as setfield.vee. The program

should look like Figure 137.

VEE User’s Guide

Figure 137 Using the Set Field Object

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.

229

advertisement

Related manuals

advertisement

Table of contents