VAR
_TempPointVelocity : ARRAY[1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX] OF LREAL;
_TempPointAcceleration : ARRAY[1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX] OF LREAL;
_TempPointJerk : ARRAY[1..KINEMATIC_CONSTANTS.DEGREES_OF_FREEDOM_MAX] OF LREAL;
END_VAR
CASE SequenceState OF
0: // Add Point 1-4
IF RobotKinematic.CamAddPointToPath( MotionFunctionFirstPoint := MC_MotionFunctionType.MOTIONFUNCTYPE_POLYNOM5,
MotionFunctionThisPoint := MC_MotionFunctionType.MOTIONFUNCTYPE_POLYNOM5,
PointNumber := 2,
TotalPointsInTable := 5, // Minimum of 2 (Start Point + End Point), Start Point is automatically set by FB internally
PointVelocity := _TempPointVelocity, // at this Point in Cam Table
PointAcceleration := _TempPointAcceleration, // at this Point in Cam Table
PointJerk := _TempPointJerk, // at this Point in Cam Table
PointIndex := 1) // Index of Point in structure of ST_BasePoint
AND
RobotKinematic.CamAddPointToPath( MotionFunctionFirstPoint := MC_MotionFunctionType.MOTIONFUNCTYPE_POLYNOM5,
MotionFunctionThisPoint := MC_MotionFunctionType.MOTIONFUNCTYPE_POLYNOM5,
PointNumber := 3,
TotalPointsInTable := 5, // Minimum of 2 (Start Point + End Point), Start Point is automatically set by FB internally
PointVelocity := _TempPointVelocity, // at this Point in Cam Table
PointAcceleration := _TempPointAcceleration, // at this Point in Cam Table
PointJerk := _TempPointJerk, // at this Point in Cam Table
PointIndex := 2) // Index of Point in structure of ST_BasePoint
AND
RobotKinematic.CamAddPointToPath( MotionFunctionFirstPoint := MC_MotionFunctionType.MOTIONFUNCTYPE_POLYNOM5,
MotionFunctionThisPoint := MC_MotionFunctionType.MOTIONFUNCTYPE_POLYNOM5,
PointNumber := 4,
TotalPointsInTable := 5, // Minimum of 2 (Start Point + End Point), Start Point is automatically set by FB internally
PointVelocity := _TempPointVelocity, // at this Point in Cam Table
PointAcceleration := _TempPointAcceleration, // at this Point in Cam Table
PointJerk := _TempPointJerk, // at this Point in Cam Table
PointIndex := 3) // Index of Point in structure of ST_BasePoint
AND
RobotKinematic.CamAddPointToPath( MotionFunctionFirstPoint := MC_MotionFunctionType.MOTIONFUNCTYPE_POLYNOM5,
MotionFunctionThisPoint := MC_MotionFunctionType.MOTIONFUNCTYPE_POLYNOM5,
PointNumber := 5,
TotalPointsInTable := 5, // Minimum of 2 (Start Point + End Point), Start Point is automatically set by FB internally
PointVelocity := _TempPointVelocity, // at this Point in Cam Table
PointAcceleration := _TempPointAcceleration, // at this Point in Cam Table
PointJerk := _TempPointJerk, // at this Point in Cam Table
PointIndex := 4) // Index of Point in structure of ST_BasePoint
THEN
SequenceState := 10;
END_IF
10: // Check for Points added successfully
IF NOT RobotKinematic.Error AND NOT RobotKinematic.Busy THEN
SequenceState := 20;
END_IF
20: // Cam In
IF RobotKinematic.CamIn() THEN
SequenceState := 30;
END_IF
30: // Check Cammed In
IF RobotKinematic.CammingActive AND NOT RobotKinematic.Error AND NOT RobotKinematic.Busy THEN
SequenceState := 40;
END_IF
40: // Start move Kinematic
IF RobotKinematic.CamStartMovePath( TargetMoveVelocity := Parameter_Kinematic.CamDefaultMoveVelocity, // Move Velocity for Cam Table Master !!!Needs to consider all Slave dynamics, all Slaves try to follow Master setpoints!!!
TargetMoveAcceleration := Parameter_Kinematic.CamDefaultMoveAcceleration, // Move Acceleration for Cam Table Master !!!Needs to consider all Slave dynamics, all Slaves try to follow Master setpoints!!!
TargetMoveDeceleration := Parameter_Kinematic.CamDefaultMoveDeceleration, // Move Deceleration for Cam Table Master !!!Needs to consider all Slave dynamics, all Slaves try to follow Master setpoints!!!
TargetMoveJerk := Parameter_Kinematic.CamDefaultMoveJerk )
THEN
SequenceState := 50;
END_IF
50: // Kinematic Moving or Done
IF RobotKinematic.Moving OR ( NOT RobotKinematic.Error AND NOT RobotKinematic.Busy AND NOT RobotKinematic.Moving ) THEN
SequenceState := 60;
END_IF
60: // Move Complete
IF NOT RobotKinematic.Error AND NOT RobotKinematic.Busy AND NOT RobotKinematic.Moving THEN
SequenceState := 70;
END_IF
70: // Cam Out
IF RobotKinematic.CamOut() THEN
SequenceState := 80;
END_IF
80: // Check Cammed Out
IF NOT RobotKinematic.CammingActive AND NOT RobotKinematic.Error AND NOT RobotKinematic.Busy THEN
SequenceState := 90;
END_IF
90: // Clear Path
IF RobotKinematic.CamClearPath() THEN
SequenceState := 0; // Repeat Path
END_IF
999: // Done
;
END_CASE