Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

CLAD DAQ question

Solved!
Go to solution
Hello, Can someone please help me understand this CLAD question. Image attached. How is sample rate and elapsed time effecting the DAQ capture? Awaiting reply! Thank you.
0 Kudos
Message 1 of 11
(4,740 Views)
Solution
Accepted by topic author De_V

Time to acquire X samples = sample rate * X

 

That is the heart of the question.  The Elapsed Time is just being used as a stop condition.  The purpose of this question is to understand now many times the loop will iterate based on how much time it takes to read that 5 samples at 1Hz (hint: 5 seconds).  So I would expect this loop to iterate 2 times (elapsed times will be 0 and 5).


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
Message 2 of 11
(4,730 Views)
Thank you!
0 Kudos
Message 3 of 11
(4,707 Views)

I am new to labview. And also confused by the question.  Can you explain more detail why the loop will iterate 2 times ?  

why Elapsed Time is 0 and 5?

0 Kudos
Message 4 of 11
(4,643 Views)

YOUKAIYK wrote:

why Elapsed Time is 0 and 5?


Data Flow.  The checking the time and the reading of the DAQ data have no data dependency.  Therefore they will happen in parallel.  It can be safe to then assume the Elapsed Time will run as soon as the loop iterates.


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 5 of 11
(4,634 Views)

For the same question asked by De_V ,  I changed elapsed time to 5 and got the array size as 3 rows and 5 columns which is wrong as per your explanation....Please help me with this

0 Kudos
Message 6 of 11
(4,550 Views)

An alternate situation popped in my mind. 

 

What if my TASK in this question had 3 channels to be read ?


1) In the second Iteration of the while loop will the Read DAQmx vi read the next channel ?

 

If yes then I expect the loop to Stop after the second channel has been read  and thus will still have 2 rows 5 columns in Data indicator but this time the 2 rows belong to 2 different channels.  

 

Is this reasoning right or am I doing something wrong here ?

 

Thanks in advance.

0 Kudos
Message 7 of 11
(4,071 Views)

@DeXteR_INIT wrote:

What if my TASK in this question had 3 channels to be read ?


1) In the second Iteration of the while loop will the Read DAQmx vi read the next channel ?


No.  In fact, you will get an error (-200523 Read cannot be performed because this version of DAQmx Read only returns data from a single channel, and there are multiple channels in the task.).  So you have to change the DAQmx Read to be Multiple Channels-Multiple Samples.  And this will actually give you a 3D array as an output if you leave the output tunnel as indexing.  You will keep the 2D array if you change the tunnel type to be Concatenating.


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 8 of 11
(4,068 Views)

@VinuY wrote:

For the same question asked by De_V ,  I changed elapsed time to 5 and got the array size as 3 rows and 5 columns which is wrong as per your explanation....Please help me with this


Don't remember seeing this post before, but I feel like I need to answer it anyways.

 

This is not surprising to me.  The task is started before the loop even starts.  So it is not unreasonable to think that a sample has been taken before that loop even begins.  So that first 5 seconds has started before we even start the timer.  If you look at your actual Elapsed Times, you will likely see something like 0, 4.99089, 9.9577 (actual values from a test I just ran).


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
Message 9 of 11
(4,067 Views)

Yes, I totally overlooked I would have to configure the DAQmx Read to be able to read Multiple Ch and Samples. Thanks. 

So provided I do that, and have the output tunnel indexed, the 3D array I obtain will have have a dimension of (3(R),5(C),2(P)) where each Page of my array has data from each iteration, 1 row for each channel and 5 samples.

 

Instead if I keep the terminal as Concatenated the 2D array would have a dimension of (6(R),5(C)).

Sorry, I know I can verify this in Labview but I am taking CLAD next week so trying to think my way through it.

 

Thanks 

0 Kudos
Message 10 of 11
(4,058 Views)