07-26-2016 11:40 AM
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!
07-26-2016 12:04 PM
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.)?
07-26-2016 12:18 PM
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.
07-26-2016 01:59 PM
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.
07-26-2016 04:44 PM
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
07-27-2016 03:15 PM
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.
07-27-2016 03:27 PM
Thanks so much. I would like to try it. Could you please share the VI file?
07-27-2016 03:37 PM
The screenshot above is a snippet. You can just drag the image directly to your block diagram and it will generate the code.