Matrox 4Sight GPm has 16 timers and 2 rotary decoders that can be used to synchronize with external devices. Timers are used with I/O signals to coordinate events with external devices. Rotary decoders are used to decode quadrature input (2-bit Gray code derived from two signals) from a rotary encoder.
The 16 timers on Matrox 4Sight GPm can be configured using MsysControl(). The timers are configured in a similar way to what is described in the Timers and coordinating events section of Chapter 24: I/O signals and communicating with external devices. There are some differences, however, such as:
A timer arming mechanism can be configured and enabled for each timer. If timer arming is enabled, the timer will ignore its trigger signal (MsysControl() with M_TIMER_TRIGGER_SOURCE) until a signal transition, specified using MsysControl() with M_TIMER_ARM_ACTIVATION, occurs on the signal specified using MsysControl() with M_TIMER_ARM_SOURCE. To enable timer arming, use MsysControl() with M_TIMER_ARM.
The clock source can be specified for both the delay portion and duration portion of the timer output signal. For example, a rotary decoder output signal can be used to set the delay between the timer trigger and the active portion of the timer's output signal, and the unit's clock generator can be used to set the duration of the active portion of the timer's output signal.
The timer can measure the duration of a pulse on a signal. To enable this functionality, use MsysControl() with M_TIMER_USAGE set to M_PULSE_MEASUREMENT. When a timer is set in this mode, the duration of pulses that occur on the timer's trigger source (M_TIMER_TRIGGER_SOURCE) are measured with respect to the clock source for the active portion of the timer (M_TIMER_CLOCK_SOURCE). To measure active-high pulses, set M_TIMER_TRIGGER_ACTIVATION to M_LEVEL_HIGH; to measure active-low pulses, set M_TIMER_TRIGGER_ACTIVATION to M_LEVEL_LOW. The measured value can be inquired using MsysInquire() with M_TIMER_VALUE. Note that when in this mode, the timer's output always remains low, and the values set using M_TIMER_DELAY_CLOCK_SOURCE, M_TIMER_DELAY, and M_TIMER_DURATION are ignored.
The two rotary decoders on Matrox 4Sight GPm can be configured using MsysControl(). The rotary decoders are configured in a similar way to what is described in the Using quadrature input from a rotary encoder section of Chapter 24: I/O signals and communicating with external devices. However, the following settings are unavailable when using Matrox 4Sight GPm: setting the direction of movement (M_ROTARY_ENCODER_DIRECTION), setting a signal source that changes the rotary decoder counter value (M_ROTARY_ENCODER_FORCE_VALUE_SOURCE), setting wheher to enable the rotary decoder to store the counter value at the end of the last grab or frame interrupt (M_ROTARY_ENCODER_FRAME_END_READ), and setting a multiplying factor to each increment/decrement of the rotary decoder counter (M_ROTARY_ENCODER_MULTIPLIER).