04-12-2006 12:04 PM
04-12-2006 02:21 PM
04-13-2006 04:40 AM
04-13-2006 04:56 AM
04-13-2006 05:10 AM
04-13-2006 07:48 AM
Hi G,
I’ve tried the same thing on my machine (10Hz, 1kHz sampling rate and 1000 samples), and seen the same issue I think you’re seeing.
The problem is that if you’re taking 1 seconds worth of a 10Hz signal, you’re only just going to get 10 full cycles if the generator and sampler are deadly accurate (because the 10 full samples will take the whole of your sampling ‘window’), if either one of them drifts you may see slightly more or less than 10 full cycles.
This would be OK if the sampling window always started at a zero crossing point, BUT what I think the analogue level VI is doing is throwing away all the samples before the first positive going zero crossing, leaving you with an even smaller sampling window, and hence less than 10 full cycles of your waveform.
The answer I think is to increase the number of cycles you are sampling by at least a hundred, to cope with the possibility of a maximum of one period of your waveform having to be discarded as the analogue level waits for a zero cross.
I hope this makes sense! Please have a go at increasing the number of samples and see if this helps. The sub-vi should be fine as long as it sees the 10th zero cross fine (if it doesn’t I think it just returns the whole sample set.
Good Luck,
M.
04-13-2006 08:31 AM
04-13-2006 09:17 AM
Hi,
Took a while but I figured it out! The code you've got at the moment is only ever returning 1000 samples, no matter what you set the control to (hence if you try and sample 2000 samples and it only returns 1000, you see less wavelengths).
This can be fixed by connecting the samples to read terminal into the sample clock setup vi (see attached jpeg), which forces the VI to get that number of samples subsequently. I've checked this with 50Hz and 2200 samples on my machine, and it returns 10 cycles reliably.
Hope this helps!
Cheers,
M.
04-13-2006 10:13 AM
04-13-2006 05:30 PM