Quantcast
Channel: Counter/Timer topics
Viewing all articles
Browse latest Browse all 1271

what is the array being returned by the DAQmx counter READ? How do I know the data flow of two DAQmx READ functions in the same WHILE loop?

$
0
0

I have a question about the order of execution.  In the WHILE loop, I have two things being measured, period and voltage using the DAQmx READ functions for voltage and counter.  Ultimately, I want to collect these data points as nearly simultaneously as possible, as a pair, and then send them together to another piece of code (not shown here) that will translate them into some kind of command for a motor.  That would be one execution, and then, I want to collect the voltage and period again at a time later, and do the same thing.

 

1.) I am a bit confused about what the counter READ function is returning because it is an array.  What is it an array of?  I was thinking it was returning the value of individual periods between rising edges.  Actually, the output of the Counter 1D DBL is an array. How many elements are in that array, and what determines the size of that array?  Are the elements of the array the individual periods between edges?  How many values are being stored in the array per execution?   We are taking the MEAN of the last 15 elements, but, not sure if we are throwing away some of the data or what.  How do I understand the composition of that array?  How can I modify the composition of that array?  Is it possible to measure only one period at a time, e.g. the time between only TWO edges?

 

2.)  Will this WHILE loop execute such that it collects one voltage value, and one "period array" (yet to be understood by me) per WHILE loop execution?  In particular we want the value of the voltage paired with the value of the MEAN of the "period array" so we can use both pieces of data to create subsequent control commands each time the two values are reported.  Will the structure in the attached vi deliver the data in pairs like that?  I want to understand that one of the READ functions does not race ahead of the other READ function in the WHILE loop.  I want the "Period Mean" and the "Strain (Volt) collected at the same rate. Will this vi do it?

 

Thanks,

Dave


Viewing all articles
Browse latest Browse all 1271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>