10-21-2008 04:30 PM
Hi there,
I am trying to generate one cycle of a waveform(triangle wave) upon recieving a trigger signal from another input.
I have the waveform generation working however it generates more than one cycle and also stops before a whole waveform is generated. The waveform generated can have a different duration than the trigger signal (frequency).
How would I change the program to have it generate only one waveform upon trigger.
Please see the attached VI in Labview 8.5.
Attached is also what the program should do as JPEG image diagram.
Thank you!
~Anthony
10-22-2008 10:38 AM
Anthony,
I played around with your vi for a little bit, and it seems that the easiest way to manipulate your data of the triangle wave is to wire an input to the sampling info of the vi. The input is looking for a cluster of 2 doubles, 1 being sampling rate, 1 being # of samples. In the vi I built, I just set rate to always be 1000 times the frequency, and the samples to always be 1000, giving you 1 period.
Hopefully this helps!
10-24-2008 03:36 PM
Hi Chris,
Thanks for the VI.
I do have a question though. For higher simulated signals it seems like it does not trigger the waveform generation. I've tried changing the sampling rate as well and it still occurs.
Also How would I add a "start" button to start and stop the vi without actually hitting the arrow button. I have currently a case structure wired to a button for a true scenario that enables running, but it requires that the "run continously" button be depressed on the VI bar.
Thanks!!
10-24-2008 04:18 PM
hoju,
Im not sure I really understand your first question. I believe that just playing with different values should help you familiarize yourself with how the triggering works.
As far as the start button, there are a couple ways to do this. One way would be similar to your idea, but you just put a while loop around the case structure, making you only have to hit the run button (arrow) once. Another way would be to make an event structure inside of a while loop that triggers everytime you hit a button and then goes to a different case when you hit a stop button, or you could have the stop button just end the VI, its up to you. Any solution will require a while loop around your whole program though, the triggering is what would differ.
10-24-2008 06:47 PM
Hi Chris,
Thanks for the clarification on the start button.
As for the triggering, with the existing program, if i slide the frequency up on the simulated signal, the triangle waveform stops generating/triggerring. This what i was refering to. Also with that the boolean led that lights up upon trigger does not if the slider is about half way over (in the center).
Thanks!
10-27-2008 09:59 AM
hoju,
I see your problem now, and had a chance to reproduce it this morning. After some tinkering around with the block diagram, the thing I did that seemed to fix it was to use the data from the simulate signal, as opposed to the Amp and Level Meas. I just used a "convert form dynamic data" to a numeric, then i did a comparison to see if that number was > 0. I used that comparison for the case structure and the boolean and it seemed to work.
Hope this helps!