FC_TPEdge - General Information
Type: |
Function |
Available as of: |
SystemInterface_1.32.6.0 |
Versions: |
Current version |
Record position to an event on a filed input (TouchProbe = TP); for example, register mark.
Position measurement via an edge at a measured input. The used digital input must be configured as Touchprobe input before Sercos phase-up. The measurement of the position starts by calling the function. If a valid measurement result is recognized, the measurement is reported back through the CaptureOK parameter of the measured input.
NOTE: The function is "edge-triggered," meaning it is triggered once per working cycle.
The event or signal is entered in the PacDrive system at a measuring input using the measurement sensor (such as the print marker sensor).
Using the function FC_TPEdge(), the measuring input (i_stTPId), the edge (i_xPosEdge), the position source (i_stDevId), the position type (i_diParType), and the position window (i_lrLowLimit and i_lrHighLimit) is defined. If the measurement result is outside the position window, then the system discards the measurement and waits for a valid one.
When the FC_TPEdge() function is called, the status of the CaptureOk parameter of the measured input is set to FALSE and the CaptureValue parameter of the measured input is set to 0.
NOTE: If the function is called in an external event-driven task, then the priority (system priority VxWorks) of the task in which the function is called has to be >32.
NOTE: For information concerning the minimum interval between two measuring impulses (using LXM62DxS with OnboardIO), refer to "Interval between two measuring impulses".
DevId |
Meaning |
Supports ParType |
---|---|---|
DRIVE |
Axis |
Yes |
L_ENC |
Logical encoder |
Yes |
SENC |
Sum encoder |
No |
ParType |
Meaning |
Supported by DevId |
---|---|---|
0 |
Position |
DRIVE, L_ENC |
1 |
RefPosition |
DRIVE |
2 |
MechPosition |
DRIVE |
3 |
RefMechPosition |
DRIVE |
4 |
ShaftMechPosition |
DRIVE |
5 |
ShaftMechRefPos |
DRIVE |
6 |
PositionWithoutDelay |
L_ENC |
NOTE: Shifting CaptureValue. With a speed modification, the CaptureValue moves due to delays in the system.
In order to compensate this, consider:
0 / Position: TP SensorDelay = TP HW Delay - ShaftDelay
1 / RefPosition: TP SensorDelay = TP HW Delay - ShaftRefDelay
2 / MechPosition: TP SensorDelay = TP HW Delay - ShaftDelay
3 / RefMechPosition: TP SensorDelay = TP HW Delay - ShaftRefDelay
4 / ShaftMechPosition: TP SensorDelay = TP HW Delay
5 / ShaftMechRefPosition: TP SensorDelay = TP HW Delay
NOTE: The function FC_TPEdge() may only be placed and used in Sercos Phase 4. If the function leaves Phase 4, the TouchProbes must be reactivated when Phase 4 is reached again.
Input |
Data type |
Description |
---|---|---|
i_stTPId |
ST_LogicalAddress |
Measure input |
i_stDevId |
ST_LogicalAddress |
Positions source |
i_diParType |
DINT |
Position type |
i_xPosEdge |
BOOL |
edge |
i_lrLowLimit |
LREAL |
Lower limit value position window |
i_lrHighLimit |
LREAL |
Upper limit value position window |
Data type |
Description |
---|---|
DINT |
0: OK -1: i_stTPId invalid -2: i_stDevId invalid -3: i_diParTyp invalid -5: Measurement impossible because the Sercos bus is not in phase 4 -6: Measurement not possible -7: Measurement not possible because the measuring input is not activated |
CASE diState OF
1:
diResult:=FC_TPEdge(
i_stTPId:=TP.stLogicalAddress,
i_stDevId:= Encoder.stLogicalAddress,
i_diParType:= 0,
i_xPosEdge:= TRUE,
i_lrLowLimit:= -MAXX,
i_lrHighLimit:= MAXX );
diState:=2;
2:
IF TP.CaptureOk = TRUE THEN
lrTP_Pos:= TP.CaptureValue;
...
END_IF
END_CASE