MC_TouchProbe_V2

The MC_TouchProbe_V2 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.
The function of the MC_TouchProbe_V2 function block is similar that of the MC_TouchProbe function block. With several instances, however, it is possible to operate up to two probe units at the same time and in parallel to record the rising and falling signal edges each with an instance. Furthermore, a continuous mode is available that evaluates successive signal edges without renewed activation.
Prerequisites
- TwinCAT version 2.11 R2 build 2022 or higher (before that use MC_TouchProbe)
The prerequisite for the position acquisition is suitable encoder hardware that is able to latch the recorded position. Support is offered for:
- SERCOS drives
In contrast to MC_TouchProbe, the drive must be configured with an extended interface, in which the parameters S 0 0405 and S-0 0406 are included in the process image. See also ... - EtherCAT SoE drives (E.g. AX5000)
In contrast to MC_TouchProbe, the drive must be configured with an extended interface, in which the parameters S 0 0405 and S-0 0406 are included in the process image. See also ... - EtherCAT CoE drives
The drive must be configured with the parameter 0x60B9 (touch probe status) in the process image. - EL5101, KL5101
Latching of the C track and the digital input is possible. This hardware can only record one signal or edge at a time. Continuous mode is not supported.
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. Beckhoff EtherCAT drives can be configured with the System Manager. Note that the probe unit has to be configured with the "Extended NC Probe Unit" interface.
![]() | 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_AbortTrigge_V2 with the same TriggerInput data structure must be called up. Otherwise no new cycle can be initiated. |
Signal curve
Inputs
VAR_INPUT
Execute : BOOL;
WindowOnly : BOOL;
FirstPosition : LREAL;
LastPosition : LREAL;
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. |
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). |
Outputs
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
CommandAborted : BOOL;
Error : BOOL;
ErrorID : UDINT;
RecordedPosition : LREAL;
RecordedData : MC_TouchProbeRecordedData;
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 |
RecordedData |
Data structure with complementary information relating to the logged axis position at the time of the trigger signal |
Inputs/outputs
VAR_IN_OUT
Axis : AXIS_REF;
TriggerInput : TRIGGER_REF;
END_VAR
Axis | |
TriggerInput |
TRIGGER_REF data structure for describing the trigger source |