Manage Templates
Templates, functions (FX), and template groups are all located in the “Templates” snap-in. The directory tree there is accessed via the same context menu as the flow tree, but contains some different entries.
Creating Template Groups
A template group combines templates and functions and can be nested just like a flow group. Unlike a flow group, it does not have an “Enable” or “Disable” option.
- In the directory tree, select the group where you want to create the new group. If a single entry is selected, the new group will be created within that group; if nothing is selected, it will be created at the top level.
- Right-click to open the context menu and select “New Template Group.” Alternatively, click the button with the folder icon in the toolbar above the tree.
- The group appears immediately in the directory tree with a default name; a name field does not open. Then rename the group via “Rename”.
The “Expand/Collapse All Template Groups” option expands or collapses the selected group along with all nested groups within it; if nothing is selected, it applies to the entire tree.
The context menu of the template tree
Right-clicking on an entry in the template tree opens this menu:
| Entry | Effect |
|---|---|
| “New template” | Creates a new template in the group of the selected entry. |
| “New function (FX)” | Creates a function in the group of the selected entry; see Functions (FX). |
| “New Template Group” | Creates a template group. |
| “Expand/Collapse All Template Groups” | Expands or collapses the selected group and all its subgroups. |
| “Copy” | Copies the selected entry and its contents to the clipboard. |
| “Paste” | Pastes the contents of the clipboard into the selected group. |
| “Delete” | Deletes the selected entry after a confirmation prompt. |
| “Rename” | Unlocks the name in the tree for editing. |
| “Make Flow productive” | Grayed out in the template tree. |
| “Duplicate Flow” | Grayed out in the template tree. |
| “Create instance from template” | Appears when a template or function is selected, not when a group is selected. See Create a single instance . |
| “Create multiple instances” | Appears when a template or function is selected. See Create multiple instances from a file and Create instances as a series . |
| “Create dynamic instance from template” | Appears when a template or function is selected. See Create dynamic instances . |
“Copy”, “Delete”, and “Rename” are grayed out as long as no entry is selected.
The two grayed-out entries apply to a flow. There are no flows in the template tree, so they are always inactive there. You can put a template into production via its instances—use the “Put all instances into production” button in the toolbar of the open template; see Working with Templates .
A template can be deleted even if instances have already been created from it: The OPC Router will prompt you and delete the template after you confirm. The instances remain in the flow tree.
Copy and Paste
“Copy” The “Copy” and “Paste” functions work the same way in the template tree as in the flow tree; see Manage Flows and Flow Groups .
Templates belong in the template tree; flows and instances belong in the flow tree. If you paste a copied entry into the other tree, the OPC Router will report the copy as invalid and undo the paste.
Renaming and Moving
You can rename a template via “Rename”; you can move it to another template group using drag-and-drop. Both actions update the existing instances: the OPC Router updates the reference to the template in each instance to the new path. The instances therefore maintain their connection to their template and retain their values.
The snap-in toolbar
Above the directory tree, the same actions are available as buttons: one for a new template, one for a new function (tooltip: “New function (FX)”), one with a folder icon for a new template group, a drop-down button for creating instances with the three options “Create a Single Instance...,” “Create Multiple Instances...,” and “Create a Dynamic Instance...,” as well as a button that shows and hides the filter field above the tree.