ā10-31-2006 03:14 PM
ā10-31-2006 10:09 PM
Hi,
Probably you are using a loop (while loop?) around the DAQmx Read vi and the Wav write vi to run it continuously. So you can use the iteration count of this loop to decide whether its the first iteration or not. See attached image. Here I assumed that you are using the resample vi inside the send Write Waveform.vi.
Kallis
ā11-01-2006 12:59 AM
Thanks Kallis
That is very clear now. I will give that a go first thing.
Are using the S&V Toolkit yourself, or is this inspiration from other LabVIEW experiences?
ā11-01-2006 02:57 AM
Hi
You can see vi's with resent input in other places also. Most of these store some state information (usually in uninitialized shift registers) which will be required for processing continuous data. So this applies not only to SVT but to any such VI in LV.
Kallis
ā11-01-2006 03:29 AM
Thanks again.
There is no while loop in the standard SV Toolkit Recorder at the location shown.
I have now added one as shown in your diagram. The reset terminal is not on the WDT Write sub-vi.
I have opened the block diagram and there are no reset terminals on the lower level vi's either.
I am sorry if this is obvious, but where do I connect the reset?
ā11-01-2006 03:53 AM
Hi,
This information is not directly intended to answer the the most recent post but may offer overall explaination.
If you look on page 16 of the 9233 specifications, you will notice that there are only 26 available sample rates for the USB-9233. You can specify 44.1 kHz on sample rate enum, but notice right below that there is an indicator called "actual sample rate". You will see 50 kHz here instead of 44.1 kHz. If you ask the 9233 to sample at an unsupported rate, it will automatically round up the rate to the next supported value. So it is important to recognize that the 9233 cannot sample at 44.1 kHz but the data is saved with a dt of that is the inverse of 44.1 kHz. This means that the data is sampled with a dt of 2E-5 but is saved with a dt of 2.26E-5. When your sinusoid data is read, the points will be spread out a bit and the overall frequency will be lower or "shifted" as you described.
There is a solution though, you can use the "Resample Waveforms (continuous).vi" and specify a "dt" of 1/44.1k. The new waveform will be an interpolated version of the one sampled at 50k. Make sure you do this before you save the waveform to the file. As I think has been suggested already.
KB: Valid Sampleing Rates for the NI 9233
As correctly stated by Kallis, this is not a limitation of LabVIEW but a result of the 9233 itself.
Kurt NIUK & Jeff NIC
Application Engineers
ā11-01-2006 05:34 AM
Thanks,
That resampling has been done to the 44,1kHz before saving (see above).
The error however persists with the saved Wave file shifting the frequency.
The root cause is still unclear.
ā11-01-2006 07:22 AM
I have added the reset to the resampler for the first iteration only as suggasted - no improvement. ![]()
ā11-01-2006 08:38 AM
ā11-01-2006 10:57 AM