Hello and welcome to a new guide on how to best use Movicon.NExT™.
In this technote, we will introduce you to the power templates and use an example to show you how they are used.
The power templates are symbols to which a structure’s variables have been assigned and then applied with the command to create Power Templates. The practicality of using a powerful template lies in its ability to support multiple instantiations based on the number of declared structures that have been associated.
This guide will use an example to give you a clearer picture on how to use them.
After having started up the Movicon.NExT editor and created, or loaded, a project, start by defining a structure. To do this:
Creata la struttura, è possibile creare due tag di tipo Motor:
Name | Mot1 |
Model Type | Struttura |
Data Structure | Motor |
Name | Mot2 |
Model Type | Struttura |
Data Structure | Motor |
Once you have finished configuring the tags, save the project by clicking on the Save All button in the Movicon.NExT editor toolbar.
At this point, create a 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 Movicon.NExT editor’s toolbar at the top to save the project.
Make sure that the Main screen is open, click on the Symbol Library tab on the editor’s far right, next to the properties window, to open the Symbol library offered by Movicon.NExT.
Place a motor with animation on the screen:
Next, open the ToolBox Library and drag a gauge, either from the Gauges or Advanced Gauges folder, onto the screen. Once placed on screen, assign it the Mot1\Speed tag.
This time,
select and drag the Standard Metro Style button from the Buttons >
Standard folder and assign it the Mot1\State Tag and ON as its text.
Now associate
two commands to change the state of the Motor from 0 to 1 and speed
from 0 to a fixed value such as 80.
To
do this:
Tag | Mot1\State |
Value to set | 1 |
Command Type | Set |
Tag | Mot1\Speed |
Value to set | 80 |
Command Type | Set |
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.
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, open the I/O Data Server’s Settings tab and startup the Server by clicking on the Start Server icon on the toolbar.
When the server starts up, select the object on screen and click the Create Template button on the Movicon.NExT editor’s toolbar. Upon terminating this operation, the Power Template will display showing the association between the symbol and data structure tags. Click OK to confirm.
Double-check to see that the object is still selected, then right-click it to open the contextual menu. Select the Symbol option and then Add to Symbol Library option. In this way, the custom symbol you have just created will be saved in the library and made always available for further use.
Now, you can place the created symbol on screen and drag the Mot2 structure tag onto the symbol to assign it.
Save the project by clicking on the Save All button on the top toolbar of the Movicon.NExT editor.
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 by changing the values using the Movicon.NExT Server.