<< Data acquisition Data acquisition mdaqAIScan >>

MicroDAQ Support Package for Matlab/Simulink >> MicroDAQ Support Package for Matlab/Simulink > Data acquisition > mdaqAIRead

mdaqAIRead

Reads analog inputs

Calling Sequence

data = mdaqAIRead(channels, range, isDifferential)

Description

This function returns immediately acquired values from MicroDAQ input channels as a 1-by-n array of doubles. The value is stored in data, where n is the number of input channels. The channels parameter can be a scalar or vector and it should contain channels numbers according to MicroDAQ hardware configuration. The range argument specifies channel measurement input range. Matrix n-by-2 where n is number of used channels shall be provided. If 1x2 matrix is provided, the range setting will be used for all channels. The isDifferential argument specifies measurement mode - differential or single-ended. This argument can be scalar or vector (if applicable for MicroDAQ hardware configuration). If scalar provided, its value will be used for all used channels.

Input arguments

Output arguments

Examples

Read 8 single-ended channels with same channel input rage

data = mdaqAIRead(1:8, [-10,10], false);
sprintf('Acquired data: %fV\t%fV\t%fV\t%fV\t%fV\t%fV\t%fV\t%fV \n', data)

Read 4 single-ended channels with different channel input rage

NOTE: Example will work if applicable for MicroDAQ analog input configuration

data = mdaqAIRead(1:4, [-10,10; -5,5; -5,5; -10,10], false);
sprintf('Acquired data: %fV\t%fV\t%fV\t%fV\n', data)

Read 1 differential channel, 2 single-ended channels with different channel input rage

NOTE: Example will work if applicable for MicroDAQ analog input configuration

data = mdaqAIRead([1 3 4], [-10,10; -5,5; -10,10], [true false false]);
sprintf('Acquired data: %fV\t%fV\t%fV\n', data)

See Also


Report an issue
<< Data acquisition Data acquisition mdaqAIScan >>