LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read more often.

Will reading more often avoid buffer overflow error?

 

Does the attached code solve the problem?

 

Anyone please help.

0 Kudos
Message 1 of 6
(2,747 Views)

What do you "Read more often"? Do not use build array like this, it may lead to memory leak. Try to initialize the array and use the "Replace array" primitive. 

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 6
(2,740 Views)

Hi kdm,

 

you get a buffer overflow when you don't fetch new data fast enough…

 

- Calling DAQmxRead 10 times in a row is just a cumbersome workaround - and a RubeGoldbergish one too: use a FOR loop for repeated tasks!

- It's not important to call DAQmxRead 10 times in a row, but to call this code snippet on a regular basis.

- You might try to read data blocks of defined size, it is recommended to fetch blocks of 1/10 of the samplerate…

Best regards,
GerdW


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

Hi GerdW,

 

I also need to get data column wise.

 

PS. I am actually documenting this code, so can you tell me what this code does?

0 Kudos
Message 4 of 6
(2,726 Views)

Hi kdm,

 

you can get data "columnwise" even when you would use a loop…

 

I already told you what the code does: it calls DAQmxRead 10 times in a row, trying to read 25 samples with each call. I don't know why this should be better than just reading 250 samples with one call…

Best regards,
GerdW


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

Please don't start a new thread for the same problem

http://forums.ni.com/t5/LabVIEW/Read-from-channels/m-p/2902140#U2902140


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 6 of 6
(2,701 Views)