LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I build Oscillator in LabVIEW?

I want to generate a signal like square wave or close to square wave. Time duration 2 or 3 sec. Any idea how to build it in LabVIEW please?

0 Kudos
Message 1 of 13
(5,701 Views)

When you install LabVIEW, many examples around your requirement are also shipped along with it...

You may want to check this:

 

C:\Program Files (x86)\National Instruments\LabVIEW 2012\examples\measure\maxmpl.llb\Function Waveform Generation.vi


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 2 of 13
(5,681 Views)

LabVIEW is a programming environment, not a circuit design software (such as multisim).

 

Can you explain your requirements? Are yuo looking to output a real analog square wave? What DAQ hardware do you have?

 

 

0 Kudos
Message 3 of 13
(5,665 Views)

Hi,

First thank you for your reply, I am new with LabVIEW. I need it for my Master Project. I am learning day by day. I have a lot to learn about LabVIEW. 

 

I am using k8055 (USB interface board) from Velleman. It is working with LabVIEW.

 

I want to have control on Led. I am using the analog output. I can change it from 0 (0 volt) to max (5 volt).

First: I want to give max. to keep the Led on. I want to keep it on for period of time.

Second: After that I want to give square wave to the same Led. I want every 2 or 3 second to give a pulse to the Led. Also I want to keep it on for period of time.

 

 

0 Kudos
Message 4 of 13
(5,660 Views)

@Nadjil wrote:

 

I want to have control on Led. I am using the analog output. I can change it from 0 (0 volt) to max (5 volt).

First: I want to give max. to keep the Led on. I want to keep it on for period of time.

Second: After that I want to give square wave to the same Led. I want every 2 or 3 second to give a pulse to the Led. Also I want to keep it on for period of time.

 


Use a loop and a shift register.  Wire in the initial value (5) to the left side shift register.  Inside the loop, do some arithmetic to toggle between 5V and 0V and wire the result to the right shift register.  Also wire this result to your analog device input.  When the loop runs, the value will toggle between 0V and 5V.  Put a delay inside the loop for the time you want the LED to be on/off.

There are many ways to toggle between 0V and 5V.  You can create a case statement like:  if 0 then 5, else 0.  You can compare the value to 5 and use a selector function to pass the opposite value.  You can use a boolean instead of a value, and use a selector to pass 0/5 depending upon the boolean.  To toggle the boolean, use a NOT function.  My favorite is a simple subtraction.  Output = 5 - Input.  If input is 0, output is 5, if input is 5, output is 0.

 

I've given you basics.  I leave the coding up to you to help you learn better.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 13
(5,651 Views)

Thank you for your help.

 

I was looking to the examples of LabVIEW 2010. I found something but I don't know if it is helpful or not? I though I might discuss it with you, could you help me. The example called "Multi tone Signal Generation". Looking back to my project, I can use also Sinwave, it does not mater Square or Sinwave if I trigger my Led. I rebuild my blocks to get the sine or square -wave.

 

I connected to the other blocks but I got error "wiring". I attached a picture for what I did also the error I got. First I want to get Sin- or Square- wave output then I will move to the delay part.

(First I want to give 5 volt for 10 min. then I switch on the sinwave or square wave for 1 or 2 min. to trigger the Led)

 

I thought about While loop to use. I put a delay then my signal will be applied to the Led after 10 min. this time I want to control it also.

 

f1 = 100

# of samples = 128

Fs = 20

 

I hope this information could tell you what I did and what I need to do. I would like to know your reply? Please.

 

Screen Shot 2013-05-17 at 11.30.31 AM.png

0 Kudos
Message 6 of 13
(5,619 Views)

Please attach the actual VI, not some oversized picture.

 

Seems your CLFN want a scalar I32 value, so why do you try to wire a DBL array to it? (round hole, square peg comes to mind :D)

0 Kudos
Message 7 of 13
(5,602 Views)

Do you mean the file of my work I have to attach?

0 Kudos
Message 8 of 13
(5,599 Views)

@Nadjil wrote:

Do you mean the file of my work I have to attach?


Nobody forces you to attach anything, but if you can attach the actual VI, it is more likely that we can help. 😄 A picture is not suitable to analyze or debug a LabVIEW program (for example we cannot see what the CLFN is actually doing or what is in the other frames of your stacked sequence. Some of the code is cropped off. I also don't see a while loop. How are you running this?).

0 Kudos
Message 9 of 13
(5,594 Views)

OK, I got your point.

 

This is my work. After I conected I want to make delay of 10 min. (perefer to be controlled).

First countinous signal from Knob1 then the sinwave, pulse each 2 or 3 sec. this I build it and I can control it in the whicl loop.

 

I hope now I make it clear to you when you look to my attachment. 

0 Kudos
Message 10 of 13
(5,588 Views)