Table of Contents

Class EncoderFunctions

Namespace
TwinSharp.NC
Assembly
TwinSharp.dll

The EncoderFunctions class provides methods to interact with and control encoder devices via the TwinCAT ADS protocol. It includes functionalities to set and reinitialize the actual position of the encoder, activate and deactivate touch probes and external latches, and set external latch events. The class uses an AdsClient to communicate with the encoder and sends commands using specific index groups and offsets.

public class EncoderFunctions
Inheritance
EncoderFunctions
Inherited Members

Methods

ActivateExternalLatchFallingEdge()

Activate "External Latch" or activate "measuring probe function" (falling edge) KL5101,SERCOS,AX2xxx,PROFIDrive

public void ActivateExternalLatchFallingEdge()

ActivateExternalLatchFallingEdgeCANopen(bool, bool, bool, bool)

Activate "External Latch" 1 to 4 or activate "measuring probe function" 1 to 4 (falling edge) CANopen

public void ActivateExternalLatchFallingEdgeCANopen(bool latch1, bool latch2, bool latch3, bool latch4)

Parameters

latch1 bool
latch2 bool
latch3 bool
latch4 bool

ActivateExternalLatchRisingEdge()

Activate "External Latch" or activate "measuring probe function" (typically rising edge) KL5101,SERCOS,AX2xxx,PROFIDrive

public void ActivateExternalLatchRisingEdge()

ActivateExternalLatchRisingEdgeCANopen(bool, bool, bool, bool)

Activate "External Latch" 1 to 4 or activate "measuring probe function" 1 to 4 (typically rising edge) CANopen

public void ActivateExternalLatchRisingEdgeCANopen(bool latch1, bool latch2, bool latch3, bool latch4)

Parameters

latch1 bool
latch2 bool
latch3 bool
latch4 bool

ActivateTouchProbe(uint, SignalEdge, ProbeMode, uint)

Function group "TouchProbeV2": SERCOS/SoE, EtherCAT/CoE(CANopen DS402), SoftDrive(TCom), MDP 511 (EL5101, EL5151, EL5021, EL7041, EL7342)

public void ActivateTouchProbe(uint probeUnit, SignalEdge signalEdge, ProbeMode probeMode, uint signalSource)

Parameters

probeUnit uint
signalEdge SignalEdge
probeMode ProbeMode
signalSource uint

DeactivateExternalLatch()

Deactivate "external latch" or deactivate "measuring probe function" KL5101,SERCOS,AX2xxx,PROFIDrive

public void DeactivateExternalLatch()

DeactivateExternalLatchCANopen(bool, bool, bool, bool)

Deactivate "external latch" or deactivate "measuring probe function" CANopen

public void DeactivateExternalLatchCANopen(bool latch1, bool latch2, bool latch3, bool latch4)

Parameters

latch1 bool
latch2 bool
latch3 bool
latch4 bool

DeactivateTouchProbe(uint, SignalEdge)

Deactivate "touch probe" (external latch) Function group "TouchProbeV2": SERCOS/SoE, EtherCAT/CoE(CANopen DS402), SoftDrive(TCom), MDP 511 (EL5101, EL5151, EL5021, EL7041, EL7342)

public void DeactivateTouchProbe(uint probeUnit, SignalEdge signalEdge)

Parameters

probeUnit uint
signalEdge SignalEdge

ReInitActualEncoderPosition()

Re-initialization of the actual encoder position. Note: Takes effect for reference system „ABSOLUTE MULTITURN RANGE(with single overflow)“ and „ABSOLUTE SINGLETURN RANGE(with single overflow)“. NEW from TC3

public void ReInitActualEncoderPosition()

SetActualPosition(ActualPositionType, double)

Set actual position encoder/axis. Caution when using!

public void SetActualPosition(ActualPositionType actualPositionType, double position)

Parameters

actualPositionType ActualPositionType
position double

SetExternalLatchEvent(double)

Set "External latch event" and "External latch position" KL5101,SERCOS,AX2xxx,PROFIDrive Only for EtherCAT.

public void SetExternalLatchEvent(double position)

Parameters

position double