User`s manual

Acquisition Control AW00049313000
116 Basler runner
Setting the Shaft Encoder Module Parameters
To use the shaft encoder software module effectively, you should do the following:
Select a signal source for the Phase A and Phase B inputs on the module.
(By default, input line 1 is selected as the signal source for the Phase A input and input line 2 is
selected as the signal source for the Phase B input.)
Make sure that the output from the encoder module is selected as the signal source for a
camera function. Currently, output from the encoder module can be selected as the signal
source for the camera’s Frame Start Trigger function or for the camera’s Line Start Trigger
function.
Set the Shaft Encoder Module Counter Mode and the Shaft Encoder Module Mode as
appropriate.
You can set the encoder module parameter values, issue commands to the encoder module, and
select signal sources from within your application software by using the pylon API. The code snippet
below illustrates using the API to set the parameter values and to issue commands to the encoder
module.
// Select physical input line 1 as the source signal for the Phase A input on the module
// and physical input line 2 as the source signal for the Phase B input
Camera.ShaftEncoderModuleLineSelector.SetValue( ShaftEncoderModuleLineSelector_PhaseA );
Camera.ShaftEncoderModuleLineSource.SetValue( ShaftEncoderModuleLineSource_Line1 );
Camera.ShaftEncoderModuleLineSelector.SetValue( ShaftEncoderModuleLineSelector_PhaseB );
Camera.ShaftEncoderModuleLineSource.SetValue( ShaftEncoderModuleLineSource_Line2 );
// Enable the camera’s Line Start Trigger function and select the outout from the encoder
// module as the source signal for the Line Start Trigger
Camera.TriggerSelector.SetValue( TriggerSelector_LineStart );
Camera.TriggerMode.SetValue( TriggerMode_On );
Camera.TriggerSource.SetValue ( TriggerSource_ShaftEncoderModuleOut );
Camera.TriggerActivation.SetValue( TriggerActivation_RisingEdge );
// Set the shaft encoder module counter mode
Camera.ShaftEncoderModuleCounterMode.SetValue( ShaftEncoderModuleCounterMode_FollowDirection );
// Set the shaft encoder module mode
Camera.ShaftEncoderModuleMode.SetValue( ShaftEncoderModuleMode_AnyDirection );
// Set the shaft encoder module counter max and the shaft encoder module reverse counter max
Camera.ShaftEncoderModuleCounterMax.SetValue( 32767 );
Camera.ShaftEncoderModuleReverseCounterMax.SetValue( 15 );
// Get the current value of the shaft encoder module counter
int64_t encodercounterSize = Camera.ShaftEncoderModuleCounter.GetValue();
// Reset the shaft encoder module counter and the shaft encoder module reverse counter
Camera.ShaftEncoderModuleCounterReset.Execute( );
Camera.ShaftEncoderModuleReverseCounterReset.Execute( );
For detailed information about using the pylon API, refer to the Basler pylon Programmer’s Guide
and API Reference.
You can also use the Basler pylon Viewer application to easily set the parameters.
For more information about the pylon Viewer, see Section 3.1 on page 17.
For more information about the line start trigger, see Section 8.2.4 on page 87.