08-11-2009 10:16 PM
Hi LabGurus
I am trying to synthesize an SPI signal on buffered Digital output lines usin an M-Seried USB Daq (6225, 6229).
I have written most of the code and have come up with the following problems:
When I use "finite samples" for clock mode, the waveform it is limited to the size of the onboard buffer. There is no error given but the output waveform is truncated suspiciously to 1027 states. The nidaq buffer is fixed and changing the onboard buffer has no effect.
When I use continuous samples, There is no way of detecting when the task has "Actually" completed (I can identify when the last set of data is transferred to the device but not when it has been clocked out of the device).
"Daqmx Is task done" and "Daqmx Wait for completion" give no insight.
I detect when the last USB device transfer has completed using a Dqmx write property node and comparing "total samples written" to "Current Write Position"
The function works provided that I allow enough time for the task to complete. In pactice a fixed delay this is not acceptable.
Solved! Go to Solution.
08-12-2009 01:03 AM
Added test code (LV8.6)
Kind regards,
08-12-2009 02:18 AM
At the risk of talking to myself in a forum.....
Further investigation:
The "Continuous" method is a red herring, it ignores the "No regeneration" property making it unsuitable.
There is no way to detect it's completetion because it never completes.
The Finite samples method has a limit somewhere between 1400 and 1470 samples
Kind regards,
08-12-2009 06:14 PM
Timmar,
For the finite method, have you tried changing the value of 'samples per channel' on the DAQmx Timing VI? This is what you need to set so your task knows how many points to expect to output. The default value is 1000. I hope this helps.
Regards,
Brian T
Applications Engineer
08-12-2009 06:56 PM
Brian,
An obvious, correct answer, Perhaps an amateurs mistake on my behalf.
Sometimes you just need to be hit in the face with it.
My inteded use of this function was to start the task and then write variable length data to it as required.
My modified code now measures the data length, sets the data length property node (a double?, the VI is an integer) and then writes to the output.
Thanks again,
Tim L.