Ptp
![]() | Core function is not supported by inverter axes This core function is not supported by inverter axes. Any use will report DEVICE_NOTINIT and trigger an error message. |

This core function is used to perform multi-segment movements with the possibility to switch to torque or constant output clamping at the end.
Syntax:
FUNCTION_BLOCK FB_Ptp EXTENDS FB_CorefunctionFeedback
Properties
FB_Ptp | |||
ActiveSegment | INT | Get | The number of the point that is currently being approached. |
IsClamping | BOOL | Get | TRUE if the core function has switched the axis to clamping. |
MovingNegative | BOOL | Get | TRUE if the axis is actively moving in the negative direction. |
MovingPositive | BOOL | Get | TRUE if the axis is actively moving in the positive direction. |
NumberOfPoints | INT | Get | The number of points that the core function can store. |
FB_CorefunctionFeedback | |||
AbortedState | BOOL | Get, Set | Signals the abort of a command by another Corefunction. |
BusyState | BOOL | Get, Set | Signals the active execution of a command. |
DoneState | BOOL | Get, Set | Signals the successful execution of a command. |
IdleState | BOOL | Get, Set | The Corefunction is ready for operation and commandable. |
IsCommanded | BOOL | Get | Signals the pending of a command. |
FB_Corefunction | |||
FailedState | BOOL | Get, Set | If IsActivated is TRUE at the same time: Signals the failure of an accepted command. If IsActivated is FALSE at the same time: Signals the rejection of a command. |
HasFeedback | BOOL | Get | The core function has responded to a pending command. |
IsActivated | BOOL | Get | The core function has an accepted command pending. |
IsLocalCmd | BOOL | Get | Signals that the axis is assigned with a command of this core function. |
ReadyState | BOOL | Get, Set | The Corefunction is ready for operation, but is not commandable at this time. Possible reasons are: |
Methods
Name | Description |
---|---|
[ | This method is called cyclically by the axis. |
FB_Ptp | |
The specified segment is compared with the axis parameters. | |
The execution is triggered. | |
A segment of the clamping table is read back. | |
A segment of the lookup table is read back. | |
A segment of the lookup table is read back. | |
InvalidateClampPoint() | All segments in the clamping table are marked as invalid. |
InvalidateTable() | All segments in the lookup table are marked as invalid. |
A segment of the clamping table is defined. | |
A segment of the lookup table is defined. | |
The target position of the segment is changed after it is defined. |
Interfaces
Type | Description |
---|---|
I_Corefunction | Standard interface on FB_Corefunction. |
I_Ptp | Standard interface on FB_Ptp. |
I_CorefunctionFeedback | Standard interface on FB_CorefunctionFeedback. |
Example:
CASE nState OF
0: // define 2 example points
stLookupPtpPoint.Position := 100.0; // [mm]
stLookupPtpPoint.Velocity := 20.0; // [mm/s]
stLookupPtpPoint.Valid := TRUE; // validate point
// assign first point
IF FAILED(iAxisBase.Ptp.SetPoint(1, stLookupPtpPoint)) THEN
nState := -1;
END_IF
stLookupPtpPoint.Position := 20.0; // [mm]
stLookupPtpPoint.Velocity := 30.0; // [mm/s]
// assign second point
IF FAILED(iAxisBase.Ptp.SetPoint(2, stLookupPtpPoint)) THEN
nState := -1;
END_IF
// send the axis to travel
IF FAILED(iAxisBase.Ptp.DoMove(TRUE)) THEN
nState := -1;
ELSIF nState >= 0 THEN
nState := nState + 1;
END_IF
1: // observe the movement
IF iAxisBase.Ptp.FailedState THEN
nState := -1;
ELSIF iAxisBase.Ptp.DoneState THEN
nState := nState + 1;
END_IF
2, // done
-1: // error
iAxisBase.Ptp.DoMove(FALSE);
END_CASE
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT v3.1.4024.35 | PC or CX (x64, x86) | Tc3_PlasticFunctions v3.12.4.26 or higher |