Parametrizing Screens

Introduction

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

In this technote, we are going to show you how to create and use parameterized screens.

Parameterized screens.

Movicon.NExT offers a screen parameterization feature which consists of creating screens with parameters rather than tags by using a table purposely configured for this so that the platform can use it to associate the correct tags to the parameters at project runtime.The key advantage of using this feature is that you will only need to create one screen which can then be called several times according to the parameterization files used. This not only optimizes time spent on developing your project, but also gives your project greater agility.

This guide will use an example to give you a better understanding of how this is done.

Example

We shall start by first by opening the Movicon.NExT editor and creating, or loading, a project.

Creazione delle tag

To use the parameterized screens, you will need to define the alias tags and the current tags. In this example, we will create three alias tags and then repeat the same procedure to create the same number of tags to associate to two motors. To do this:

Now add another two tags to the Aliases folder by repeating the same procedure used for the first tag.  Configure the tags in this way:

Name Speed
Model Type Variabile
Data Type Int16


Name State
Model Type Variabile
Data Type Boolean

Once you have defined the alias tags, create the same tags for Motor1 and Motor2. Therefore, with the tag list opened:

Add another two tags to the Motor1 folder by using the same procedure as before. Configure the tags as follows:


Name Speed
Model Type Variabile
Data Type Int16


Name State
Model Type Variabile
Data Type Boolean

Repeat the procedure used for Motor1 to create the tags for Motor2. Therefore, with the Tag List open:

Add another two tags to the Motor2 folder by using the same procedure as before. Configure the tags as follows:


Name Speed
Model Type Variabile
Data Type Int16


Name State
Model Type Variabile
Data Type Boolean
 

Once you have finished configuring the tags, save the project by clicking on the Save All button in the Movicon.NExT editor toolbar.

Creating parameterization files

Now that all the tags have been defined, you will first need to create the parameterization files and then the screens.
Let’s proceed with creating the parameterization files.
Look for the Parameters module on the Movicon.NExT editor’s Project Explorer window’s project tree.  Select and right-click it and then select the New option from the contextual menu that appears.
A list will appear with two columns within the workspace: Aliases and Tags. This list is vital for associating the alias tags to the actual tags.  To compile this list:  

Repeat this procedure for this pair of Alias\Speed – Motor1\Speed tags and for this pair of Alias\State – Motor1\State tags..

Once you have finished compiling the list, select it from the project tree and right-click it. Select the Rename option from the contextual menu that appears to change the name of the list to Motor1.

Create and compile a new list to associate the Alias tags to the Motor2.  When you have finished compiling the parameterization file, rename the list to Motor2.

Creating Screens

After the parameter files have been created, you can now go ahead and create two screens: a main screen with two buttons to open a popup for Motor1 and a popup for Motor2 respectively. The popup that opens upon pressing the buttons, will contain a graphical motor object and two display objects. To create the popup:

Make sure you have selected the Popup screen and open its properties window to change the following properties in this way:

Make sure that the Popup_Motor screen is open and click on the Toolbox tab on the far right of the editor, next to the properties window tab, to open the Toolbox library offered by Movicon.NExT.
Place a graphical Display object from the Display folder by selecting and dragging it onto the screen.  Then associate the Alias\Speed tag to the Display object by selecting it from the combobox or clicking on the three dots corresponding to the Tag field and selecting it from the Tag list that shows.
Stay in the object’s properties window and look for the Unit Label property and enter the Speed string in its field.
Make a duplicate of the Display object you have just created by clicking on it and using CTRL+C and CTRL+V combo keys in sequence.
Reposition the duplicated Display object by dragging it to a position on screen where they can both be seen.
Select the new Display and change its Tag property to Alias\Current and the Unit Label property from Speed to Current.
Make sure that the Popup_Motor screen is open, open the Symbol Library and go to the Motors > Digital Animated folder and select the Motor1 symbol and drag it onto the screen.
Assign the Alias\State tag to the symbol by selecting the tag from the combobox or by clicking on the three dots corresponding to the Tag field and selecting it from the tag list that appears.
Insert the last object on screen by going to the Buttons > Standard folder in the Toolbox library and dragging a Standard Metro Button onto the screen.
Once inserted on screen, select it and open its properties window.  Find the Text property and enter the Close string in the property’s field.
With the button still selected, open the Commands tab at the bottom of the editor.  Select the Screens command to add it to the Commands List and then Configure it in this way:

Select the Popup_Motor screen from the list of screens on the project tree and open the properties window.  Find the Window State property and change its value from Maximized to Normal.

Now create the main screen:

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, to open the Toolbox offered by Movicon.NExT.
Place a Standard Metro Button from the Buttons > Standard folder in the Toolbox library on the screen. Once placed on screen, select it and open its properties window.  Go to its Text property and enter the Motor1 string in the corresponding field.
With the button still selected, open the Commands tab at the bottom of the editor. Select the Screens command to add it to the Commands List and then Configure it in this way:

Make a duplicate of the button you have just created by clicking on it and using CTRL+C and CTRL+V combo keys in sequence. Reposition the duplicated button by dragging it to a position on screen so that both buttons can be seen. SeleSelect the new button and change its Text property to Motor2. With the Motor2 button still selected, open the Commands tab and change the Parameter File property from Motor1 to Motor2.

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 Motor1 button in runtime mode, the popup relating to Motor1 should appear and likewise for the second button.

You can change the values of the tags corresponding to Motor1 and Motor2 from the OPC UA Browser offered by the Movicon.NExT platform see check that everything is functioning correctly.