Microsoft Word me104 lab1 2003. doc


The Random Number Plotter VI



Download 349.88 Kb.
View original pdf
Page10/22
Date28.02.2022
Size349.88 Kb.
#58329
1   ...   6   7   8   9   10   11   12   13   ...   22
lab1 intro to labview

The Random Number Plotter VI To illustrate the general approach to building a VI and to familiarize you with the LabVIEW environment, you will build the Random Number Plotter VI. The function of this VI is to continuously generate random numbers between 0 and 1 and plot them to a chart on the front panel. Figure 2 shows the front panel and block diagram for the Random Number Plotter VI that you will build. Let’s examine the basic parts of this VI.

(ab front panel (b) block diagram
Figure 2. Random Number Plotter VI continuously generates random numbers between 0 and 1 and plots them to a chart, until stopped by user.


7
• Random Number function (in block diagram in Figure b To generate random numbers between 0 and 1, you will use the Random Number) function from the builtin LabVIEW library.
• Random Plot waveform chart (on front panel in Figure a You will use a Waveform Chart to display the random numbers being generated. In the block diagram in Figure b, notice that the Random Number function is wired to the Random Plot terminal. The Random Number function generates a number which then flows through the Random Plot terminal to the waveform chart on the front panel.
• ‘While Loop’ structure (gray rectangle surrounding all nodes in Figure b Since the Random Number function only generates one number for each run, you must place the Random Number function (and all the other icons) inside a While Loop structure to continuously generate random numbers. The While Loop executes all subdiagrams within its boundaries until you wire a TRUE or FALSE value to its conditional terminal (icon at the bottom right corner of the While Loop. Execution of the While Loop can beset to Continue if True or Stop if True. For this VI, the condition is set to Stop if True. The icon at the bottom left corner of the While Loop is the
iteration terminal which contains the number of completed iterations of the While Loop.
• Stop button (on front panel in Figure a To allow the user to stop the continuous While Loop, you will add a Stop button on the front panel. On the block diagram, note that there is a control terminal (labeled stop) corresponding to the Stop button and it is wired to the conditional terminal of the While Loop. When you click on the Stop button, a TRUE value is passed through the Stop button terminal to the conditional terminal of the While Loop. When the While Loop checks the value of the conditional terminal at the end of the iteration, it will stop upon finding that the conditional terminal is TRUE since the execution condition is set to Stop if True.

Download 349.88 Kb.

Share with your friends:
1   ...   6   7   8   9   10   11   12   13   ...   22




The database is protected by copyright ©ininet.org 2024
send message

    Main page