MC_TouchProbe

MC_TouchProbe 1:

The MC_TouchProbe function block records an axis position at the point in time of a digital signal (measuring probe function). The position is usually not recorded directly in the PLC environment, but via an external hardware latch, and is thus very accurate and independent of cycle time. The function block controls this mechanism and determines the externally recorded position.

Requirements

The prerequisite for the position acquisition is suitable encoder hardware that is able to latch the recorded position. The following equipment is supported, for example: SERCOS drives, the Beckhoff AX2000 with SERCOS and Lightbus interfaces and the Beckhoff KL5101 Encoder Bus Terminal. The digital trigger signal is wired into this hardware and, independently of the PLC cycle, triggers the recording of the current axis position.

These end devices have to be configured to some extent so that a position recording is possible. On this subject read Measuring probe evaluation with AX2xxx-B200 (Lightbus) and Measuring probe evaluation with AX2xxx-B750 (SERCOS).

Note

After a measuring probe cycle has been initiated by a rising edge on the Execute input, this is only terminated if the outputs Done, Error or CommandAborted become TRUE. If the process is to be interrupted at an intermediate point in time, the function block MC_AbortTrigger with the same TriggerInput data structure must be called up. Otherwise no new cycle can be initiated.

Signal curve

MC_TouchProbe 2:

VAR_INPUT

VAR_INPUT
    Execute        : BOOL;  (* Starts touch probe recording *)
    WindowOnly     : BOOL;  (* Enables the monitoring window *)
    FirstPosition  : LREAL; (* Beginning of the monitoring window *)
    LastPosition   : LREAL; (* Ending of the monitoring window *)
END_VAR

Execute : The command is executed with the rising edge and the external position latch is activated.

WindowOnly : If this option is active, only one position inside the window between FirstPosition and LastPosition is recorded. Positions outside the window are rejected and the external position latch is automatically newly activated. Only if the recorded position lies inside the window does Done become TRUE.
The recording window can be interpreted in terms of absolute or modulo values. In this connection the flag ModuloPositions in the structure TriggerInput is to be set accordingly. In the case of absolute value positions there is exactly one window. In the case of modulo value positions the window repeats itself within the modulo cycle defined in the axis parameters (e.g. 0 to 360 degrees).

FirstPosition : Initial position of the recording window, if WindowOnly is TRUE. This position can be interpreted as an absolute or modulo value. In this connection the flag ModuloPositions is to be set appropriately in the structure TriggerInput (see below).

LastPosition : Final position of the recording window, if WindowOnly is TRUE. This position can be interpreted as an absolute or modulo value. In this connection the flag ModuloPositions is to be set appropriately in the structure TriggerInput (see below).

MC_TouchProbe 3:

VAR_OUTPUT

VAR_OUTPUT
    Done              : BOOL; (* move completed *)
    Busy              : BOOL; (* function block is currently busy *)
    CommandAborted    : BOOL;
    Error             : BOOL; (* Signals that an error has occured within Function Block *)
    ErrorID           : UDINT;    (* Error identification *)
    RecordedPosition  : LREAL;    (* Position where the trigger event occured *)
END_VAR

Done : Becomes TRUE, if an axis position has been recorded successfully. The position is sent to the output RecordedPosition.

Busy: Becomes TRUE as soon as the function block is active, and becomes FALSE when it has returned to its initial state.

CommandAborted : Becomes TRUE if the process is interrupted by an external event, e.g. by the call up of MC_AbortTrigger.

Error : Becomes TRUE, as soon as an error occurs.

ErrorID : If the error output is set, this parameter supplies the error number.

RecordedPosition : Axis position recorded at the point in time of the trigger signal

VAR_IN_OUT

VAR_IN_OUT
    TriggerInput : MC_InputRef;          (* Reference to the trigger signal source. *)
    Axis         : NCTOPLC_AXLESTRUCT;   (* Identifies the axis which position should be recorded at a defined event at the trigger input *)
END_VAR

TriggerInput : Data structure of type MC_InputRef, that describes the trigger input for the recording of the axis position.

Axis : Axis structure.

 

Requirements

Development environment

Target system type

PLC libraries to be linked

from TwinCAT v2.9 Build 1000

PC (i386)

TcMC.Lib