LED status: TRUE (high/open)=encoder OK (LED off), False (low)=encoder fault (LED red).
External power supply exceeding 5V is strictly prohibited, otherwise the input circuit will be damaged.

TwinCAT Debugging and ESI Version Management
4.1 ESI Description File Installation
The ESI (EtherCAT Slave Information) file for EL5102 must match the hardware revision version. When scanning the device, if TwinCAT prompts "OnlineDescription", do not directly use the online description. Instead, download the latest XML file from the Beckhoff official website and place it in the C: TwinCAT 3.1 Config Io EtherCAT directory.
Revision compatibility principle: The revision number in the configuration should be ≤ the actual hardware revision number (i.e. higher versions of hardware can be backward compatible with lower versions of configurations). For example, if -0016 is used in the configuration, the actual hardware can be -0017 or higher.
4.2 Pre defined Selection of Process Data (Key Steps)
EL5102 offers multiple "Predefined PDO Assignments", which can be activated by simply selecting the corresponding function combination:
The mode includes functional applicability scenarios
Legacy EL5101 is compatible with old versions of EL5101. The status bit has already been migrated to EL5101 project
Standard full status bit+counter+latch value, regular position feedback
Standard+Frequency includes additional frequency value and speed monitoring
Standard+Period includes additional periodic values for high dynamic speed measurement
Standard+Duty Cycle includes additional diagnosis of duty cycle pulse signals
Standard+Timestamp includes an additional timestamp (32/64 bits) for precise timing of events (requires DC mode)
Counter mode simplifies process data (only counter+control) for pure counting applications
Recommended configuration: Most applications can obtain complete counter values and status bits by selecting "2. Ch Standard". If frequency or period measurement is required, select the corresponding Frequency/Period mode.
4.3 Synchronization mode and minimum cycle time
EL5102 supports three synchronization modes:
FreeRun/SM Synchron: Frame triggered, suitable for non real time requirements.
DC Synchronous: Output type DC mode, SYNC event is triggered after the frame passes.
DC Synchron (input based): Input based DC mode (recommended), where the SYNC event is triggered before the frame arrives to ensure that the current input data is available for transmission.
Minimum cycle time: When using standard process data, it is recommended to be ≥ 125 μ s; When enabling Timestamp or incremental features, it is recommended to use ≥ 200 μ s. If the cycle setting is too short, monitor 0x6002:0F "Input cycle counter" to confirm the validity of data updates.
Detailed Explanation of Core Function Configuration
5.1 Counting direction and reversal detection
The counting direction is determined by the phase of the A and B phase signals: A phase leads B phase by 90 ° for forward rotation (CW), and vice versa (CCW). Logic can be reversed by using 0x80n0:0E "Reversal of rotation".
Direction inversion detection (0x80n2:13 "Direction inversion detected"):
Set 0x80n1:1C 'Direction inversion hysteresis' to a value greater than 0 (in increments).
If the number of directional reversals detected within a PLC cycle exceeds the threshold, the status bit is set.
This function can also be used as static monitoring - it does not trigger a reverse signal when the counter jitter is within the threshold range.
5.2 Lock function and workpiece measurement
EL5102 provides two independent latch inputs (Latch extern and Gate/Catch extern 2), which can achieve:
Single lock (default):
Set 0x70n0:02 (positive edge) or 0x70n0:04 (negative edge).
After the external pulse is triggered, the current count value is stored in 0x60n0:12 "Latch value" and 0x60n0:02 "Latch external valid" is set.
The control bit must be reset before it can be latched again.
Continuous latch: Set 0x80n0:22 "Enable continuous latch extern" to TRUE, and each external pulse edge will be automatically latched without reactivation.
Example of workpiece measurement (measuring the distance between two sensors):
The Latch input of channel 1 is connected to sensor 1 (positive edge trigger), and the latch value is stored in 0x60n0:12.
The Gate/Match input of channel 1 is connected to sensor 2 (triggered by negative edge, gate function needs to be disabled by setting 0x80n0:04 to 0), and the latch value is stored in 0x60n0:22.
The PLC calculates the difference=0x60n0:12-0x60n0:22, which is the length of the workpiece.
5.3 Micro incremental interpolation (resolution improvement)
After enabling 0x80n0:0A "Enable micro increments", EL5102 interpolates 256 micro steps between two real encoder increments. For example, a 1024 line encoder is multiplied by 4 to achieve 4096 increments, and with micro increments enabled, the equivalent resolution is 4096 × 256=1048576 steps/turn.
prerequisite:
Must run in DC synchronous mode (micro increments are not available in FreeRun mode).