MC_TouchProbe
The function block MC_TouchProbe records an axis position at the time of a digital signal (touch probe function). The position is usually not recorded directly in the PLC environment, but via an external hardware latch and is therefore highly accurate and independent of the cycle time. The function block controls this mechanism and determines the externally recorded position.
The function block was extended, compared to TwinCAT 2. It has the same functionality as the existing function block MC_TouchProbe_V2. |
Requirements
The prerequisite for the position detection 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. - 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. - 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 detection 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 touch 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
Inputs
VAR_INPUT
Execute : BOOL;
WindowOnly : BOOL;
FirstPosition : LREAL;
LastPosition : LREAL;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | The command is executed with a rising edge. |
WindowOnly | BOOL | If WindowOnly = TRUE, only one position within 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, "Done" becomes TRUE. The recording window can be interpreted in terms of absolute or modulo values. For this purpose, the "ModuloPositions" flag must be set accordingly in the TriggerInput data structure. In the case of absolute value positions there is exactly one window. With modulo positions, the window is repeated within the modulo cycle defined in the axis parameters (e.g. 0 to 360 degrees). |
FirstPosition | LREAL | Initial position of the recording window, if "WindowOnly" is TRUE. This position can be interpreted as an absolute or modulo value. For this purpose, the "ModuloPositions" flag must be set accordingly in the TriggerInput data structure. |
LastPosition | LREAL | End position of the recording window, if "WindowOnly" is TRUE. This position can be interpreted as an absolute or modulo value. For this purpose, the "ModuloPositions" flag must be set accordingly in the TriggerInput data structure. |
Requirements
Development environment | Target system type | PLC libraries to include |
---|---|---|
TwinCAT v3.0.0 | PC or CX (x86 or x64) | Tc2_MC2 |
Outputs
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
CommandAborted : BOOL;
Error : BOOL;
ErrorId : UDINT;
RecordedPosition : LREAL;
RecordedData : MC_TouchProbeRecordedData;
END_VAR
Name | Type | Description |
---|---|---|
Done | BOOL | TRUE if an axis position was successfully detected. The position is sent to the output "RecordedPosition". |
Busy | BOOL | TRUE as soon as the function block is active. FALSE if it is in the default state. |
CommandAborted | BOOL | TRUE if the process is interrupted by an external event, e.g. by the call up of MC_AbortTrigger. |
Error | BOOL | TRUE, if an error occurs. |
ErrorID | UDINT | If the error output is set, this parameter supplies the error number. |
RecordedPosition | LREAL | 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
Name | Type | Description |
---|---|---|
Axis | Axis data structure | |
TriggerInput | Data structure for describing the trigger source. This data structure must be parameterized before the function block is called for the first time. |