TIA Portal Autosave with Openness
Sometimes my computer crashes. Sometimes I forget to save for extended periods of time while I’m developing code in TIA Portal. When these events coincide, I don’t have a good time. However, with a little bit of C# .NET knowledge this problem can be solved. Assuming you have installed TIA Portal Openness, the below code can be run as a console application to automatically save all active instances of TIA Portal V15.1 every 5 minutes.
static void Main(string args)
//Endlessly run this instruction
//Call function to save portal projects
//Wait 5 minutes
public static void SavePortal()
//Need a list that can hold all of the TIA portal processes
//All portal processes are retrieved using a static method of TiaPortal
IList<tiaportalprocess> processes = TiaPortal.GetProcesses();
//Loop through all TIA portal processes and attempt to save
foreach (var process in processes)
MyTiaPortal = process.Attach();
catch (Exception e)
//Print any error messages to the console
In addition to the code above, you’ll need to include a reference to the Siemens.Engineering.dll used to call openness instructions. A small side effect is to keep in mind is that every time you save in TIA Portal you lose the ability to undo actions.
If you’d like to learn more about DMC’s Siemens expertise and how we can help you improve your project efficiency, development, and effectiveness, check out our Manufacturing Automation & Intelligence Services.
There are currently no comments, be the first to post one.