MC_TouchProbe data structures

MC_InputRef

MC_InputRef

TYPE MC_InputRef :
STRUCT
    EncoderID       : UDINT;             (* 1..255 *)
    TouchProbe      : E_TouchProbe;      (* Signal source *)
    Edge            : E_SignalEdge;      (* rising or falling signal edge *)
    PlcEvent        : BOOL;              (* PLC trigger signal input when TouchProbe signal source is set to 'PlcEvent' *)
    ProbeState      : E_TouchProbeState; (* internal state of the touch probe sequence *)
    ModuloPositions : BOOL;              (* interpretation of FirstPosition, LastPosition and RecordedPosition as modulo positions when TRUE *)
END_STRUCT
END_TYPE

EncoderID : Encoder identification of the drive hardware used. The encoder ID can be read off in the TwinCAT SystemManager.

TouchProbe : Defines the signal source, within the encoder hardware used, which triggers the measuring probe function.

Edge : Defines whether the rising or falling edge of the trigger signal is evaluated.

PlcEvent : If the signal source TouchProbe is set to the type PlcEvent, a rising edge on these variables triggers the recording of the current axis position. The PlcEvent is not a true latch function, but is cycle-time dependent.

ProbeState : Internal state of the measuring probe function. This variable must not be written to.

ModuloPositions : If the variable ModuloPositions is FALSE, the axis position is interpreted in an absolute linear range from -∞ to +∞ . The positions FirstPosition, LastPosition und RecordedPosition of the MC_TouchProbe function block are then also absolute.
If ModuloPositions is TRUE, all positions are interpreted as modulo values in the modulo range of the axis used (e.g. 0..359.9999). At the same time this means that a defined trigger window repeats itself cyclically.

E_TouchProbe

E_TouchProbe

The data type E_TouchProbe describes which signal from a signal source is used for the measuring probe function.

TYPE E_TouchProbe :
(
    TouchProbe1     := 1,
    TouchProbe2,
    TouchProbe3,
    TouchProbe4,
    PlcEvent        := 10
);
END_TYPE

TouchProbe1..TouchProbe4 : Signal source internal to the encoder hardware (e.g. drive AX2000, KL5001). Depending upon the hardware up to four trigger signals can be evaluated, but at the present time only the first signal, namely TouchProbe1, is supported.

PlcEvent : PlcEvent defines a trigger signal that is not switched using encoder hardware, but is generated directly in the PLC, and is thus a normal BOOL variable. This PLC trigger signal is stored in the data structure MC_InputRef in the variable PlcEvent. This leads to the axis position that is current at the time being recorded. The PlcEvent is not a true latch function, but is cycle-time dependent.

E_SignalEdge

E_SignalEdge

TYPE E_SignalEdge :
(
    RisingEdge,
    FallingEdge
);
END_TYPE

Rising or falling edge of the trigger signal.

E_TouchProbeState

E_TouchProbeState

TYPE E_TouchProbeState :
(
    TouchProbeInactive,
    TouchProbeActivated,
    TouchProbeAborted
);
END_TYPE

Internal state of the measuring probe function.

 

Requirements

Development environment

Target system type

PLC libraries to be linked

from TwinCAT v2.9 Build 1000

PC (i386)

TcMC.Lib