Using Alias

Introduction

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

In this technote, we will introduce you to the concept of using aliases in graphical objects used in Movicon.NExT projects and what is the advantage of using this mechanism.

Aliases in graphic objects

The use of aliases in graphical objects allows you to substitute variables with alias tags in the object’s tag field.

Once the alias tags have been defined, they can then be matched separately with a server variable in an appropriated table.

At runtime, the Movicon.NExT platform will replace each alias tag with their matched server tag as defined in the table by the developer.  

The main advantage of using this development method is that the objects are uniform; for example, once you have created custom objects and saved them in the Symbols Library, you will only need to compile the alias table once for each object.

Alias tags can be connected to server tags, local client tags or the client’s system tags.  However, they cannot be connected to tags from other projects or remote servers.

The basic syntax of an alias tag is <<VariableName>>, so in the tag field it will be <<AliasTag>>  with the match between the AliasTag and ProjectTag defined in the Alias Table.

In addition to tags, the aliases can also be used for:

They can also be used in Basic Scripts used at screen level, and not in individual objects, using the following syntaxes:

Not only can aliases be defined at simple object level but at composed graphical symbol and screen level as well.

Alias tags and project tags are matched in the Alias Table which is then saved in the object’s or the corresponding screen’s XML code.At project runtime, Movicon.NExT resolves the match between the Aliases and tags using the compiled Alias Table.  This resolution always takes place from the lowest to the highest level.

To compile the Alias Table, simply select and right-click the graphical object. Once the contextual menu appears, select the Edit Alias option to open the Alias Table.

The table should already be populated with aliases that have been inserted in the graphical object; therefore, you will only need to match the aliases and project tags by selecting the project tag from the combobox.

Once you have finished doing this, simply confirm and then launch the project into runtime mode.

Example

We will now use an example to give you a better idea on how this is done.  .
This example will consist of building a data structure representing a motor with state and speed controls. Two structure tags will be defined, a screen will be created with a gauge to represent the motor’s speed, and a graphical object in the form of a digitally animated motor to control its operating state.  Two buttons will also be added, one to start the motor engine and set its speed, and one to turn it off and reset its speed..

Creating the data structure

Start up Movicon.NExT in design mode, load, or create, a project and then define a structure in this way::

Creating tags

Once that the structure has been created, you can now create to Motor type tags in this way::

Creating the synoptic

After the data structure has been completed, create a screen in this way:

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 and then click on the Toolbox tab, offered by Movicon.NExT, on the far right of the editor next to the Properties window.

Go to the Buttons > Standard folder, select and drag the Standard Metro Style button onto the screen.  Once on screen, assign it the alias tag using the <<AliasTag1>> syntax and enter ON in the text field.

Assign two commands to change the Motor state from 0 to 1 and the speed from 0 to a fixed value, such as 80 for instance.

To do this::

Duplicate the ON button for motor 1 and change the text from ON to OFF and the values in the commands from 1 to 0 and from 80 to 0 respectively. .

Place a motor with animation on the screen::

Now that the motor has been placed on the screen, do the same for the gauge by selecting one from the Gauge folder or Advanced Gauge folder.  This time, assign the <<AliasTag2>> tag to the gauge..

Select and right-click all the objects. Then select the Symbol item from the contextual menu that opens and select Create group, and then select Group.  You can also use the Ctrl+G combo keys to get the same result.
[Once the objects have been grouped, right-click it to open the contextual menu again and select Symbol > Add to Symbol Library. In this way, the custom symbol you have just created will be saved in the library and made always available for further use.]

Now that we have finished configuring the graphical object, open the Alias table by right-clicking on the symbol and selecting Edit Alias from the contextual menu that appears. .
The Alias Table should display showing all the aliases that have been configured in the object; which are AliasTag1 and AliasTag2.
Associate the Mot1:State and Mot1:Speed tags to the AliasTag1 and AliasTag2 aliases respectively by using the combox in the table to select them.
Click OK to confirm.

Duplicate the symbol you have just created by using the CTRL+C e CTRL+V combo keys..
Compile the alias table as you did beforehand for the first object but this time associate the Mot2:State and Mot2:Speed tags to the AliasTag1 and AliasTag2 aliases respectively. Click OK to confirm.

Save the project by clicking on the Save All button on the top toolbar of the Movicon.NExT editor.

Runtime Test

Launch the project into runtime by clicking the Start Runtime button on the toolbar of the Movicon.NExT editor to test everything you have created so far. When clicking on the ON and OFF buttons, you should be able to change the state and speed of the associated motor. You can also check if the example is working properly by checking the values of the tags in the Watch Window which can be activated using the CTRL+F5 combo keys.