LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NIDAQmx read error for number of samples >1023

I have an application that I am upgrading from LV 7.1 to 8.5 and I am new to using DAQmx. I am attaching the code that seems problematic (this is just the data acquisition part). I am trying to read 1 pt from 1 ch and display this. I set up a finite acquisition outside a loop and start that acquisition. When I run this with the default number of samples/chn (1000), this seems to work fine. When I increase this number past 1023, the DAQmx read gives me a time out error. This doesn't make much sense to me. Any suggestions are much appreciated!

Thanks,
Rebecca
0 Kudos
Message 1 of 5
(2,776 Views)
You we're going to attach the code?...

It seems a bit strange that you set up your task as finite samples, single channel, single sample, and then try to acquire >1023 samples, but I will need to see the code before suggest a solution.
Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 2 of 5
(2,770 Views)
I thought I had attached this in the original, so I'll try again. To clarify, I actually want to collect 1280 samples from the channel, but just want to read and display 1 at a time for feedback purposes.
Download All
0 Kudos
Message 3 of 5
(2,765 Views)
I believe that I got this working correctly but don't totally understand it. I followed instructions in the following: http://digital.ni.com/public.nsf/allkb/5C9D0AEFAE8EA81486256DCF00788B2F

It appears that since I am running this application with a PCMCIA card, that there is a default setting when using NIDAQmx that doesn't release the data to the buffer until the FIFO is half full (this would be 2048/2 in my case as I have a 6024E). So, when I change this channel setting to release when FIFO is not empty, I no longer get a timeout error. I am still not sure why I don't get the error with a smaller number of samples/channel. I am always suspicious of an answer I don't fully understand!

Thanks,
Rebecca
0 Kudos
Message 4 of 5
(2,760 Views)
Ah well, if you got it working there's no need to fix it! Well done.

Why does it work? DAQmx automatically determines the buffer size.
Perhaps below 1024 (1K) samples it just assigns what you've asked for, then above that it reserves larger chunks.

I guess you found the point where it changes over.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 5 of 5
(2,758 Views)