Generating a Random Sine Wave in Lab View 7

Generating a Random Sine Wave in Lab View 7

Open LabView

New VI

You have two panels a front panel Like the control of the box

 

 

and the block diagram view

 

 

Right click to open the function window

 

 

Click on the Front panel window

Right Click to open the Controls

Select All Controls

Select Graph, Select Wave Form Chart

 

Drag the wave form chart onto the front panel

Now click on the other panel the Wave Form Chart should appear on it

 

Right click Select Functions, All Functions, Numeric and drag the dice onto the panel

 

Wire the random number generator to the chart by clicking once in the middle of each

 

 

Right Click on the front panel and add a toggle by selecting

All controls, Controls, Boolean Drag the switch onto the front panel

You can change the name of the switch by clicking on the name

 

Next insert a conditional loop called a while loop

Do this by Right clicking in the Block Diagram/Functions/Exec Control/While Loop

In the Block Diagram View

 

Wire your icons by clicking in the middle once and dragging the wire to the opposite icon.

Wire your Random Generator to your wave form chart

Wire your On/Off Switch to the While Loop

 Select all tools

 

Now because the frequency is so fast we will put in a delay.

Go back to all functions and this time select Time and Dialog/Wait

 

 

Once you have dragged the Wait on to the Block Diagram

Right Click and put in a delay of 100 milliseconds by creating a Constant

 

Wire your constant to the number counter

Go back to the Front Panel

 

 

To run your wave you can use your toggle switch or the run arrow and the stop icons.