Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

how to minimize the delay of triggered output

Solved!
Go to solution

The delay ~ 1ms is allowable. With DAQ toolbox in Matlab, the problem is some triggers are missed during executing the code to display patterns onto 2nd monitor (my task is displaying patterns on 2nd monitor, but I used analog output functions to test the delay). Thank you so much!

0 Kudos
Message 11 of 18
(1,784 Views)

What does the trigger signal look like?  How fast are the pulses coming in?  How wide are the pulses?  Is it absolutely critical that you do not miss a trigger?

 

Also, once you start generating a signal, do you need to generate that signal constantly until another trigger comes in?  Or do you generate a finite waveform when wait for another trigger?  If it's finite, how long is the signal (seconds, milliseconds, etc.)?

Cody A.
0 Kudos
Message 12 of 18
(1,778 Views)

The trigger is ~5 Hz, similar to square wave with steep edges. Yes, it is critical not to miss any trigger. Currently, with Matlab, the missed trigger number is random, so I assume it is related to the software fluctuation.

 

Once a trigger comes in, the display on the 2nd monitor should be swtiched to a new pattern and maintain it till next trigger comes in.

0 Kudos
Message 13 of 18
(1,776 Views)

Given those requirements, the absolute best solution would be to do this with an FPGA device, such as an R Series card.  If you absolutely cannot switch hardware, then using the counter input, as you are currently doing, might work, but will have much higher latency and jitter due to the reliance on software.  If the performance of the system in this configuration is not adequate, since your 6111 does not support digital change detection, your only recourse would be alternative hardware.

 

However, you may get fewer missed triggers by parallelizing the counter monitoring code and analog output code in separate loops.  I can provide a quick LabVIEW example if you'd like, but am not familiar enough with MATLAB to provide much guidance there.

Cody A.
0 Kudos
Message 14 of 18
(1,774 Views)

Thanks a lot, Cody,

 

We do not have spare FPGA at the moment. Maybe try the PCI card first.

 

Yes, please help to provide an example for parallelizing running. Thank you so much!

 

Confu

0 Kudos
Message 15 of 18
(1,771 Views)
Solution
Accepted by confu

Not sure that this will get the rates you need, but I think it's probably the best way to go about trying since you cannot switch devices.  You may also get better performance by using a notifier to transfer data between loops instead of a local variable.

 

Different AO for Even and Odd Triggers.png

Cody A.
0 Kudos
Message 16 of 18
(1,759 Views)

Thanks so much. I would like to try it. Could you please share the VI file?

0 Kudos
Message 17 of 18
(1,753 Views)

The screenshot above is a snippet.  You can just drag the image directly to your block diagram and it will generate the code.

Cody A.
0 Kudos
Message 18 of 18
(1,751 Views)