Select and connect analog output channels
The Analog Output block allows you to select and connect specific analog output channels to your Simulink® model. After you add an Analog Output block to your model, you can enter the parameters for its I/O driver. The block outputs The following procedure uses the HUMUSOFT® AD512 I/O board as an example.
Enter a value representing how frequently you want the block to execute and interact with the I/O hardware. The block will also synchronize your model with the real-time clock at this sample rate.
Enter the number of timer ticks that your model can lag behind the real-time kernel. When the model lags by more than this number, the block reports an error and simulation stops. Otherwise, simulation continues even if some ticks are missed.
Select this check box to display the current number of missed ticks as a block output.
Select this check box to grant other programs more CPU time while the kernel waits for a response from the hardware.
Enter a channel vector that selects the analog output channels you are using on this board. The vector can be any valid MATLAB® vector form. For example, to select both analog output channels on the AD512 board, enter
[1,2] or [1:2]
If you want the input range to be different for different analog channels, you need to add an I/O block for each different input range.
Volts — Expects a value equal to the analog output voltage.
Normalized bipolar — Expects a value between -1 and +1 that is converted to the full range of the output voltage regardless of the output voltage range.
Normalized unipolar — Expects a value between 0 and +1 that is converted to the full range of the output voltage regardless of the output voltage range. For example, an analog output range of 0 to +5 volts and -5 to +5 volts would both be converted from values between 0 and +1.
Raw — Expects a value of 0 to 2n -1. For example, a 12-bit A/D converter would expect a value between 0 and 212 -1 (0 to 4095). The advantage of this method is that the expected value is an integer with no round-off errors.
Enter the initial value for each analog output channel you entered in the Output channels box. For example, if you entered [1,2] in the Output channels box, and you want an initial value of 0 volts, enter [0,0].