05-16-2013 04:38 AM
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?
05-16-2013 07:06 AM
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
05-16-2013 09:43 AM - edited 05-16-2013 09:43 AM
05-16-2013 09:56 AM
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.
05-16-2013 12:08 PM
@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.
05-17-2013 04:36 AM
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.
05-17-2013 09:18 AM
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)
05-17-2013 09:22 AM
Do you mean the file of my work I have to attach?
05-17-2013 09:26 AM
@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?).
05-17-2013 09:34 AM
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.