
ao=analogoutput('nidaq')
addchannel(ao, 0);
ch0=ao.Channel
frequency  = 500;
amplitude  = 5;
offset     = 0;
dutycycle  = 50;
sampleRate=500;
set(ao,'SampleRate',sampleRate);

%------------------------------------------------------

 

waveData =4;

set(ao, 'TriggerType', 'manual');
set(ao, 'RepeatOutput', 4000);
tic
putdata(ao, [waveData]');

start(ao);
disp('pp');
trigger(ao);
%stop(ao);

pause;

disp('1º');
stop(ao);
delete(ao);
z=0;
putdata(ao, [z]');
start(ao);
trigger(ao);
stop(ao);
delete(ao);


toc