![background image](http://html1.mh-extra.com/html/national-instruments/bridgeview/bridgeview_user-manual_3445534253.webp)
Chapter 11
Loops and Charts
11-14
©
National Instruments Corporation
3.
After adding the vertical switch, pop up on it and select Mechanical
Action»Latch When Pressed and set the ON state to be the default by
choosing Operate»Make Current Values Default.
Block Diagram
4.
Build the block diagram shown in the following illustration.
5.
Add the While Loop (Functions»Structures) in the block diagram
and create the shift register.
a.
Pop up on the left or right border of the While Loop and choose
Add Shift Register.
b.
Add an extra element by popping up on the left terminal of the
shift register and choosing Add Element. Add a third element in
the same manner as the second.
Random Number (0–1) function (Functions»Numeric)—This
function generates random data ranging between 0 and 1.
Compound Arithmetic function (Functions»Numeric)—In this
activity, the compound arithmetic function returns the sum of random
numbers from two iterations. To add more inputs, pop up on an input
and choose Add Input from the pop-up menu.
Divide function (Functions»Numeric)—In this activity, the divide
function returns the average of the last four random numbers.
Numeric Constant (Functions»Numeric)—During each iteration of
the While Loop, the Random Number (0–1) function generates one
random value. The VI adds this value to the last three values stored in
the left terminals of the shift register. The Random Number (0–1)
function divides the result by four to find the average of the values (the
current value plus the previous three). Then the average is displayed on
the waveform chart.