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

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:

Basically, these values represent the functionalities (Yes, No, Cancel) from the following MessageBox in TwinCAT XAE:

Creating and handling Safety projects 1:

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)