LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

chnage the frequency of the signal during run time

Solved!
Go to solution

hi i am working on a VI to calculate the overshoot of the signal i think the VI seems to be fine (not sure) but right now my problem is to

change the frequency during run time which i am not able to do only when i stop and run the vi again the frequency changes........ pls

somebody help me i have tried putting it in a event....but no use....may be iam missing something pls help me...

Message Edited by sk_labview on 08-01-2009 04:39 AM
0 Kudos
Message 1 of 3
(2,365 Views)
Solution
Accepted by topic author samtha

I noticed that you have a while loop around the entire block diagram--I'm not entirely sure why that's there.  The way you have your VI written, the two inner loops will never exit unless there's an error--the "stop" buttons are hidden.  Thus, the outer loop isn't doing anything for you.

 

Once you take that away, it's easier to see why you can't change the frequency.  It's being set once, outside of any loops, and thus never gets checked again.  The easiest way to solve this, in your case, is to use shift registers on the top loop and check if the value of the frequency has changed since the last iteration.  If it has, generate a new waveform and feed that to the DAQmx Write instead.

 

See the attached version of your main VI for what I mean.  (I also replaced the stop controls with one that's visible and which will stop both loops without your needing to hit the abort button.) I'm also getting an error on the DAQmx read in the bottom loop, but I trust that it works fine on your equipment.

 

Cheers,

Michael

Message 2 of 3
(2,347 Views)
hi peppergrower thank you for the solution very nice of you, awesome suggestion it has solved some of my problems in other applications n i have learnt something too anyways thanks again........
0 Kudos
Message 3 of 3
(2,331 Views)