Borrar filtros
Borrar filtros

Repeat outputs with analogoutput without requiering to use putdata repetadly

1 visualización (últimos 30 días)
Hi all!
I've got my analogoutput channel working as I want. When it receives a digital trigger on line PFI1 it starts the function that I loaded.
ao_Ref = analogoutput('nidaq','Dev1');
addchannel(ao_Ref, [1]);
set(ao_Ref,'TriggerType','HwDigital')
set(ao_Ref,'HwDigitalTriggerSource','PFI1');
putdata(ao_Ref, xt);
start(ao_Ref)
However once its started (and finished) the "buffer" on the nidaq card is empty. Triggering again doesn't do anything. Currently, I need to reload the data on the card by repeating the whole code.
Surely there is a much more efficient way to make it output the same data every time the trigger is activated.
Thanks,
Michael

Respuesta aceptada

Walter Roberson
Walter Roberson el 22 de Sept. de 2011
No there isn't, not unless your hardware supports storing a buffer of data and sending the buffer on request. Which some hardware does, but most does not.
  4 comentarios
Walter Roberson
Walter Roberson el 26 de Sept. de 2011
I would need to research that; I am not familiar with how to program those devices, such as to construct the waveform buffer.
Which model device are you using?
Michael Leung
Michael Leung el 9 de Nov. de 2011
NI 6259.
I never managed to get it to work, so I moved this part of the code to a micro controller.

Iniciar sesión para comentar.

Más respuestas (2)

Manisha
Manisha el 26 de Sept. de 2011
Hi Micheal,
Have you looked at the property TriggerRepeat?
Regards, Manisha
  2 comentarios
Michael Leung
Michael Leung el 26 de Sept. de 2011
No, I have not. I was hoping that something like this would exist. I'm getting an error message now.
(I placed this line of code after the HwDigitalTriggerSource)
??? Error using ==> daqdevice.set at 261
Invalid property: 'TriggerRepeat'.
Error in ==> Ramp at 26
set(ao_Ref,'TriggerRepeat',10)
Michael Leung
Michael Leung el 26 de Sept. de 2011
http://www.mathworks.com/help/toolbox/daq/ref/triggerrepeat.html
Hmm it seems its only applicable to AI (Analog Input) channels.
I'd need it for Analog Output

Iniciar sesión para comentar.


signal
signal el 9 de Nov. de 2011
set(ao_Ref,'RepeatOutput',num)
where num is an integer or inf for continuous output.

Categorías

Más información sobre Call Web Services from MATLAB Using HTTP en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by