With this scripts you can generate your own Module "frames". This is an example in how to work with Python-Scripts in CODESYS. Following features are availabe:
This script generates default folderstructure with the desirered "Modulename"
This Script generates the folderstructure from above and in addition an PRG-Block with the modulname and options:
You can choose following options:
- Enable -> The PRG-Block will have an enable input and internal enable handling
- Init -> The PRG-Block will have an init-routine, with mInit method
- Performance -> will ad an instance of fbTimeMeasurement to measure the perforamance of the PRG
This script generates a "Module" or Functionblock, with diverse options and interfaces: You can choose following options:
- Ack -> input for ackknowledgement handling
- mode -> for mode handling
- ST_Config -> generates an configuration struct for the module
- VISU_ITF -> generates an Interface for Visualization or Scada
This exports all of your librarys and POUs, to document your actual state of the project. The File is then located in the projectfolder.
It is example and not all functions are integrated.

With ExportXml.py you can export your whole project to an XML-file. Then you can iterate trough this with testXmlHandling.py. You can also merge the two projects to get you information directly from your project. The Handling of the XML-file is much easier then the handling with the Built-In Codesys functions.







