Skip to content
STAGING SERVER
DEVELOPMENT SERVER

Configuring Your Applet So That the Shaft Encoder Runs Forward#

Overview#

When using an imaWorx frame grabber together with line‑scan cameras, an encoder can be used as the trigger source for line acquisition. In some configurations, the trigger may fire in both directions, forward and backward, which is usually not desired.

This article explains how the shaft encoder logic works in the applet, how to configure it correctly, and how to ensure that only forward movement generates trigger pulses.

Behavior of the Shaft Encoder in the Applet#

When the shaft encoder feature is enabled in the applet, the applet generates ExSync pulses only during forward movement.

If the encoder moves backward, no ExSync pulses are output. Instead, the backward movement is internally compensated:

  • The encoder counts how many pulses were generated in reverse.
  • ExSync pulses resume only when the forward movement exceeds the backward distance.
  • If no backward movement occurs, the trigger runs continuously.

To determine direction, the frame grabber requires both A and B signals from the encoder.

Preliminary Checks#

Power and Signal Type#

  • Ensure VCC_IN_A and GND_IN_A are connected.
  • Encoder signals must be provided as differential inputs.

Reference: Frame Grabber Documentation

gpioTool Configuration#

Open the gpioTool command line tool, and check the current configuration:

gpioTool -b 0 -g

If Port A is not configured for differential input, configure it with the following command:

gpioTool -b 0 -s 1:ds,pd,ni

The arguments in this command have the following meaning:

  • Bank 1 = Triggerboard Port A
  • ds = differential
  • pd = pull‑down
  • ni = not inverted

Required Applet Configuration#

After confirming the differential input configuration, set the following parameters in the applet:

Encoder Signal Parameter Value
A FG_LINETRIGGERINSRC 0 (GPI0)
B FG_SHAFTENCODERINSRC 2 (GPI2)

This ensures that the frame grabber receives both A and B signals correctly and can determine the direction.

FAQs#

Can the Shaft Encoder Mapping Be Defined Manually?#

Yes, the mapping is defined through the parameters listed above. Both A and B must be assigned to separate GPI inputs

Can Encoder Pulses Be Monitored in the Signal Analyzer?#

Yes, the following signals can be selected:

  • GPI0 (A signal)
  • GPI2 (B signal)
  • ExSync (shaft encoder output)

This allows monitoring of both the raw encoder inputs and the resulting trigger output.

The applet provides four CXP trigger sources (0–3):

  • Trigger 0 and 1 should be used in most cases.
  • Trigger 2 and 3 are part of CXP 2.0 and are not supported by many cameras.
  • Some older camera implementations require both rising‑edge and falling‑edge triggers (0 and 1).

For typical setups, CXP Link Trigger 0 is the correct choice.

Back to Knowledge Articles