02-03-2016 11:06 AM
I modified setup (please see the snapshot below).
Acquisition mode is "1 Chan, 1 Sample", so at the output of the DAQmx Read - a single double value.
Actually it must work ... signal and threshold are of same type and dimension.
But LED blinking is completely desynchronized with input signal (sawtooth, amplitude = 4V, frequency = 1Hz): LED blinks much slower than input signal changes.
Any ideas ?
Thanks
Pavel
P.S. The trhreshold is 2V.
02-03-2016 11:20 AM
Have you plotted the signal on a waveform chart to compare? Are you sure your signal is coming across as the 1Hz sawtooth and should be triggering the LED like you expect? If noise is the issue, then you can filter the signal.
Please include a Snippet of your code, or attach your VIs, so that we can better assist you. Screenshots aren't the right way to share what you're coding.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
02-03-2016 11:38 AM - edited 02-03-2016 11:39 AM
Hi Pavel,
are you sure you want to set a sample rate of 100kS/s and then read those samples one by one?
Are you really sure what you are doing here???
Btw. when your while loop will never stop you don't need to clear the DAQmx task after the loop… 😞
02-03-2016 12:50 PM
Thanks GerdW and James
I'm reading your respnces once returning at home.
I'll send my snippet tomorrow.
Concerning sample rate ... I've tried with different values to see if there some impact ... 100ks is just last value that I tried.
... you don't need to clear the DAQmx task after the loop…
Sure, it's just redundancy of copy/past from my previous setup.
Anyway, thank you for this remark.
Best Regards
Pavel
02-09-2016 03:12 AM
Hello GerdW and James
Here is VI.
I've also put small video, that shows the problem:
https://www.youtube.com/watch?v=qztnfe0T_Zk&feature=youtu.be
You can see that LED changes to ON at about 11 sec and remains until 21 sec.
So, the duration of ON is about 10sec, whereas from the setup we can see that sawtooth period is 1 sec and threshold is 0V.
How to explain such discrepancy ?
Regards
Pavel
02-09-2016 04:02 AM
The problem disappeares when I specify sampling rate on DAC (AI0) to 10'000 or 1'000 (instead of 100'000) it becomes correct ... strange that I missed this issue before.
Also strange that the problem appears with sampling rate 100'000 (according to USB-6343 datasheet, the maximum sampling rate on analog inputs is 500kS/sec)
Regards
02-09-2016 04:11 AM
One more observation - sampling is OK (i.e. LED blinks correctly) until sampling rate = 50kS/sec. At 55kS/sec it's already "bad"
02-09-2016 04:26 AM
02-09-2016 04:53 AM
Hi GerdW
Here it is.
Thanks
02-09-2016 05:36 AM - edited 02-09-2016 05:37 AM
Hi Pavel,
never (never ever!) try to read an input channel one sample at a time, when you have configured a sample rate of more than 100S/s!
The solution of your problem was given here!