XFC_EL1258_TouchProbe
The function block XFC_EL1258_TouchProbe records the axis positions at the time of the edges of a digital input signal (touch probe function).
The digital input signal is recorded with an EL1258 XFC input terminal with timestamps for falling and rising signal edges. The function block determines the axis positions at which an 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 timestamps 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 (including several edges per PLC cycle). In single-shot mode the next edges are 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.
Inputs
VAR_INPUT
Execute : BOOL;
WindowOnly : BOOL;
FirstPosition : LREAL;
LastPosition : LREAL;
Options : ST_XfcTouchProbeOptions;
EL1258 : EL1258_MT_IoInterface;
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 when the recorded position is within the window, Done becomes 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 | |
EL1258 | Process image of the terminal |
/ 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;
RecordedPositions : ARRAY[1..10];
NoOfRecordedPositions : UDINT;
Diagnostic : ST_EL1258_Diagnostics
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. |
RecordedPositions | ARRAY[1..10] | One or more detected axis positions at the time of the trigger event. If TriggerInput.FreeRun is TRUE, the function block operates in free-running mode, so that each valid change in the input signal leads to a new RecordedPosition. The positions can be evaluated if Done is TRUE. |
NoOfRecordedPositions | UDINT | Number of positions recorded. |
Diagnostic | Data structure containing diagnostic data that can be used for error analysis. |