05-21-2008 04:37 PM
I am using a NI- 6229 usb device and have written a C# dll that is used in Labview and Measurment Studio applications for SPI communications. It works most of the time yet i get the following message and have not found a root cause for the problem . I have included the code snipet below where the offending reading is going on. Any suggestions are welcome
An unhandled
exception of type 'NationalInstruments.DAQmx.DaqException' occurred in
NationalInstruments.DAQmx.dll
Additional
information: Measurements: Some or all of the samples requested have not yet
been acquired.
To wait for the
samples to become available use a longer read timeout or read later in your
program. To make the samples available sooner, increase the sample rate. If your
task uses a start trigger, make sure that your start trigger is configured
correctly. It is also possible that you configured the task for external timing,
and no clock was supplied. If this is the case, supply an external
clock.
Property: NationalInstruments.DAQmx.DaqStream.ReadRelativeTo
Corresponding Value: NationalInstruments.DAQmx.ReadRelativeTo.CurrentReadPosition
Property: NationalInstruments.DAQmx.DaqStream.ReadOffset
Corresponding Value:
Task Name: MISOTask
Status Code: -200284
05-22-2008 01:45 PM
Hi and sorry about the frustrations this may be causing,
The error your getting is generally due to a timeout at the DAQmx Read function. Either the number of samples that it expects to receive was never achieved during the time out specified (which looks to be infinite) or the external clock was never supplied. Looking at your code, I think the latter is the case.
Try configuring and starting the counter pulse train before the MISO and MOSI tasks are started or set up a digital start trigger for both MISO and MOSI to begin when the counter task begin. You're probably getting the error during the short, non deterministic, amount of time between starting the two tasks which rely on the ctr0internaloutput for a clock and the counter being setup and outputting said clock.
See if that works for you.