XFC_TouchProbe
The function block XFC_TouchProbe 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 timestamps 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 timestamp 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.
The sample shows how the function block can be used in free-running (FreeRun = TRUE
) or in single-shot mode (FreeRun = FALSE
).
Signal curve
Inputs
VAR_INPUT
Execute : BOOL;
WindowOnly : BOOL;
FirstPosition : LREAL;
LastPosition : LREAL;
Options : ST_XfcTouchProbeOptions;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | 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 | BOOL | 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 | LREAL | 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 | LREAL | 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 |
/ Inputs/Outputs
VAR_IN_OUT
Axis : AXIS_REF;
TriggerInput : XFC_TRIGGER_REF;
END_VAR
Name | Type | Description |
---|---|---|
Axis | The axis data structure of type AXIS_REF addresses an axis unambiguously within the system. Among other parameters, it contains the current axis status, including position, velocity or error state. | |
TriggerInput | TriggerInput is a data structure for describing the trigger source and for feeding the state and timestamp of a digital input signal. This data structure is filled by the user. |
Outputs
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
Error : BOOL;
ErrorID : UDINT;
RecordedPosition : LREAL;
END_VAR
Name | Type | Description |
---|---|---|
Done | BOOL | The value RecordedPosition is valid. |
Busy | BOOL | Becomes TRUE as soon as the function block is active, and becomes FALSE when it has returned to its initial state. |
Error | BOOL | Becomes 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. |