Geometric definition
Planar tracks are defined step-by-step using connected straight lines, arcs and points. The connection between these elements is made automatically via C2-continuous interpolation (“blending”).
- Straight lines are defined via a start and an end point, see AppendLine.
- Arcs are defined by a start, an end and a center point and by specifying the direction clockwise or counterclockwise, see AppendCircle.
- Positions are only defined via a point, see AppendPosition.
Example
In the following example, the automatically generated parts of the track are shown in red.

PROGRAM MAIN
VAR
track : MC_PlanarTrack;
pos1, pos2 : PositionXYC;
center : PositionXY;
state : UDINT;
END_VAR
CASE state OF
0:
pos1.SetValuesXY(0, 0);
pos2.SetValuesXY(400, 0);
track.AppendLine(0, pos1, pos2);
pos1.SetValuesXY(450, 50);
pos2.SetValuesXY(450, 450);
track.AppendLine(0, pos1, pos2);
pos1.SetValuesXY(450, 500);
pos2.SetValuesXY(550, 500);
center.SetValuesXY(500, 500);
track.AppendCircle(0, pos1, pos2, center, TRUE);
pos1.SetValuesXY(600, 400);
pos2.SetValuesXY(700, 150);
track.AppendLine(0, pos1, pos2);
pos1.SetValuesXY(600, 50);
track.AppendPosition(0, pos1);
pos1.SetValuesXY(700, 0);
pos2.SetValuesXY(900, 0);
track.AppendLine(0, pos1, pos2);
END_CASE