multiple Hwdigital triggers to analog output NI device
2 次查看(过去 30 天)
显示 更早的评论
I would like to synchronize my board (NI, DAQMX driver) with an external device. This device sends a TTL each ~5msec, and I would like the board to receive this TTL and send an analog output data (getting a HWDigital trigger). After finishing this sending, the board should wait for another trigger and do the same procedure. However, I didn't find how it can be done in Matlab - the board may get only one trigger and queueing the data once again requires long time (~60msec, and I have 5msec). Does anyone know if it's possible to get the board to respond to multiple triggers? Thanks!
0 个评论
回答(2 个)
sebincicco Incicco
2012-3-30
hi, if i understand your problem i think that should be do set(ai,'TriggerRepeat',Inf)...
0 个评论
Manisha
2012-3-30
Hi Hod Dana,
If you are using session based interface and MATLAB 2012a, you can use the addTriggerConnection and TriggersPerRun command.
Your code will look something like this:
s = daq.createSession('ni');
s.addAnalogOutputChannel('Dev4', 1, 'Voltage');
% Add a external start trigger
s.addTriggerConnection('external','Dev4/PFI0','StartTrigger')
% queue the data you want to output. This data will be repeated each
% time you get a trigger.
s.queueOutputData([1:10]');
% Set Triggers per run to be how many times you want the channel
% to run.
s.TriggersPerRun = 7;
s.startForeground;
Hope this helps,
Manisha
0 个评论
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!