Real-Time Windows Target    

Digital Output Block

The Real-Time Windows Target I/O blocks allow you to select and connect specific digital lines or digital channels to your Simulink model.

After you have added and Digital Output block to your Simulink model, you can enter the parameters for this I/O driver. This procedure uses Humusoft's AD512 I/O board as an example:

  1. Double-click the Digital Output block.
  1. The Block Parameters: Digital Output dialog box opens.

  1. In the Sample time box, enter the same value you entered in the Fixed step size box from the Simulation Parameters dialog box. For example, enter
  2. In the Output channels box, enter a channel vector that selects the analog input channels you are using on this board. The vector can be any valid MATLAB vector form. For example, to select all eight analog input channels on the AD512 board, enter
  1. If you want to use the first four digital input lines, enter

    If you have one 8-bit digital channel, enter [1]. If you have two 8-bit digital channels, enter [1 9], and from the Channel mode list, choose Byte.

  1. From the Channel mode list, choose from one of the following:
  2. Enter the initial values for each digital output line or channel you entered in the Output channels box. For example, if you entered [1,2,3,4] in the Output channels box, and you want initial values of 0 and 1, enter
  1. If from the Channel mode list, you choose Byte, then enter a value between 0 and 255 for each digital output channel. For example, for one byte (8 digital lines) with an initial value of 25, enter [25]. For two bytes (16 digital lines) with initial values of 25 and 50, enter [25 50].

  1. Enter a final value for each digital output channel you entered in the Output channels box. For example, if you entered [1,2,3,4] in the Output channels box, and you want final values of 0, enter
  1. If from the Channel mode list, you choose Byte, then enter a value between 0 and 255 for each digital output channel.

    If you chose Bit, your dialog box will look similar to the figure shown below.

  1. Do one of the following:

  Digital Input Block Counter Input Block