08-01-2009 04:31 AM - edited 08-01-2009 04:39 AM
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...
Solved! Go to Solution.
08-01-2009 08:18 AM
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
08-02-2009 10:52 PM