Skip to content

colnaux/CodeGeneratorOpenness

 
 

Repository files navigation

CodeGeneratorOpenness

Siemens TIA Portal Code Generator via Openness Interface

Since we are doing import of Graph step sequence through an Excel sheet using Openness, I was thinking of building a "structure" code generator for the TIA portal. Right now, most important functions are working so it would be possible to
-build a group tree
-import any kind of blocks like FB, FC, OB or data types

This covers mainly the function we can find in the Openness scripter. But I want to go a little further to build structures more variable. Not sure where it leads to but my goal will be to use templates to build FB with n-times valve FBs through a scripter or later on maybe a tool to configure this.

Based on the description found here:

https://support.industry.siemens.com/cs/attachments/109477163/TIAPortalOpennessenUS_en-US.pdf (English) https://cache.industry.siemens.com/dl/files/163/109477163/att_926040/v1/TIAPortalOpennessdeDE_de-DE.pdf (Deutsch)

This version is based on TIA V16.
With some small changes this will also work with 14SP1,15 or 15.1 (work ongoing)

Functions added:

-open TIA with interface (first instance or new instance)
-open project file via file dialog
-compile software
-save project
-close project
-show folder structure software
-show data types
-add / delete groups in the treeview
-add complete path to the treeview
-imports PLC blocks (with rename if needed)
-import data types
-export blocks / types
-export project text (de/en)
-import project text (de/en)

Test
-add / change language for editing
-for devolpment set the key in the registry to avoid firewall each time

Limtitations:
-no global search for block/types
-import fails if language is not in the project
-export projects text can not overwrite existing files

Screenshot:
Code Generator



Some code for the Graph generation is "reversed engineered" since there is no description.

About

Siemens TIA Portal Code Generator via Openness Interface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%