10-18-2009 05:27 PM
with the function generator.vi and sine wave form.vi embedded in a while loop, a single point of a sine function can be output for each program cycle. After a specific amount of iterations have occured (ie the sample number equals the amount of samples taken each loop), a single period is complete.
Questions..
1.How can these waveforms be best used to approximate real time waveforms. Ie. In the above example, the 1htz sine wave appears to be running at more like 1000htz. I guess I would have to increase the sampling period? What is the best method?
2. Is there a way to do peak detection or count the amount of periods which have occured? This is somewhat tricky as only one point is coming out at a time so im guessing an array would have to be built. There has to be a simplier way to verify the rate at which it is running. I guess mathematically it could be done but checking it is good too.
10-18-2009 05:36 PM
what is your sampling info set to for it to have 1 hertz to make it 1k hertz ?
if it's the default settings, 1000 rate and 1000 samples then I don't see what is wrong.
10-18-2009 06:36 PM
WOW!
Another post that wants the (Windows?) mSec timer to be tracable to the NI Second. Basically, it can't happen! TIME (as a measurement) cannot be related to the system mSec timer. Use an external time referance.
10-18-2009 07:15 PM
10-18-2009 07:57 PM
sdpark
what you are doing is sampling a sin wave 1000 times and then during each while loop iteration, creating a thousand points..
so it looks stable as you are recreating the same 1000 points each loop.
for more practical apps, you need to do just one point at a time of the sine wave
thanks for trying though.
10-18-2009 07:58 PM - edited 10-18-2009 07:59 PM
jeff,
Ill give the external clock a shot tomorrow.
this sounds like helpful advice
thanks
10-18-2009 08:00 PM
dennis,
yup, its pretty obvious what is happening,..
but, you didnt actually say how to fix it.
i think the external clock that was previoiusly mentioned is the best answer, if it works.
Ill post back
10-18-2009 08:08 PM
PUT IN SOME DELAY TO SIMULATE ACQUISITION TIMING.
If you want to acquire every one second, then the delay is 1 second.