XFC_TouchProbe

The XFC_TouchProbe function block records an axis position at the time of the edge of a digital input signal (measuring probe function).
The digital input signal is recorded with an XFC input terminal (e.g. EL1252) with time stamps for the falling and rising signal edge. The function block determines the axis position at which the edge change occurred and issues it as RecordedPosition.
In contrast to the conventional TouchProbe function MC_TouchProbe the digital input is not directly linked to the drive hardware. The position of each EtherCAT or Sercos axis in the system can be recorded via the time stamp of the input. This axis is exactly synchronized via Dead time compensation.
The function block can be used in free-running or single-shot mode. In free-running mode each edge of the input signal is recorded (maximum one edge per PLC cycle). In single-shot mode the next edge is only recorded once until the function block is triggered again.
The optional window function can be used to ignore signal edges outside the defined position filter.
Signal curve

Inputs
VAR_INPUT
Execute : BOOL;
WindowOnly : BOOL;
FirstPosition : LREAL;
LastPosition : LREAL;
Options : ST_XfcTouchProbeOptions;
END_VAR
Execute |
If Execute is active, the axis position is recorded at the defined signal edge of the input signal. A falling edge at Execute terminates the process immediately. | |
WindowOnly |
If this option is active, only one position inside the window between FirstPosition and LastPosition is recorded. Positions outside the window are discarded. 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). | |
Options |
Optional parameters | |
Options. |
UseAcceleration |
UseAcceleration can be set to TRUE in order to incorporate the acceleration of the axis into the position calculation. UseAcceleration can be advantageous if the setpoint values of the acceleration can be used. UseAcceleration may be disadvantageous with encoder axes that supply a noisy position signal, because the acceleration is also erroneous. |
Outputs
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
Error : BOOL;
ErrorID : UDINT;
RecordedPosition : LREAL;
END_VAR
Done |
The value RecordedPosition is valid. |
Busy |
Becomes TRUE as soon as the function block is active, and becomes FALSE when it has returned to its initial state. |
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. |
Inputs/outputs
VAR_IN_OUT
Axis : AXIS_REF;
TriggerInput : XFC_TRIGGER_REF;
END_VAR
Axis |
Axis data structure |
TriggerInput |
TriggerInput is a data structure for describing the trigger source and for feeding the state and time stamp of a digital input signal. This data structure is filled by the user. |
The axis data structure of type AXIS_REF addresses an axis uniquely within the system. Among other parameters it contains the current axis status, including position, velocity or error status.