12-22-2016 05:18 AM
Hi,
I am using NI USB-6353 to measure an analog input signal and counter periods. The two created tasks must start synchronously.
I used this VI as a template and only changed the Encoder Configuration from CI Angular Encoder to CI Period. The problem is, that I always receive error -201314 (Multiple Sample Clock pulses werde deteceted within one period of the input signal). Isn't it possible to synchronize CI Period and an analog input?
12-27-2016 08:20 AM
Hi ugccz,
you see this error, because the Samplerate you use is too fast. There is a KB for this topic, I recommend to read this:
http://digital.ni.com/public.nsf/allkb/18E8B27384BBCC7B86257A6800618056
So if you use e.g. 1kHz Sample clock, but the period you want to measure is longer than 1ms, you are trying to read a sample, when the period-measurement hasnt finished. Thats why you get the error. An Alternative is to use implicit timing, wich gives you a sample whenever the measurement is finished. But this wouldn't be synchronized with the AI task.
I see two solutions here:
1. Use implicit timing, and read 1 Sample as a Waveform. This will give you a timestamp, and you can later synchronize the acquired AI-Array with the Samples received (wich are not equally sampled). But since the Timestamp received from DAQmx is not super-precise, this might not be suitable.
2. I hope this works, but just give it a try. Use Sampling Type "1 Sample Hardware-Timed". Lets say you have 1kHz Samplerate, and 1.9ms Period-length. Then around every second time you try to read a sample you will get the error (The error occurs at DAQmx-REad.vi, right?).
Whenever the error occurs, you just ignore it, and output the last valid sample. I attached some example code as a screenshot (its a VI-Snippet, just drag&drop it to the blog-diagram to add the code there)
3. You can also consider using a slower sample-rate, if this is still within the specs of your application.
Just try the approach thats most suitable for you, and give me a short answer if it works now. Thanks!
Best,
Jan Göbel
Staff Applications Engineer
12-27-2016 08:21 AM
Its 3 solutions ...
01-02-2017 02:50 AM
Thank you for your answer.
The specs of my application need a fast sample (2 MHz). I solved my problems now by using CI angular encoder. In this case, I can synchronize AI and CI without any errors.