LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timed sinewave using triggering

Solved!
Go to solution
I'm new to labview and the searches I performed on timed loops etc produced a lot of information that I couldn't understand. All I want to do is generate in a while loop a sinewave that would last 1 second each time I press a trigger button (and then the amplitude would go to 0). I know only how to generate a sine wave continuously... Could someone please help? I couldn't understand how to use timed loops if this is the way to do it. Thanks for any pointers or examples.
0 Kudos
Message 1 of 4
(2,844 Views)

1.Connect the trigger to DI line (if its a digital trigger)

2.Just modify the example at this path: C:\Program Files\National Instruments\LabVIEW 8.5\examples\DAQmx\Digital\Read Values.llb\Read Dig Chan.vi  with the sine wave generation logic in case structure within the loop.

 

The example is simple digital input read and if your code needs some more logic you can build it around.

Post back for queries.

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 2 of 4
(2,827 Views)
Solution
Accepted by topic author my8os

Good Afternoon my8os,

 

You do not need a timed loop.  The simplest way to program this is to have a DAQ Task setup with the appropriate waveform.  Start the output and a timer on the user trigger.  When the correct time has elapsed, stop the loop/task.  You can use the Elapsed Time Express VI to count 1 second.  It will output a Boolean when the time has elapsed.

 

If you wanted to have a slightly more elegant (and complicated) program, you can use an Event Structure to monitor for the user input and enter your 1 sec analog output loop when needed.

0 Kudos
Message 3 of 4
(2,807 Views)
Thanks for the answers. I found the elapsed time express vi easier for me to comprehend and implement. It worked after a couple of trial and errors. I also made it not to reset automatically. Thanks again.
0 Kudos
Message 4 of 4
(2,801 Views)