Documentation

Quanser Q8 Counter

Q8 Counter block

Library

Simulink® Real-Time™ Library for Quanser

Block Parameters

Channel vector

Enter a vector of numbers containing 1 or 2. This driver allows you to enter channel numbers in arbitrary order. Channel 1 references the counter channel, channel 2 references the watchdog channel. For example, to use both channels, enter

[1,2]
Mode vector

Enter the display port mode. Enter a scalar or a vector that is the same length as the channel vector. If you specify a scalar value, that setting is replicated over the channel vector. The allowable entries are

  • 0 — Frequency Modulation (FM). Display a single input port for the corresponding channel. This port dynamically specifies the lengths (in 30 nanosecond units) of both the low and high phases of a square wave output over the channel.

  • 1 — Pulse Width Modulation (PWM). Display a lo and a hi input port for each corresponding channel. These port dynamically specifies the lengths (in 30 nanosecond units) of the low and high phases respectively of a rectangular wave output over the channel.

Show arm input vector

Enter a scalar or a vector that is the same length as the channel vector. If you specify a scalar value, that setting is replicated over the channel vector. The allowable entries are

  • 0 — Do not display the input arm input. The channel is already armed.

  • 1 — Display the input arm input for the associated channel. This setting allows a channel to be armed or disarmed. You can use this port to enable or disable the channel output dynamically. To enable or disable the channel output, connect a signal to the input arm input. A signal value of 1 enables the channel output, a value of 0 disables the channel output.

    When you disarm a channel, its output is continuously high. When you arm a channel, the corresponding input port(s) control the output, as usual.

    The value of an input port is undefined for the time between when a model is downloaded and the time it is started. If an input port is armed, its initial value is determined by the corresponding Initial low count vector and Initial high count vector values:

    • If either the Initial low count vector or Initial high count vector value is nonzero, the channel will be armed between download time and model start time

    • If both the Initial low count vector or Initial high count vector value is zero, the channel will be disarmed.

Reset vector

The reset vector controls the behavior of the channel at model termination. Enter a scalar or a vector that is the same length as the channel vector. If you specify a scalar value, that setting is replicated over the channel vector. If you specify a value of 1, the corresponding channel is reset to the value specified in the initial value vector. If you specify a value of 0, the channel remains at the last value attained while the model was running.

Initial low count vector

This parameter specifies the initial width (the time after model download and prior to model start) in 30 nanosecond intervals of the low portion of the output signal for the corresponding channel. Enter a scalar or a vector that is the same length as the channel vector. If you specify a scalar value, that setting is replicated over the channel vector.

Initial high count vector

This parameter specifies the initial width (the time after model download and prior to model start) in 30 nanosecond intervals of the high portion of the output signal for the corresponding channel. Enter a scalar or a vector that is the same length as the channel vector. If you specify a scalar value, that setting is replicated over the channel vector.

Sample time

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

PCI slot

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')

External Websites

Was this topic helpful?