Read from one or multiple analog input channels
Connect to and read from specific analog input channels from your Simulink® model. After you add an Analog Input block to your model, you can enter the parameters for its I/O driver.
Analog Data— Analog-to-digital converter data read from input channels
Result of A/D conversion of an analog signal. The data type and range of the output value depend on the capabilities of the board.
Input channels— Select analog input channels
1(default) | vector
Enter a channel vector that selects the analog input channels that you are using on this board. The vector can be any valid MATLAB® vector form. For example, to select eight contiguous analog input channels, enter:
To select the first three analog input channels, enter:
Input range— Input range of analog inputs
From the list, select the input range for the analog input channels that you entered for the
Input channels parameter. For example, if the board
has an input range of
±5 V, select
to 5 V.
If you want a different input range for different analog channels, add an I/O block for each different input range. The valid values depend upon the capabilities of the board.
Block output signal— Value type returned from block
From the list, select from the following options:
Volts — Returns
a value equal to the analog voltage.
Normalized bipolar —
Returns a full range value of -
of the input voltage range.
Normalized unipolar —
Returns a full range value of
of the input voltage range. For example, analog input ranges of
+5 volts and of
+5 volts are converted to
Raw — Returns a
For example, a 12-bit A/D converter returns values from
212 -1 (
The advantage of this method is that the returned value is an integer
with no round-off errors.