Git Product home page Git Product logo

tia-portal-xml-generator's Introduction

tia-xml-generator

tia-xml-generator is a Python library created for generating XML files that can be imported into TIA Portal via TIA Openness. The library was created as part of a graduation project and currently supports the creation of DB, FB, and OB blocks.

Usage

Here's an example of how to use tia-xml-generator to create a DB block:

from tia_xml_generator.elements import document
from tia_xml_generator.enums import MemoryLayout

doc = document.Document()
db = doc.add_db("__NAME__")
db.add_static("__NAME__", "__TYPE__")
db.author = "__Author__"
db.family = "__Family__"
db.version = "1.0"
db.memory_layout = MemoryLayout.Standard.name
doc.save_template("__TEMPLATE_NAME__", True) # Gives PKL file
doc.save("__OUTPUT_NAME__") # Gives XML file

The code above creates a new instance of the Document class from tia_xml_generator.elements, adds a DB block to it, sets some properties of the block, saves the block as a pkl file using the save_template method, and saves the entire document as an XML file using the save method.

Contributing

If you'd like to contribute to tia-xml-generator, please fork the repository and create a new branch for your changes. Once you've made your changes, submit a pull request and we'll review your changes.

License

tia-xml-generator is licensed under the MIT license. See the LICENSE file for more information.

tia-portal-xml-generator's People

Contributors

repsay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.