Sunteți pe pagina 1din 14

EAV9151300

HOWTO | Product 06/2014

Vijeo Designer/Magelis HMI


Recipe Name Search Tool

Retain for future use.

Introduction Vijeo Designer software provides a recipe management tool that is available
in Magelis HMI during runtime. This tool can support storage and control for
up to 8192 individual recipes.
During production an operator may need to quickly find and access a
specific recipe. A custom recipe name search script can help locate an
exact recipe or prompt the user when a recipe name has not been found.
This document shows a typical configuration for creating initial recipes, as
well as a method for implementing a custom recipe name search tool which
can be added to any Vijeo Designer project.

Implementing a Recipe Name 1. Start a new project or open an existing project in Vijeo Designer:
Search Tool Figure 1: Start or Open a Vijeo Designer Project

2. Navigate to Recipes within the Vijeo project tree to add new Recipe
Groups and Individual Recipes:
Figure 2: Navigate to Recipes

2014 Schneider Electric All Rights Reserved


Vijeo Designer/Magelis HMI EAV9151300
Implementing a Recipe Name Search Tool 06/2014

3. To add a recipe group, right-click on Recipes and select New Recipe


Group:
Figure 3: Select New Recipe Group

4. Enter the recipe label name by clicking in the Label field, then entering a
unique recipe name:
NOTE: Duplicate recipe labels are not allowed.

Figure 4: Enter a Recipe Label Name

5. Add the first ingredient variable by typing in a variable name or by


selecting an existing variable, available from the list:
Figure 5: Enter the First Ingredient Variable

6. Select New Ingredient icons to add the additional ingredient variables


as needed:
NOTE: A maximum of 1024 ingredients is allowed in each recipe.

Figure 6: Enter New Ingredients as Needed

2 2014 Schneider Electric All Rights Reserved


EAV9151300 Vijeo Designer/Magelis HMI
06/2014 Implementing a Recipe Name Search Tool

7. Add the additional recipes with their ingredients to the existing recipe
group as needed.
NOTE: A maximum of 256 recipes is allowed in each recipe group.

Figure 7: Add Additional Recipes as Needed

8. Repeat Steps 3 through 7 to add additional recipe groups to the project.


NOTE: A maximum of 32 recipe groups per HMI target is allowed.

Figure 8: Add Recipe Groups

2014 Schneider Electric All Rights Reserved 3


Vijeo Designer/Magelis HMI EAV9151300
Implementing a Recipe Name Search Tool 06/2014

9. Add a new graphic panel to the project or open an existing panel to add
recipe parts from the Toolchest library:
a. Click on the Toolchest icon from the Menu bar or go to Tools >
Toolchest to access a Toolchest library browser.
b. Navigate to a Recipe folder and locate the RG_RSelection object.
c. Select the RG_RSelection object and drag it into the graphical panel
area.
Figure 9: Add Recipe Parts from the Toolchest Library

10. From the Main Menu bar, go to Draw > Data Display:
a. Select a String Display object and add it to the graphic panel.
b. Double-click on String Display to edit its settings:
Enable Input Mode: Checked
Display Length: 40
Style: 00026
Plate Color: White (This color makes it possible for the operator to
enter a recipe search name during runtime)
Figure 10: Edit String Display Settings

4 2014 Schneider Electric All Rights Reserved


EAV9151300 Vijeo Designer/Magelis HMI
06/2014 Implementing a Recipe Name Search Tool

c. Start to assign a new variable by accessing Expression Editor Pad:


Figure 11: Access Expression Editor Pad

d. Click on a New Variable button:


Figure 12: Click on a New Variable Button

e. Create a searchName variable with the following properties:


Data Type: String
Data Source: Internal
Figure 13: Data Type and Data Source

2014 Schneider Electric All Rights Reserved 5


Vijeo Designer/Magelis HMI EAV9151300
Implementing a Recipe Name Search Tool 06/2014

NumofBytes: 40
Figure 14: NumofBytes

11. From the Main Menu bar go to Draw > Switch and add a recipe search
name push button to the graphic display. Double-click on it to edit the
push button's style, color, and text and to assign an operation which
executes when the button is pressed:
Figure 15: Double-Click on the Button to Edit It

12. Create a new variable, name it StartScan, and assign it to a When


Touch push button operation:
Operation (Pull-Down Menu): Bit
Operation: Set
Destination: StartScan
Figure 16: Switch Settings

6 2014 Schneider Electric All Rights Reserved


EAV9151300 Vijeo Designer/Magelis HMI
06/2014 Implementing a Recipe Name Search Tool

13. A StartScan variable has the following properties:


Data Type: BOOL
Data Source: Internal; when set True this variable triggers a recipe
search name script action (configured in step 17)
Figure 17: StartScan Variable Properties

14. From the Main Menu bar, go to Draw > Data Display:
a. Select an additional String Display object and add it to the graphic
panel.
b. Double-click on String Display to edit its settings:
Display Length: 44
Style: 000000 (This shows the recipe search name result)
Figure 18: Add a String Display Object

2014 Schneider Electric All Rights Reserved 7


Vijeo Designer/Magelis HMI EAV9151300
Implementing a Recipe Name Search Tool 06/2014

15. Create a msgResult variable and assign it to the String Display object.
A msgResult variable has the following properties:
Data Type: String
Data Source: Internal
NumOfBytes: 44
Figure 19: String Display Settings

16. Create additional variables which will be used in recipe search name
script.
a. Navigate to Variables within Vijeo project tree, right-click on
Variables to select a New Variable, and then select Variable from
the pull-down menu.
Figure 20: In the Vijeo Project Tree, Right-click on Variables

8 2014 Schneider Electric All Rights Reserved


EAV9151300 Vijeo Designer/Magelis HMI
06/2014 Implementing a Recipe Name Search Tool

b. Create a RecipeSearchCase variable with the following properties:


Data Type: INT
Data Source: Internal (this keeps track of the recipe search name
script progress)
Figure 21: Create a RecipeSearchCase Variable

c. Create a RecipeFound variable:


Data Type: BOOL
Data Source: Internal (used for setting a flag when a specific recipe
name is found)
Figure 22: Create a RecipeFound Variable

17. Create an action which will be triggered by the StartScan variable


configured in step 12.
a. From the Main Menu, go to Actions and insert a New Action:
Figure 23: Select New Action from the Actions Menu

2014 Schneider Electric All Rights Reserved 9


Vijeo Designer/Magelis HMI EAV9151300
Implementing a Recipe Name Search Tool 06/2014

b. Edit action settings for the following:


Trigger Type: Periodic
Enable Interlock: Checked and StartScan variable assigned
Frequency (Seconds): 0.1
Scheduling: Normal
Then press the Next button for additional settings:

Figure 24: Edit Action Settings

c. Select Script from the Operation pull-down menu and click on New
Script button:
Figure 25: Select Script from the Operation Menu, then Click on
New Script

10 2014 Schneider Electric All Rights Reserved


EAV9151300 Vijeo Designer/Magelis HMI
06/2014 Implementing a Recipe Name Search Tool

d. When the Script Editor window opens, paste the Recipe Search
Name Script (page 12) text inside the window.
NOTE: This script is for demonstration purposes only.
Refer to section 18.1, Programming with Scripts, and 17.3.5, Recipe
Control Variables, available from the Vijeo Designer Help menu, for
more details.
NOTE: The initial value of MAX_GROUP_NR script variable can be
modified to represent the actual number of recipe groups configured
in the Vijeo project.

Figure 26: Paste Search Name Script in the Script Editor Window

2014 Schneider Electric All Rights Reserved 11


Vijeo Designer/Magelis HMI EAV9151300
Implementing a Recipe Name Search Tool 06/2014

Recipe Search Name Script

//Recipe Name Search Script


//For Demonstration Use Only

String name = _RecipeControlDefault.RecipeLabel.getStringValue(); //variable to store recipe name


String mySearch = searchName.getStringValue(); //variable to store search name
int num = _RecipeControlDefault.RecipeNumber.getIntValue(); //variable to store recipe number
int gNum = _RecipeControlDefault.RecipeGroupNumber.getIntValue(); //variable to store recipe group number
int MAX_GROUP_NR =32; //constant variable max. value of 1 to 32

switch (RecipeSearchCase.getIntValue()){
case 0: //initialize
RecipeFound.write(false); //set the flag
_RecipeControlDefault.RecipeGroupNumber.write(1);
_RecipeControlDefault.RecipeNumber.write(1);
msgResult.write("Searching...");
RecipeSearchCase.write(10);
break;

case 10: //search


if(mySearch.length()==0) { // check if search name not blank
StartScan.write(0);
msgResult.write("Search name is empty!");}
else{
if(mySearch.equalsIgnoreCase( name)){ //check if search and recipe names are equal
RecipeFound.write(true); // set the flag
msgResult.write("Recipe name found in group: "+ gNum + //write a result message
" item list: "+num);
StartScan.write(0); // stop the search
RecipeSearchCase.write(0);}
else{
if(name.length()==0){ // check if this is the last recipe in recipe group
if(gNum<MAX_GROUP_NR){ // check if max. recipe group number reached
gNum++;
_RecipeControlDefault.RecipeGroupNumber.write(gNum); // increase the group number
_RecipeControlDefault.RecipeNumber.write(1);} // set rcp. number to 1
else{
msgResult.write("Recipe name not found!"); //write a result message
StartScan.write(0); // stop the search
RecipeSearchCase.write(0);}}
else{
num++;
_RecipeControlDefault.RecipeNumber.write(num);}}} //increase the rcp. number
break;
default:
;
}

12 2014 Schneider Electric All Rights Reserved


EAV9151300 Vijeo Designer/Magelis HMI
06/2014 Implementing a Recipe Name Search Tool

e. Validate the script and click the Apply button:


Figure 27: Validate the Script

f. Click on the Finish button to complete editing action settings:


Figure 28: Complete Editing Action Settings

18. Validate the project and check for errors (Main Menu > Built > Validate
All):
Figure 29: Validate, Check for Errors

19. Save the Vijeo project and download it to the target HMI:
Figure 30: Download Project to the HMI

2014 Schneider Electric All Rights Reserved 13


Vijeo Designer/Magelis HMI EAV9151300
HOWTO | Product 06/2014

20. After successfully downloading the project to the HMI and restarting the
device, navigate to the panel with the Recipe Name Search tool, click in
the text box, and enter a search name:
Figure 31: Enter a Search Name

Enter Product D for the search name and press the Enter key on the
HMI on-screen keyboard (search name is not case sensitive):

Figure 32: HMI Keyboard

Press the search button and wait for the result to be displayed:

Figure 33: Search Result

The message displays a result if no recipe name is found:

Figure 34: No Recipe Name Found

Electrical equipment should be installed, operated, serviced, and maintained only by


qualified personnel. No responsibility is assumed by Schneider Electric for any
Schneider Electric USA, Inc. consequences arising out of the use of this material.
18001 Knightdale Blvd. 2014 Schneider Electric All Rights Reserved
Knightdale, NC 27545 Schneider Electric and Square D are trademarks owned by Schneider Electric
1-888-778-2733 Industries SAS or its affiliated companies. All other trademarks are the property of
www.schneider-electric.us their respective owners.

14