Configuring Parent Project
- Go to the Config tab on the Gateway Webpage, and select Systems > Projects. This brings up a list of all your projects. You'll notice that for each project listed, you'll see at a glance if a project is Inheritable, and if so, the name of the Parent Project will be displayed.
Find the project you want to make inheritable, and click the Edit next to the project name (i.e., global) to open the Project Settings window.
Enable the Inheritable property, and click Save.
When you make a project inheritable, the Allow Overrides function is set by default on all project resources in the inheritable project. This allows all project resources to be propagated to all inherited projects.
Cannot Launch Inheritable Projects
When you have a project that's flagged as inheritable, you can not launch it as a stand-alone project (i.e., Perspective Session or Vision Client). You will get a 'Project Not Runnable" error message. If you have an inheritable project that you want to launch, you must have another project to inherit from it.
Configuring Child Project
Now that we have an inheritable project, let's setup an existing project (i.e., Project_X) so it inherits resources from the 'global' project.
- Under the Config tab select System > Projects page
- Find your project and click the Edit button.
- Select the inheritable project from the Parent Project dropdown list (i.e. global), and click Save.
Using Inherited Resources
You can treat an inheritable project as a library of resources for use in other projects. When project resources are changed in the original project, these changes will get passed down to the inherited projects. The same thing is true if new resources are added to the inheritable project. By using inheritable projects, you can create a resource library that will help designers build their projects more quickly, ensure consistency and reusability across all their projects.
To view your inherited resources, go to the Designer and open your inheriting project (i.e., Project_X). Expand the folders that contain resources, and you'll notice that the inherited project resources are grayed out, including the Perspective Views and Vision Windows folders. Grayed out resources mean that those resources are inherited, and can only be edited from their original / parent project. Anytime a new resource is added or an existing resource is changed in the inheritable / parent project, it will propagate down to the inherited project and will appear grayed out unless that resource is overridden.
You can view a grayed out resource by either selecting the Open read-only option or hovering your mouse over the resource name in the Project Browser. Each resource displays a little differently: hover over the resource using your mouse,or click on the resource name to open it.
Inheritance and "runnable" Resources
Some resources in a project "run" or execute in every leaf project (that is, a project that is not inherited by any other project) in the inheritance chain. Thus, if multiple projects inherit from the same parent project, then each leaf project will contain runnable resources, potentially resulting in duplicate executions.
The diagram below represents an inheritance hierarchy on a single gateway. A "Root" project contains a Gateway Tag Change script. Two projects inherit from the Root, so they'll inherit the script. In both cases, the inheritance chain leads to leaf projects. In this single gateway, two running instances of the same tag change script exist, meaning there will be duplicate script executions.
In the case of resources that "run", it is highly advised that they exist in a leaf project, or a standalone project (a project that does not participate in inheritance at all). In regards to the diagram above, we could prevent duplicate execution of our Tag Change Script easily by moving the Tag Change Script to a separate, standalone project:
The following resources are considered "runnable":
Overriding Inherited Resources
To edit a resource in an inherited project, you need to override the resource by right clicking the resource and selecting Override Resource. By overriding the inherited resource, the resource is recreated in the inherited project, and any future changes made to the original project resource will not propagate down to the inherited resource.
If new resources are added in the inheritable / parent project, they will automatically propagate down to inherited projects. New resources that are added in the inherited project will be displayed as grayed out. You will need to override each new resource to edit it.
Deleting Inherited Resources
Inherited resources that have been overridden can be deleted from an inherited project. When you delete an inherited resource, it doesn't delete the resource from the inheritable / parent project, it deletes the 'Override' you previously placed on the inherited resource. The inherited project resource will return to the version that is currently in the inheritable / parent project (without your edits), and the resource becomes grayed out in the Project Browser.
- To delete the override on an inherited resource, right click on the resource and select Delete.
- A dialog box will popup confirming you want to delete the selected node, click Yes. The resource will immediately be grayed out preventing designers from editing that resource.
Renaming an Inherited Resource
You can easily rename an inherited resource, but beware that when you rename a resource, the inheritable project will propagate the original resource to the inherited project. For example, say you have an inheritable project resource named 'Map_Transform' and you renamed it to 'CA _Map_Transform.' Ignition knows that the original project resource is no longer there, and because the project is flagged as inheritable, it will propagate that original resource to the inherited project. Now you have both the renamed 'CA_Map_Transform' and the original inheritable resource 'Map_Transform.'
Inheritable Project Examples
There are many ways how you might want to configure and organize your inheritable projects. It's whatever works best for your organization and design projects. Here are a couple of common ways to organize your shareable resources.
- You can create one inheritable project that contains many project different resources: scripts, pipelines, views, templates, windows, SFCs, etc. This is one inheritable project containing all your inheritable project resources.
- Another option is to create several inheritable projects. You can have one inheritable project dedicated for each type of rersource: one for scripts, one for views, one for templates, one for pipelines, etc.
When a project is exported, you don't get any inherited resources with your export. However, if a project resource was overridden and edited, that essentially becomes a new resource and will be included in a project export. Resources that are inherited and not overridden will have to be included as part of an inheritable project export. Once a new project is imported into a Gateway, you can always configure that project to inherit from another project.