%$Revision 0.992b 08/21/2002 %written by: Alan Chen %contact: alanchen@mit.edu % % %AOI (AOI??) % AOI ( DATA, CHANNELS, FREQUENCY ) is a routine that interfaces the NI-DAC board % via the COMEDI library. AOI enables simultaneous input and output. % % DATA is the data matrix to be outputted by the COMEDI device. The channels are % column aligned. DATA should be voltages, in volts. % % CHANNELS is a row vector containing the enumeration of input channels to be % sampled. % % FREQUENCY is the sampling rate of the input/output signals, in Hz. % % The output of AOI is the data matrix that was sampled in the input channels (in % Volts, I think), over the same period that the output was made to the output % channels. % % Example: % % The example below will output the column [ 1 2 3 4 5 ]' and then the column % [ 6 7 8 9 0 ]' to output channels 0 through 5 at an interval of 10ms (100 Hz). % It will also acquire data in input channels 0, 1, 3, 5 at the same instances % when the output was made and the output will be a 2 by 4 array of the sampled % voltages (in volts) in those channels. % % output_data_ch1 = [ 1 2 3 4 5 ]'; % output_data_ch2 = [ 6 7 8 9 0 ]'; % input_channels = [ 0 1 3 5 ]; % frequency = 100; % input_data = aoi( [ output_data_ch1 output_data_ch2 ], input_channels, frequency); %