multiple Hwdigital triggers to analog output NI device
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (2)
sebincicco Incicco
el 30 de Mzo. de 2012
hi, if i understand your problem i think that should be do set(ai,'TriggerRepeat',Inf)...
0 comentarios
Manisha
el 30 de Mzo. de 2012
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 comentarios
Ver también
Categorías
Más información sobre Data Acquisition Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!