End of activity 12-2 – National Instruments BridgeVIEW User Manual

Page 273

Advertising
background image

Chapter 12

Case and Sequence Structures and the Formula Node

BridgeVIEW User Manual

12-10

© National Instruments Corporation

Round to Nearest function (Functions»Numeric)—In this activity,
the function rounds the random number between 0 and 100 to the
nearest whole number.

Not Equal? function (Functions»Comparison)—In this activity,
the function compares the random number to the number specified
in the front panel and returns a TRUE if the numbers are not equal.
Otherwise, this function returns FALSE.

Increment function (Functions»Numeric)—In this activity, the
function increments the While Loop count by 1.

Subtract function (Functions»Numeric)—In this activity, the
function returns the time (in milliseconds) elapsed between frame 2
and frame 0.

Divide function (Functions»Numeric)—In this activity, the function
divides the number of milliseconds elapsed by 1,000 to convert the
number to seconds.

Numeric constant (Functions»Numeric)—In this activity, the
function converts the number from milliseconds to seconds.

In Frame 0, the Tick Count (ms) function returns the current time in
milliseconds. This value is wired to the sequence local, where the value
is available in subsequent frames. In Frame 1, the VI executes the
While Loop as long as the number specified does not match the
number that the Random Number (0–1) function returns. In Frame 2,
the Tick Count (ms) function returns a new time in milliseconds. The
VI subtracts the old time (passed from Frame 0 through the sequence
local) from the new time to compute the time elapsed.

15. Return to the front panel and enter a number inside the

Number to

Match

control and run the VI.

16. Save the VI as

Time to Match.vi

in the

BridgeVIEW\Activity

directory.

End of Activity 12-2.

Advertising