How Quickly Can I trigger a device using the DAQ Session interface with Triggers_per_run=inf
2 views (last 30 days)
Show older comments
In my lab I am using an NI-6733 analog out card. I need it to output the same waveform every time it receives an external trigger, which I send it 5 times a second, all day every day. Currently I can achieve this by creating a session interface with the card, adding channels and triggers, setting to finite mode but with triggers_per_run set to inf, as shown below.
However, I find that the card does not always catch the trigger, and that its ability to do so depends on how much space there is between the end of the data and the next trigger. Right now, I leave 100ms, which is way way way more than enough as far as the card's hardware is concerned, but I still obtain flaky results, as in 1/50 triggers are dropped.
Can anyone tell me how it is that matlab implements this triggers_per_run = inf functionality, and whether there is any associated setup time before a new trigger?
s = daq.createSession('ni');
s.addAnalogOutputChannel('Dev1', 'ao1', 'voltage');
s.addTriggerConnection('external','Dev1/PFI6','StartTrigger');
s.IsContinuous = false;
s.Rate = 1000000; %1MHz is the card's max capability
s.TriggersPerRun = Inf;
s.ExternalTriggerTimeout = 200;
s.queueOutputData(v);
s.startBackground();
1 Comment
Walter Roberson
on 27 Jun 2013
Have you taken steps to ensure that nothing else runs on the system? Virus checking turned off?
Your interrupt service routines: have you gone through them with an eye to reducing any dynamic memory allocations?
Answers (0)
See Also
Categories
Find more on Periodic Waveform Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!