Referencing All Resources from Another Project

I am trying to use the “Modular software engineering” as described in the Help.
However, I also want to be able to reference a template project I have as a base. The application code would then be built on top of this using the above. If the template was edited, I would want the changes to be automatically reflected across all projects that are using the template.
Using the functionality of adding an existing package as a reference, I can get my programs from the template to display this functionality. However, I cannot seem to be able to do this for global variable / types and items in the Configuration View such as the OPC-UA mapping.

Is there a way to add an entire project as a reference (my template) then use the different configurations to build on top of this please? (my applications)

1 Like

I found I can reference individual files like the OPC-UA mapping and global variables by using the “Referenced File” option from the toolbox.
image
However this feels sub-optimal so still holding out to see if anyone has a better way :slight_smile:

Automation Studio projects have a lot of files in them. The project itself is a collection of programs, user files, hardware trees, hardware configuration options, configuration files, I/O mappings, imported software (e.g. mapp), etc. I don’t think there’s a good way to reference an entire project, but there are multiple things you can do to make your project more modular. It’s possible that none of them is a “perfect” solution, but when combined they may be able to help you accomplish your goal. Here are some things I know about:

  1. Application Modules are collections of software and configuration files which can be managed independently from your project and imported into any other project.
  2. You can reference files or entire packages that exist somewhere else in the project or on your PC as you’ve described.
  3. Each configuration within Automation Studio is its own collection of hardware and configuration files. You could create multiple configurations within your project to manage different hardware trees for the same collection of software, or you could export a configuration file into a new project.
  4. Libraries are a great way to manage code that is used between projects. If code is neatly packed into functions or function blocks within a library, it can be used in any project as long as that project also has any dependent libraries imported. Libraries can also be exported in binary format if you don’t want to share your source code with others. Whenever the code in a library is updated, the version number should be incremented so that users know to import the latest version.
  5. You could create a “Template” package which is imported into multiple projects. This package can contain a premade task template for example, similar to the end result of mapp Framework.
  6. You could create and maintain (e.g. on GitHub) a template Automation Studio project as a base project for future machines.
  7. There is a post explaining the use of Git Submodules here: Using Git-Submodules in an AS-Project - Share Info & Ideas - B&R Community (br-automation.com)

Any of these options could also be maintained outside of the project in its own repository to facilitate version control and updates.

I know this doesn’t exactly answer your question, but there are a lot of options and different ones will work for different people. I hope that others are able to share solutions that worked for them in this thread.

6 Likes

Thanks for the detailed answer Marcus :slight_smile:
Looks like a combination of 1 and 2 would be best for me as I want edits to anything in the template to only be done once and this will be instantly reflected across all projects.
7 is interesting, thanks. Though it seems a combination is still the best way to get around some of the disadvantages.

2 Likes