LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample rate, sample per channel and time target

Solved!
Go to solution

Good evening, 

I am writing because I need some clarifications. 

My question is: what is the connection between the sample rate in input to the DAQmx Timing, the time target of the timing inside the while loop and the samples per channel? 
In output we have an array but I don't understand what its size should be according to the input I have. 
I hope I've been clear enough explaining my doubt. 
I attached the snippet and what I have been asked is the size array in the data indicator. 
0 Kudos
Message 1 of 7
(4,053 Views)

Fs = Sample Frequency in Samples/sec

N = Number of samples being read

T = Time to read N samples in seconds = N/Fs

 

So with the setup in the question, it will take (5 S)/(1S/sec) = 5 seconds.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(4,049 Views)

Firstly, thank you for answering.

I agree with you. 5 seconds corrisponds to 5 columns in the array. But what about the rows?

thanks in advanced

0 Kudos
Message 3 of 7
(4,041 Views)

wrote:

Firstly, thank you for answering.

I agree with you. 5 seconds corrisponds to 5 columns in the array. But what about the rows?

thanks in advanced


Ask yourself what needs to happen in order to exit the While loop.  Remember the Principle of Data Flow -- all of the functions inside the loop need to complete in order to (a) present data to the output tunnel and (b) present a True to the Stop indicator.  That will give you your answer.  [You should "work it out for yourself"].

 

Bob Schor

0 Kudos
Message 4 of 7
(4,034 Views)

Hi,

I thought about it and I got a conclusion but I am not sure about that. 

The timed loop repeats every 4 seconds but since it takes 5 seconds to have back the 5 samples, the loop must repeat twice in order to complete the task. Then it stops.

Eventually the size of the array is made of two rows. 

Let me know if I am right

Thanks again

 

0 Kudos
Message 5 of 7
(4,000 Views)
Solution
Accepted by topic author Student9520

wrote:

The timed loop repeats every 4 seconds...


No.  There is no Timed Loop in this snippet.  That function is Elapsed Time.  All it does is grab a snapshot of how much time has passed since its last reset (or first call).  So the first iteration it will state that 0 time has passed and the Boolean "Time Elapsed" will be FALSE.  That loop will take 5 seconds to complete due to the DAQmx Read reading 5 seconds worth of data.  So the next iteration, the Elapsed Time will state 5 seconds have passed.  Since this is more than the desired limit of 4 seconds, the Boolean will be TRUE and the loop will stop when that iteration is complete.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 7
(3,996 Views)

ok, I think I must get more into timing inside loops. 

I hadn't understood the meaning of the Elapsed time. 

Now I think it's clearer. 

0 Kudos
Message 7 of 7
(3,993 Views)