Real-Time Windows Target    

Counter Input Block

This Real -Time Windows Target I/O blocks allow you to select and connect specific counter input channels to your Simulink model.

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

  1. Double-click the Counter Input block.
  1. The Block Parameters: Counter Input 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 Input channels box, enter a channel vector that selects the counter input channels you are using on this board. The vector can be any valid MATLAB vector form. For example, to select all 4 counter input channels on the MF604 board, enter
  3. From Reset after read, which determines if the counter should be reset to zero after its value has been read, choose one of the following options:
  4. From Clock input active edge, which determines which clock edge should increment the counter, select:
  1. Not all counter chips support selecting the input edge. In this case, the pull-down menu will reflect the supported option only.

  1. From Gate input functionality, which defines the action of the counter's gate pin, select:
  1. Not all counter chips support all gate modes. Only supported gate modes are shown in the pull-down menu.

  1. Do one of the following:

  Digital Output Block Encoder Input Block