function DAQStrain(Vao)

figure(1); clf; daqreset;

%%% parameters for the experiment
sample_rate = 1000;  
plot_duration = 1;   %% how frequent to plot
exp_duration = 5;   %% how long to collect data for

%%% Set up the parameters to acquire the data
AI = analoginput('nidaq','Brian');    
chan = addchannel(AI,[0]);
set(AI,'SampleRate',sample_rate);
set(AI,'SamplesPerTrigger',inf);
set(AI.Channel(1),'InputRange',[-1 1]);


%%% analogoutput configuration
AO = analogoutput('nidaq','Brian');
addchannel(AO,[0 ]);
putsample(AO,Vao);


start(AI);

DATA  = []; Vs = [];TIME = [];    %% for storing all the data
for i =1:ceil(exp_duration/plot_duration)
    
    while AI.SamplesAvailable < sample_rate*plot_duration   %% wait until enough data
    end 
    [data time] = getdata(AI,(sample_rate*plot_duration));  %% get the dataa

    %%% save all the data, 
    if (i== 1)
        DATA = data; TIME = time;
    else
        DATA = [DATA;data]; TIME = [TIME;time];
    end   
    
     plot(TIME,DATA);  xlabel('t (sec)'); ylabel('V (Volts)');

     drawnow;
end


delete(AI);
clear AI;