Creating and handling Safety projects
This chapter explains in-depth how to create, access and handle Safety projects. The following list shows all chapters in this article:
- General information about Safety projects
- Opening existing Safety projects
General information about Safety projects
- The TwinCAT Automation Interface allows to import existing TwinCAT Safety projects into a TwinCAT configuration. For this purpose, users can either use the corresponding *.splcproj file or the container format *.tfzip as a source template.
Opening existing Safety projects
To open an existing Safety project via Automation Interface, you need to navigate to the Safety node and then execute the CreateChild() method with the path to the corresponding, existing Safety project file file as a parameter.
You can use three different values as SubType:
- 0: Copy project to solution directory
- 1: Move project to solution directory
- 2: Use original project location (when used, please use
""
as project name parameter)
Basically, these values represent the functionalities (Yes, No, Cancel) from the following MessageBox in TwinCAT XAE:

You can either use the path to the Safety project (to its *.splcproj file) that needs to be added or you can also use a Safety project archive (*.tfzip).
Code Snippet (C#):
ITcSmTreeItem safety = systemManager.LookupTreeItem("TISC");
ITcSmTreeItem newProject = safety.CreateChild("NameOfProject", 0, null, pathToProjectOrTfzipFile);
Code Snippet (Powershell):
$safety = $systemManager.LookupTreeItem("TISC")
$newProject = $safety.CreateChild("NameOfProject", 0, "", pathToProjectOrTfzipFile)