EcoStruxure Machine Expert provides 2 ways to create a function template:
From the
view using the dialog box.From the
or using the dialog box.The following paragraphs list the steps that have to be performed in order to save already available application functions that meet the criteria stated in Application Functions as Basis for Function Templates as function templates.
The procedure via
view allows you to create your own function template by dragging and dropping elements:
Step |
Action |
---|---|
1 |
In the view, expand the section . |
2 |
Select the node, and click the green plus button.Result: A new node with the default name is inserted below the node. |
3 |
Select the node and click the green plus button.Result: The dialog box displays.![]() |
4 |
In the tab of the dialog box, enter a for your function template.Drag the elements you want to include in the function template from the to the box of the tab. The elements listed in this box is inserted in your function template.
NOTE: The elements must belong to the same application.
|
5 |
The tab of the dialog box displays those variables that are included in the elements you selected in the tab.![]() From the list of variables, select those you want to declare as template parameters by selecting the check box of the variable or of a node. |
6 |
The tab of the dialog box allows you to add further information to the function template.You can insert a link to the online help of this function template. The dialog box allows you to add further textual information that can be localized, and you can add a graphic illustrating this function template. For a description of these parameters, refer to the chapter Adding Further Information for Templates or Template Libraries. |
7 |
Click the button. |
To save an already available application function as function template, proceed as follows:
Step |
Action |
---|---|
1 |
Right-click a subfolder of an application node in the or a functional model node in the . |
2 |
Execute the command from the contextual menu.Result: EcoStruxure Machine Expert automatically builds the application. After the built process has been successfully completed, the dialog box is displayed. ![]() |
3 |
Define the new function template as stated below. |
4 |
Click to close the dialog box and to create your new function template.Result: EcoStruxure Machine Expert verifies that the function template can be created and displays a message that the function template has been created successfully or indicates the errors detected. |
In the
text box of the dialog box, define the name under which the function template is stored in the template library. By default, this text box contains the name of the folder that contains your application function in the but you can adapt the name to your individual requirements.To select one of the previously installed or created template libraries in which your new function template should be stored, proceed as follows:
Step |
Action |
---|---|
1 |
In the dialog box, click the button next to the text box.Result: The dialog box is displayed. |
2 |
The dialog box displays the template libraries that have been installed for the open project or have been created. Write-protected libraries are not displayed.To add your new function template to one of these template libraries, select the suitable entry and click . |
You can define variables of the function template as template parameters.
To define variables of the function template as template parameters, proceed as follows:
Step |
Action |
---|---|
1 |
In the dialog box, click the button to the right of the text box.Result: The dialog box is displayed.It displays the variables that are defined in the selected application. |
2 |
Select the check box of an individual variable to select it as template parameter for the function template. Or select the check box of a root node to select all elements below this node. |
3 |
Click the button.Result: The selected variables are displayed in the text box of the dialog box.They are displayed in the table of the dialog box where you can assign s for these parameters. |
To overwrite an existing function template with the selected application function, proceed as follows:
Step |
Action |
---|---|
1 |
In the dialog box, click the button right to the text box. |
2 |
Browse to the already available function template you want to replace. |
3 |
Select the function template you want to replace. Result: The name of this function template is inserted in the text box and the name of the template library where it is stored in is inserted in the text box. |
4 |
Click to close the dialog box and to replace the selected function template with the new application function. |
To add further information to the new function template, click the Adding Further Information for Templates or Template Libraries chapter.
button. The dialog box opens. It allows you to enter further information for the function template. Since the dialog box is identical for device templates and template libraries, see the description in the