116 Chapter 2
Agilent VEE Programming Techniques
Practice Programs
Practice Programs
The practice programs in this section illustrate more VEE features.
Lab 2-6: Generate a Random Number
1. Document the program:
a. Select
Display ⇒ Note Pad and place it at the top center of the
work area. Click on the editing area to get a cursor, then enter:
This program, Random, generates a real number
between 0 and 1, then displays the results
.
2. Select
Device ⇒ Function & Object Browser. Select Type ⇒
Built-in
function, Category ⇒ All, and Functions ⇒ random.
Click
Create Formula. Place the object in the work area and click to
place the object.
3. Click
Data ⇒ Constant ⇒ Int32 and place it to the left of random.
Open the
Int32 object menu, click Clone, and put this below the other
Int32 object. Double click the 0 to get a cursor, then enter 1. Connect
the constant object with
0 to the low input pin of random, and connect
the constant
1 to the high input pin.
4. Select
Display ⇒ AlphaNumeric and place it to the right of the
random object. Open the object menus and select Help to understand the
objects better.
5. Connect the
random object output pin to the AlphaNumeric input pin.
A data line appears, connecting the two objects.
Note As you move the mouse pointer with the line attached near the target pin, a
box highlights the pin. Then you click again to complete the connection.