07-03-2014 05:45 AM
Will reading more often avoid buffer overflow error?
Does the attached code solve the problem?
Anyone please help.
07-03-2014 05:54 AM
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.
07-03-2014 05:57 AM - edited 07-03-2014 05:58 AM
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…
07-03-2014 06:15 AM
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?
07-03-2014 06:16 AM - edited 07-03-2014 06:18 AM
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…
07-03-2014 07:31 AM
Please don't start a new thread for the same problem
http://forums.ni.com/t5/LabVIEW/Read-from-channels/m-p/2902140#U2902140