Recipe Commands

Introduction

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

In this technote we are going to use an example to show you how to use commands relating to recipes, offered by the Movicon.NExT platform, to create a custom interface.

The Recipes

In addition to the Recipe Viewer objects, Movicon.NExT offers a series of useful commands to manage recipes with.
These commands can be associated to any of the graphical objects, such as buttons for example, to create custom interfaces.
It is important to note that in this case you will need to create dummy tags so that the recipe loaded from the database is not directly activated on the PLC or vice-versa.

Example

This example has been created to be connected to the RSSim modbus simulator that simulates communications with the field. There is also a screen with two display objects assigned to tags communicating with the field and two display objects assigned to tags communication with the database. We will also use a DB Grid Control object to show the recipes saved on the database, some buttons with commands to manage the recipes, a display object to display the name of the recipe, and a combo-box to select recipes saved on the database.
First, we shall launch the Modbus simulator by double-clicking on the executable’s icon.

Enter and configure the Modbus TCP-IP driver

After having opened the Movicon.NExT development environment and created a new project:

Creating tags

We shall now define an Int16 type tag to connect to the PLC simulator. To do this:

Next, we shall go ahead and create a second tag to connect to the PLC simulator:

Creating temporary tags

Now that we have created the I/O tags, we shall continue with creating the dummy tags in the following way:

Repeat these steps to create the second tag:

Creating tags to manage the recipe

We shall now create the tags to manage the recipes by repeating the above steps but by configuring each tag in the following way:

Now the tags have been configured, we can save the project by clicking on the Save All icon on the Movicon.NExT editor's main toolbar.

Creating the recipe

Now that we have created the driver and tags, we shall continue with creating a recipe in the following way:

Creating the recipe database

Now, we have reached the point where we need to create the recipe database:

Creating a screen

Next, we shall create a screen in this way:

Once the screen has been created, we can now change the project's properties by inserting the screen as the project's Main screen to show when the project starts up. To do this:

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

Make sure that the Main screen is open, click on the Toolbox tab on the far left of the editor, next to the Properties window, to open the ToolBox library offered by Movicon.NExT.
Drag four Display objects from the Displays folder onto the screen.
Assign the RicTag1 tag to the Display object in this way:

Repeat this procedure for the remaining three Display objects by assigning the RicTag2 RicTag2, DummyRicTag1 and DummyRicTag2 tags.

Return to the Toolbox library and drag a Standard Metro Style button from the Standard Buttons subfolder onto the screen.
Select it to open its properties window and configure its Text property by inserting the string saved on DB by using the textbox within this property.
Select the button again and open the commands tab at the bottom of the editor and select the Recipe command to add it to the command list associated to the button. Configure the command by entering the name of the recipe in the Recipe Name field and select Save To DB as Command type.

Repeat this procedure for another four buttons in this way:

Place a Display object on the screen and assign it the RicTagIdx tag by simply selecting it from the combobox.

Repeat this procedure by using a Combobox object from the Toolbox library’s DB Connectors folder. This time, assign the RicTagList tag to the object’s Tag Item Source property.

We will now insert and configure the last object on screen. Go to the same folder and drag a DB Grid Control object onto the screen. Select and open its properties window and find the Object Configuration property and click on the corresponding three dots.
When the Smart Property window opens, click on the Control DataSource Editor button to configure the query that will resolve the object. To do this, first configure the connection string using the wizard which is activated by double-clicking on the corresponding three dots. Then, fill in the Select field by again clicking on the corresponding three dots to open the wizard to do this.
Click OK to confirm the configuration.

SSave the project by clicking the Save All icon on the Movicon.NExT editor’s Toolbar.

Runtime Test

To test what we have just created in runtime, click on the Start Runtime icon.
You should be able to manage the recipes independently between DB and PLC at runtime by using the custom interface that we have just created.