Home

mlamp

Download project

3D Path Generator

This example demonstrates the use of the visualization element ‘Path3D’.
Path3D is designed to be used in combination with CODESYS SoftMotion (see the CNC 3D Editor example).
However, this example shows the application of it independently from CODESYS SoftMotion.

Product description

A path with 2200 points in the shape of a gate is created in this example. The generated path is visualized in yellow.
Parts of the path are highlighted in red, by setting the member variable udiSourceElementID of VisuStruct3DPathPoint and the
visualization property Highlighting variable. The track is calculated from the points of the path.

The data structure ‘VisuStruct3DTrack’ of System_VisuElem3DPath.library is used for hosting the points of the path and the track.

More information

PLC_PRG: The main program of this example instantiates an element of VisuStruct3DControl for navigating in the 3D model.
It also creates an instance of PathGenerator (FB) that generates the path and calculates the track. Both structure instances
are linked with the appropriate visualization element.

PathGenerator(FB): This function block first creates a path of 2200 points. Afterwards, the track, which moves along the path,
is calculated with the help of a ring buffer. That means, when the buffer is full, the next point will be saved at the
beginning and the starting point will be incremented by one and so on.

Visualization: The visualization object Path3D uses the information of the VisuStruct3DTrack elements ‘Path’ and ‘Track’ and the instance
of VisuStruct3DControl for the 3D model. In the Path3D Properties the color of the path and the track can be changed.
Also the color for highlighting specially elements of the path can be chosen.

System requirements and restrictions

System requirements and restrictions Info
Programming System CODESYS Development System Version 3.5.14.0 or higher
Runtime System CODESYS Control Version 3.5.14.0
Required Accessories -

Screenshot thumbnail
Screenshot of Visualization