User`s guide
4 Advanced Procedures
4-22
- latch & reset on falling edge — The count of the counter is
remembered and then the counter is reset when high to low transition of
the gate occurs.
Not all counter chips support all gate modes. Only supported gate modes are
shown in the pull-down menu.
7 Do one of the following:
- Click
Apply to apply the changes to your model and leave the dialog box
open.
- Click
OK to apply the changes to your model and close the Block
Parameters: Counter Input
dialog box.
Encoder Input Block
This Real-Time Windows Target I/O block allows you to select and connect
specific encoder input channels to your Simulink model.
After you have added an Encoder 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 Encoder Input block.
The
Block Parameters: Encoder Input dialog box opens.
2 In the Sample time box, enter the same value you entered in the Fixed step
size
box from the Configuration Parameters dialog box. For example,
enter
0.001
3 In the Input channels box, enter a channel vector that selects the encoder
input channels you are using on this board. The vector can be any valid
MATLAB vector form. For example, to select all four encoder input channels
on the MF604 board, enter
[1,2,3,4] or [1:4]
4 Encoders typically use two sets of stripes, shifted in phase, to optically detect
the amplitude and direction of movement. The
Quadrature mode
parameter specifies which encoder stripe edges should be counted.