This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Contec CNT24-4D(PCI) Incremental Encoder

Contec CNT24-4D(PCI) Incremental Encoder block


Simulink® Real-Time™ Library for Contec

Block Parameters

You can have only one driver block instance for each physical board. To use multiple channels, select and enable more than channel on the same block.


From the list, select 1, 2, 3, or 4. This parameter specifies the channel to which the subsequent parameters refer. The other parameters in this block apply to this channel. The Enable channel check box number changes to match the selected channel.

Enable channel

Select this check box to enable the currently selected channel. Click OK after you select this check box to add an output port for the channel on the driver instance of your model. This check box also enables you to set a number of operation parameters for the block, ranging from Input type to Initial count. Whatever operation parameters are in place when you click OK are preserved for the channel until the next time you change them.

The following are some additional behavior notes for this check box:

  • If you do not select this check box for a channel, an output port for that channel is not added to the block. You also cannot change the operation parameters for the channel.

  • If you select this check box and save the operation parameters for that channel, then later deselect this check box, the block preserves the operation parameters for the channel. The output port is removed from the block.

Input type

From the list, choose either Line receiver or TTL-level input. This parameter specifies the input type for the current channel.


From the list, select the counter operation mode for the current channel. There are a number of modes, based on 1-phase or 2-phase pulse inputs. See the Contec CNT24-4D(PCI) documentation for descriptions of these modes.

Note that of this list of modes, the Multiply by 4 modes are synonyms for quadrature encoding.


From the list, select either Clockwise rotation counts down or Clockwise rotation counts up as the counter direction of the current channel.

Phase Z logic

From the list, select either Active high or Active low for the current channel. This parameter specifies the state of the phase Z input (reference position signal). If the phase Z mode parameter has a value of Disable phase Z input, Phase Z logic does nothing.

Phase Z mode

From the list, select either Disable phase Z input, Enable next phase Z input only once, or Enable every phase Z input. This parameter specifies the operation mode of the phase Z input for the current channel.

Digital filter

From the list, select the characteristics of the digital input filter you want to apply to the current channel's input signal. There are a number of sampling cycles to choose from, ranging from 0.1 microseconds (1 MHz) to 1056.1 microseconds (94 Hz).

Initial count

Enter a number from 0 to 16777215 (FFFFFF hex, the largest 24-bit number). This parameter specifies the initial value of the counter for the current channel.

Sample time

Enter the base sample time or a multiple of the base sample time (-1 means sample time is inherited).

PCI slot (-1:autosearch)

If only one board of this type is in the target computer, enter -1 to locate the board.

If two or more boards of this type are in the target computer, enter the bus number and the PCI slot number of the board associated with this driver block. Use the format [BusNumber,SlotNumber].

To determine the bus number and the PCI slot number, type:

tg = slrt;
getPCIInfo(tg, 'installed')

See Also

External Websites

Was this topic helpful?