LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cDAQmx analog input gets slower and slower

Dear

 

I have a CDAQmx with four sloty. In one slot is a 24bit alaog input card NI9209.

I tried to measure continously a chunk of 100 samples witha sample rate ov 1000Hz.

My main consumer starts the measurement and ma ADC consumer shall do the measurement.

So far so well.

It performs like expected.

Caling the ADC consumer from my Main consumer to fetch actual data works to.

What happens is tzhat the ADC consumer gets slower and slowe all the time.

Has anyone of you a idea why thia happens?

 

Best regards

Martin

 

0 Kudos
Message 1 of 25
(2,144 Views)

Hi Martin,

 


@Martin_Kunze wrote:

Caling the ADC consumer from my Main consumer to fetch actual data works to.

What happens is tzhat the ADC consumer gets slower and slowe all the time.

Has anyone of you a idea why thia happens?


Why do you need to initialize the task each time and why do you need to kill the task each time?

Is there a reason to use a "Finite samples" setting when you want to read more then 100 samples?

 

Btw. are you sure you are reading 100 samples when you just use the mean of the samples you read? To read exactly 100 samples you should request exactly 100 samples from DAQmxRead…

Best regards,
GerdW


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

Hi GerdW

 

Thank you for the hint.

I measure now with a simpler attempt and fetch 100 saples from the read vi.

I do this 20 times.

repeat the measurment with the expectation to get always the same values.

That works two or three times and that the first value is bad.

The card measures 10.4V while it should measure 120mV.

Later the secound value is 10,4V too and so on.

This is is not explainable because the relais that lead the voltage to the AI are working fine and the clamp voltage at the NI card is correct at measurement time.

It looks linke somehow there are samples avvumelated after the end of measurement and with a new call the wrong values are read in.

Does a possibility exist to erase the internal cDAQ chassi or PC internal buffer?

 

Regards

 

Martin

0 Kudos
Message 3 of 25
(2,122 Views)

Hi Martin,

 


@Martin_Kunze wrote:

I measure now with a simpler attempt and fetch 100 saples from the read vi.

I do this 20 times.

repeat the measurment with the expectation to get always the same values.

That works two or three times and that the first value is bad.

Does a possibility exist to erase the internal cDAQ chassi or PC internal buffer?


Mind to attach your current "simpler attempt" so we know what you are talking about?

To erase any buffers you can:

  • read all samples (which should be done for a continuous measurement)
  • kill the task and create a new one (which you did before)

Again: attach your code!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 25
(2,117 Views)
0 Kudos
Message 5 of 25
(2,113 Views)

Hi Gerd

 

these are the results.

Two times I get the correct value and that the first value is wrong and will be further wrong.

Later the secound value will be wrong too and so on.

0 Kudos
Message 6 of 25
(2,111 Views)

Hi Martin,

 


@Martin_Kunze wrote:

these are the results.

Two times I get the correct value and that the first value is wrong and will be further wrong.

Later the secound value will be wrong too and so on.


These numbers are meaningless to us as we don't know nothing about your DUT or the way you setup your measurement parameters…

 

Problems with your VI:

  • Why do you wire an empty string for user scale?
  • Now you set your task to read at 10kS/s, while before you used just 1kS/s...
  • It doesn't make sense to use "continuous measurement" as long as you start and kill that task each time...
  • Last, but not least: have you read the manual of your device? Did you take care of its abilities and limits? (Hint: possible sample rate, especially in HighRes mode...)
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 25
(2,100 Views)

Hi Gerd,

 

the AI card can sample with more than 10K in high res mode.

To clear up a little bit...

The 10k sample rate worked always fine.

1k samples also.

As long as the values at the AI pin don't chnge the reault is always the same.

I will go back 10 finite samples and read out all samples using -1 at the read function.

Reduce the sample rate to 1k and the samples to 100.

Let's see. Ithink that nothing will change

 

I simply wont to measure 100 samples on demand.

This is it and I don't understand where the failure is comming from.

Can you correct my VI so that is does exactly what I want and nothing more?

 

Regards

 

Martin

0 Kudos
Message 8 of 25
(2,091 Views)

Hi Gerd,

 

I have tried the recent version on the target and it's just the same.

The first 10 measurements are correct and the eleventh and so on are wrong.

0 Kudos
Message 9 of 25
(2,086 Views)

Have you tried using MAX or one of the shipping examples for voltage measurement to help troubleshoot?  If not, you should.

 

To be blunt: over the years on these forums, I've learned to start with a bit of skepticism about posters' self-diagnosis of their problems.  A pretty significant majority of the time, the answer comes down to, "you're doing it wrong".  The user's code, approach, or assumptions are flawed somewhere, not LabVIEW, DAQmx, or DAQ hardware.  There are exceptions, but they're pretty rare.

 

MAX and the shipping examples have been tested out pretty thoroughly.  If you get expected results there but not with your own code, well, probably "you're doing it wrong" somewhere.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 10 of 25
(2,065 Views)