| Contents | Index |
xPC Target Library for Contec
Each channel of this block has an external input and output signal. You can configure these channels for hardware events (such as starting the encoder on the rising or falling edge of an input signal). You can also configure them for general purpose, where the signals behave like digital I/O signals. The block can have the following ports:
Output port labeled with the channel number
Output port labeled din , if you configure the block for digital input
Input port labeled dout , if you configure the block for digital output
Encoder (Input to Output)
Hardware Input | Block Input Data Type | Scaling |
|---|---|---|
TTL or differential (pulse input) | Double | Counts |
Digital Input (Input to Output)
Hardware Input | Block Input Data Type | Scaling |
|---|---|---|
TTL | Double | TTL low = 0.0 TTL high = 1.0 |
Digital Output (Output to Input)
Hardware Output | Block Output Data Type | Scaling |
|---|---|---|
TTL | Double | TTL low = < 0.5 TTL high = > 0.5 |
The Main tab contains parameters that define the operation of the board.
From the list, select 1 through 8. This parameter specifies the board channel to which the subsequent parameters refer. Number the channels beginning with 1 even though the board manufacturer numbers them beginning with 0. The other parameters in this block apply to this channel. The channel you select becomes the label for the output port of the block.
From the list, select one of the following operation modes:
2-phase Input Synchronous Clear Multiply by 1
2-phase Input Synchronous Clear Multiply by 2
2-phase Input Synchronous Clear Multiply by 4
2-phase Input Asynchronous Clear Multiply by 1
2-phase Input Asynchronous Clear Multiply by 2
2-phase Input Asynchronous Clear Multiply by 4
Single-phase Input Asynchronous Clear Multiply by 1
Single-phase Input with Gate Control Attached Asynchronous Clear Multiply 1
Single-phase Input with Gate Control Attached Asynchronous Clear Multiply 2
See the Contec CNT32-8M(PCI) 8-Ch 32-Bit Up/Down High-Speed Counter Board for PCI documentation for definitions of these modes.
From the list, select the desired digital filter time, in microseconds. For no digital filter time, select No filtering.
From the list, select one of the following pulse inputs:
Differential line receiver input
TTL Level input
You can connect the CNT32-8M(PCI) board to either differential or TTL input signals. See the Contec CNT32-8M(PCI) 8-Ch 32-Bit Up/Down High-Speed Counter Board for PCI documentation for connection details.
From the list, select one of the following count directions:
Up in the clockwise direction/Down in the counterclockwise direction
Down in the clockwise direction/Up in the counterclockwise direction
The board can count either up or down in the clockwise direction.
Enter a number from 0 to the largest 32-bit number. This parameter specifies the initial value of the counter before the model begins.
Select this check box to load the value from Initial value into the counter, overwriting the previous count value. If you do not select this check box, the driver does not load the initial value, preserving the previous count value.
Enter the base sample time or a multiple of the base sample time.
If only one board of this type is in the target PC, enter
-1
to automatically locate the board.
If two or more boards of this type are in the target PC, 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
getxpcpci
The Counter Control tab contains parameters that define
How to start and stop counting
How to use the external input signal
Under what circumstances to reset the counter
Directs counter to begin counting under one of the following conditions:
Model Start — Begin counting when model starts.
External Input Rising — Begin counting when external TTL input rises.
External Input Falling — Begin counting when external TTL input falls.
Disable — Do not begin counting.
Directs counter to stop counting under one of the following conditions:
Model Terminate — Stop counting when model stops.
External Input Rising — Stop counting when external TTL input rises.
External Input Falling — Stop counting when external TTL input falls.
Free Running — Do not stop counting.
Select this check box to clear the counter upon a rising edge on the external input signal.
Select this check box to clear the counter upon a falling edge on the external input signal.
Select this check box to clear the counter when the counter has the same value as that contained in the Match 0 value parameter.
Select this check box to clear the counter when the counter has the same value as that contained in the Match 1 value parameter.
Select this check box to preset the counter to the value contained in the Preset value parameter upon a rising edge on the external input signal.
Select this check box to preset the counter to the value contained in the Preset value parameter upon a falling edge on the external input signal.
Select this check box to preset the counter to the value contained in the Preset value parameter when the counter value has the same value as that contained in the Match 0 value parameter.
Select this check box to preset the counter to the value contained in the Preset value parameter when the counter value has the same value as that contained in the Match 1 value parameter.
Enter the value that you want the counter to reset when a preset condition occurs.
Enter the value that you want the counter value to be compared to for the Zero-clear match 0 or Preset match 0 conditions.
Enter the value that you want the counter value to be compared to for the Zero-clear match 1 or Preset match 1 conditions.
The Signals tab contains parameters that
Control the optional use of the external output signal
Control the encoder index signal
Enable the external signals for general purpose
Select this check box to strobe the output signal when the counter value has the same value as the Match 0 parameter.
Select this check box to strobe the output signal when the counter value has the same value as the Match 1 parameter.
Select this check box to strobe the output signal when the phase-A and phase-B signals change at the same time.
Select this check box to strobe the output signal when a pulse is faster than the digital filter time setting.
Select this check box to strobe the output signal when both the positive and negative differential inputs are high.
From the list, select the pulse width of the output signal for the one-shot duration, in microseconds or milliseconds.
From the list, select the following to enable or disable the phase-Z/CLR input signal:
Disable — Disables phase-Z input (select this option if phase-Z does not exist).
Enable Once — Enables only the next phase-Z input.
Enable All — Enables all phase-Z inputs.
From the list, select one of the following to set the logic of the phase-Z input signal. Setting Index enable to Enable Once or Enable All activates this parameter.
Positive (Active High)
Negative (Active Low)
Select this check box to enable the external input signal to be used as a general purpose digital input. Even if you select an external input signal other than general-purpose input, the block can still read the input level.
Select this check box to enable the external output signal to be used as a general-purpose digital output. If you select an external output signal other than general purpose, the block cannot write the output level. Selecting this check box enables the Digital output initial value and Digital output final value parameters.
From the list, select how you want to set the initial value of the digital output when the model starts:
None — Do not modify the output value.
Set — Set the bit.
Clear — Clear the bit.
From the list, select how you want to set the final value of the digital output when the model terminates:
None — Do not modify the output value.
Set — Set the bit.
Clear — Clear the bit.

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |