LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

daqmx Available Samples Per Channel not zero

Solved!
Go to solution

cDAQ 9178

When you monitor the Available Samples Per Channel in the DAQmx Read and it is not zero what does it mean? Does it mean samples were available that didn't get read? Sampling at 10,000 hz and taking 2000 samples per channel. The loop should run at 200 ms and there should be zero samples available to read, correct? I am seeing available samples using a simulated chassis and modules. I haven't tried reading this on the actual hardware, don't know if that matters.

0 Kudos
Message 1 of 19
(3,132 Views)

Hi bassin,

 

which VI are you using?

Which values do you read?

 

(And I'm sure it matters in this case that you use a simulated target…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 19
(3,130 Views)

1. Simulated devices help a lot for checking viability of various DAQmx config options and function calls.  They should *not* be expected to represent real device behavior in terms of i/o signals, timing, triggering, buffer status, etc.

 

2. Are you querying for # available samples *after* doing the read?  At 10 kHz, the finite execution time spent delivering the 2000 samples followed by the property query is enough that a few new samples really *will* have been buffered since the driver noticed that it could satisfy the request for 2000.

   Again, I wouldn't pay too much attention to the simulated device behavior, but a real device is liable to show a few samples available again already under the same conditions.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 3 of 19
(3,103 Views)

I am using a DAQmx Read property Node to get Available Samples per Channel. I have a DAQ program that has been running a few months. I was making a change to it with simulated chassis and modules and put in the property node because I was doing a lot of processing and thought this would tell me if the program was missing samples.

0 Kudos
Message 4 of 19
(3,094 Views)

If you are sampling within the specifications of your hardware, and you have written the code properly, you should not need to "worry" about missing samples -- the DAQ device will "do what you tell it to do", and if you program it correctly, no samples will be lost.

 

I hope you noticed the caveats in the previous sentence (the first one is underlined).  We can't tell if you have programmed the device properly because you didn't attach your code.  Note that it is possible to miss data if you don't understand how to work with DAQmx ...

 

Bob Schor

0 Kudos
Message 5 of 19
(3,090 Views)

Thanks for you reply. I can't attach my code as this is a large program and company rules. I produce the data, log the data and queue the data in a producer loop. In that loop, I was just trying to understand why I see available samples per channel. What they actually mean.

0 Kudos
Message 6 of 19
(3,084 Views)
Solution
Accepted by topic author bassinbc

I finally found the answer. Thanks,

 

Buffer Monitoring with DAQmx Property Nodes
During continuous, buffered acquisition, the buffer can be monitored to gain more information about how the current configuration affects the buffer. If the number of available elements continuously increases during the acquisition, take one of the actions listed above to avoid eventually overflowing the buffer. To monitor the amount of data available in the buffer, use a DAQmx Read property node to read the Status: Available Samples Per Channel property.

0 Kudos
Message 7 of 19
(3,043 Views)

So now I'm newly intrigued because I don't see how the most recent post that you marked as a solution does much to address your original question.   It basically just suggests that you query the property that you were already querying when you first posed your question.

 

Fill us in -- what did you learn and how is it helping?

 

 

- Kevin P, curious

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 8 of 19
(3,013 Views)

Original question was (When you monitor the Available Samples Per Channel in the DAQmx Read and it is not zero what does it mean? Does it mean samples were available that didn't get read?

answer:

During continuous, buffered acquisition, the buffer can be monitored to gain more information about how the current configuration affects the buffer. If the number of available elements continuously increases during the acquisition, take one of the actions listed above to avoid eventually overflowing the buffer.

 

So the buffer will fill up and overflow if the number of elements continuously increases during the acquisition.

What don't you get?

0 Kudos
Message 9 of 19
(2,966 Views)

It's maybe just semantics now, but to clarify my sort-of puzzlement:

 

- the original question asked what it means when the # available samples is non-zero

- the tagged solution describes what it means when the # available samples is continuously increasing

- my earlier attempt at an answer tried to address what it might mean when there's a regularly a small # available samples that isn't continuously increasing

 

This stuff isn't entirely unrelated or anything, there's just different nuances that (in my mind) implied different worries being addressed.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 10 of 19
(2,956 Views)