clear;
clf;
figure(1);

%%% Get the devices you have plugged in, assume only using one device
d = daq.getDevices;  
d = d(1);

s = daq.createSession('digilent');                 %%% Start the session for Digilent hardware
s.Rate = 100;                                      %%% Set the sample rate
s.DurationInSeconds = 60;                          %%% Set the duration of the experiment

s.addAnalogInputChannel(d.ID, 1, 'Voltage');       %%% Add channel 1 
s.Channels(1).Range = [-2.5 2.5];                  %%% Set input range for channel 1

s.addAnalogInputChannel(d.ID, 2, 'Voltage');       %%% Add channel 2
s.Channels(2).Range = [-2.5 2.5];                  %%% Set input range for channel 2

%%% Print session information to confirm properties 
s

[data, time] = s.startForeground;   %%% Start acquiring the data, will run until complete 
plot(time, data);
xlabel('Time (s)');
ylabel('Voltage (V)');
