| Customize Help

Using timers and rotary decoders with Matrox 4Sight GPm



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.

Timers

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 41: I/O signals and communicating with external devices. There are some differences, however, such as:

Rotary decoders

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 41: 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 whether 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).

There are two data latches associated with the rotary decoders on Matrox 4sight GPm. You can store the counter value of a rotary decoder in either of these data latches whenever a signal is received from a timer or auxiliary I/O, using MsysControl() with settings from the table For controlling the settings of a data latch associated with rotary encoders. You can retrieve the stored value within a hook function (hooked using MsysHookFunction()) using MsysGetHookInfo() with M_SYS_DATA_LATCH_VALUE.

Note that the function must be hooked to the same type of event that triggers the latch. For example, if the latch is triggered by a timer (M_SYS_DATA_LATCH_TRIGGER_SOURCE with M_TIMERn), the hook function must be hooked to a timer event (M_TIMER_START or M_TIMER_END).