Creating dynamic movement animations

Introduction

Hello and welcome to a new guide on how to best use Movicon.NExT™.

In this technote, we will use an example to show you how to animate an object by making it follow a predefined path.

Example

To obtain movement animations, Movicon.NExT offers an animation feature called Composed Movement to enable you to do this.
This guide uses an example to give you a better idea of how this is done.
This example is very simple: an object will be overlapped on a polyline object on screen. The polyline will represent the path which the object will follow. A switch will also be placed on the screen to control the animation.

Tag creation

After having launched the Movicon.NExT development environment and created, or loaded, a project, proceed with creating the tag which will be used to animate the objects. To do this:

Once you have finished configuring the tag, save the project by clicking Save all icon on the Movicon.NExT editor’s toolbar.

Screen creation

Now create a screen if not already done so:

Once the screen has been created, you can then change the project's properties by inserting the screen as the project's Main screen which will show when the project starts up. To do this:

Once you have finished configuring the project startup page, click on the Save All icon located on the toolbar at the top to save the project.

Double-check that the Main screen is open then click on the Toolbox tab on the far right of the editor next to the Properties window.
Drag the Rectangle and Polyline objects from the Draws folder onto the screen. Then drag a Simple Switch from the Switches>Toggle Switches folder onto the screen.

Assign the boolTag tag to the switch by filling in the Tag field in the Properties window, or by dragging the tag from the project tree onto it and resize the rectangle to look like a square.

Select the polyline and configure it:

Select the square and place it on one of the polyline’s ends.

Double-check that you have selected the square, open the Animations tab located at the bottom of the Movicon.NExT development environment.
Open the animations panel, scroll the available options and select the Composed Movement animation from the list.
Now that the Composed Movement animation has been added to the list of animations associated to the object, enter the boolTag tag in the Tag field, select the Trigger option in the Execution Type field, and enter Polyline in the Path Line Control name field. Enable the Use Barycenter and Auto-Reverse options and increase the Animation Time from 1000 to 5000 milliseconds.

Click on the Save All icon located on the toolbar at the top of Movicon.NExT editor to save the project.

Test Runtime

To test everything, launch the project into runtime by clicking on the Start Runtime icon.
When clicking on the switch at runtime, the boolTag tag’s value should change from 0 to 1 triggering the square to follow the path defined by the polyline.