LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I detect when a correlated Digital output write has completed

Solved!
Go to solution

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.

 

 

 

 

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 1 of 5
(2,764 Views)

Added test code (LV8.6)

 

Kind regards,

 

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 2 of 5
(2,748 Views)

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,

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 3 of 5
(2,741 Views)
Solution
Accepted by topic author Timmar

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

 

 

0 Kudos
Message 4 of 5
(2,718 Views)

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.

 

 

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 5 of 5
(2,710 Views)