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”).

Example

In the following example, the automatically generated parts of the track are shown in red.

Geometric definition 1:
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