Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems in Synchronisation between AI and Counter

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?

 

0 Kudos
Message 1 of 4
(3,148 Views)

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

0 Kudos
Message 2 of 4
(3,099 Views)

Its 3 solutions ...

0 Kudos
Message 3 of 4
(3,098 Views)

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.

0 Kudos
Message 4 of 4
(3,072 Views)