182 Chapter 4
Analyzing and Displaying Test Data
Creating Expressions with the Formula Object
Note All the functions created from the Devices ⇒ Function & Object
Browser
Built-in type are simply Formulas that already have their
expressions set appropriately. They can be modified to combine functions
and add (or delete) inputs. You can also do multiple-line entry in the
Formula object, and assign values to output terminals.
Evaluating an Expression with the Formula Object
In this example, you will evaluate the expression, 2*A^6-B, where A=2 and
B=1. (Notice the ^ sign for exponentiation.)
Note The variable names are not case-sensitive.
1. Select
Device ⇒ Formula. Click the Formula input field and type
2*A^6-B.
2. Place the mouse pointer over the data input area (but not right over the
A
input) and press Ctrl-A to add an input pin.
Note It will be labeled B by default, but you can rename it.
3. Select
Data ⇒ Constant ⇒ Int32, clone it by selecting Clone
from the object menu, and connect the two Int32 objects to the Formula
inputs
A and B.
4. Enter
2 in the A Int32 input box and 1 in the B Int32 input box.
5. Select
Display ⇒ AlphaNumeric and connect it to the output of
Formula, and run the program. It should display the result 127, as shown
in Figure 4-6.