LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

do i have the buffer in the right place

Solved!
Go to solution

I need to know if i have the buffer in the right place. I am not getting the right buffer size when i use it on another vi.

0 Kudos
Message 1 of 30
(2,857 Views)

Since you are using Continuous Samples, get rid of the set buffer size and leave the Sample Per Channel on the DAQmx Timing unwired.  The buffer will default to way more than you will need.


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 30
(2,838 Views)

So are you saying for me to get the exact number of samples I need i need to use the finite mode.

0 Kudos
Message 3 of 30
(2,831 Views)

No.  For your DAQmx Read, you tell it how many samples to get.  It the buffer doesn't have that many samples yet, then the function waits until that many samples are available.  Otherwise it just returns the number of samples you requested.  If you are getting a buffer overflow error, then you are either sampling too fast or you are not performing the reads fast enough.

 

Here's what my setup will typically look like.


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 4 of 30
(2,819 Views)

Where would you put how many numbers of samples you want at because when i put it in number of samples i get this error message.

 

Some or all of the samples requested have not yet been acquired.

To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger, make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.

Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<254>

0 Kudos
Message 5 of 30
(2,812 Views)

I also get this one when i put it in sample rate.

 

Specified sample rate is higher than the fastest rate supported by the device.

Property: SampClk.Rate
Requested Value: 324.0e3
Corresponding Value: 325.203252e3

Maximum Value: 250.0e3

Device: cDAQ1

Task Name: _unnamedTask<257>

0 Kudos
Message 6 of 30
(2,811 Views)

@reggie2016 wrote:

I also get this one when i put it in sample rate.

 

Specified sample rate is higher than the fastest rate supported by the device.

Property: SampClk.Rate
Requested Value: 324.0e3
Corresponding Value: 325.203252e3

Maximum Value: 250.0e3

Device: cDAQ1

Task Name: _unnamedTask<257>


Well that one is obvious.  Your DAQ board can only sample at 250kS/s.  You tried to sample at a higher rate (324kS/s).


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 7 of 30
(2,797 Views)

@reggie2016 wrote:

Where would you put how many numbers of samples you want at because when i put it in number of samples i get this error message.

 

Some or all of the samples requested have not yet been acquired.

To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger, make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.

Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<254>


What did you set the timeout for the DAQmx Read to?  What are your other settings?  What DAQ are you trying to read from?


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 30
(2,796 Views)

I was using 10 seconds for timeout.4000 sample rate. 324000 samples. I am trying to use NI Daq 9205 to acquire this data.

0 Kudos
Message 9 of 30
(2,750 Views)

@reggie2016 wrote:

I was using 10 seconds for timeout.4000 sample rate. 324000 samples. I am trying to use NI Daq 9205 to acquire this data.


Your math seems off.

10 seconds will give you 40,000 samples so you are indeed timing out before collecting 324,000.

0 Kudos
Message 10 of 30
(2,742 Views)