LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

slow abnormal sample frequency

Hello everyone.

 

I am a student and as part of an internship in a company I have to create a LabVIEW program to carry out certain measurements. I'm using a cDAQ 9184 and two NI 9219 boards. I'm making 4 separate measurements, 3 of which are of voltage and one of current. However, I have a problem. During data acquisition, I observe a very low sampling frequency.

I've tried to solve the problem in various ways: I've tried using the timing function, property nodes to force a high acquisition frequency, executing the while loop with only the read function, testing the read function with more or less sampl or chanel, but nothing seems to work. I'm even wondering if the problem isn't with the cards used for acquisition.

 

Is there anyone who has already encountered this kind of problem and/or has an idea of how to solve it?

 

Thank you in advance for your time.

0 Kudos
Message 1 of 8
(1,008 Views)

Hi Ziprat,

 


@Ziprat wrote:

However, I have a problem. During data acquisition, I observe a very low sampling frequency.


Please define "very low sample frequency". And please define your requirement/expectation…

I guess you know about this part of the NI9219 specs:

 

Mind to downconvert the VI to LV2019?

Best regards,
GerdW


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

Hi GerdW

 

Thanks for your fast answer.

 

By low sample frequency i mean that the while loop seems to take between 600ms and 400ms to do one iteration even thoe i am not asking for a high-resolution sample. I also have no thermocouple connected to the NI 9219.

I can try to convert it but i only have a licence for LabVIEW 2020 sp1.

 

Best regards, 

Ziprat

0 Kudos
Message 3 of 8
(983 Views)

Here is the Lv 2019 version.

0 Kudos
Message 4 of 8
(968 Views)

Hi Ziprat,

 


@Ziprat wrote:

By low sample frequency i mean that the while loop seems to take between 600ms and 400ms to do one iteration even thoe i am not asking for a high-resolution sample.


Your acquisition loop is very "overloaded" with several Rube-Goldberg constructs…

 

Several suggestions:

  • use parallel loops to read from your channels and modules
  • define a DAQmx task including a samplerate and continuous mode using DAQmxTiming
  • check the loop iterations with this task for one channel
  • cleanup your code: use a 2D array instead of 5 1D arrays to hold your data
  • use DeleteFromArray to get the last element of an array instead of ArraySize, "-1", and IndexArray…

See this suggestion:

You may even apply a scale to the DAQmx channel so you don't need scale the readings afterwards…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 8
(960 Views)

Hi GerdW

 

Thanks for your solution proposition .

 

I have tried it and it works well on one/ two while loops. But then with more of them i encounter a synchronisation problem. One read is trying to reserved the device before the other one unreserved it.

I have tried making them wait for the device to be free before trying to read data but i am then having once again a slow sample rate.

 

0 Kudos
Message 6 of 8
(905 Views)

Hi Ziprat,

 


@Ziprat wrote:

I have tried it and it works well on one/ two while loops. But then with more of them i encounter a synchronisation problem. One read is trying to reserved the device before the other one unreserved it.

I have tried making them wait for the device to be free before trying to read data but i am then having once again a slow sample rate.


While the NI9219 uses 4 simultanuous channels it seems there are not enough simultanuous timing sources...

 

So what happens when you read all channels within one task, with sample rate set, continuous mode amd high-speed mode for all channels?

Best regards,
GerdW


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

You've set "Fréquence d'échantillonage (ms)" to 1000ms, so i expect it to only sample once/sec.

What you usually do it set up a DAQ-task with a sampling frequency and then simply read 1 or 100 samples at once and it'll wait for the hardware.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 8
(888 Views)