Git Product home page Git Product logo

plcopen-xml-xcore's Introduction

PlcOpen-Xml Xcore

Build Status

Xcore model of the PlcOpen Xml Standard.

Installation

Clone the repo:

git clone https://github.com/MattsSe/plcopen-xml-xcore
cd plcopen-xml-xcore

This project comes with automated build support for the xcore model. All Java code will be generated during build using either:

  • maven: mvn clean install
  • gradle: ./gradlew clean build

Usage

Load XML

Parse a PlcOpen XML file

File xmlFile = new new File("path.xml");
PlcOpenSerializer serde = new PlcOpenSerializer();
Resource plcResource = serde.loadXmlResource(xmlFile);

Write Xml

Create a model first, thenn save as PlcOpen XML.

// build project
Project project = Tc6021Factory.eInstance.createProject();
  ...

Resource resourceSet = new ResourceSetImpl();
Resource resource = new ResourceImpl();
resourceSet.getResources().add(resource);
resource.getContents().add(project);

PlcOpenSerializer serde = new PlcOpenSerializer();
serde.writeXML(resource, "output/plcopen.xml");

Reading/Writing XMI models using the analogous methods of the PlcOpenSerializer.

See More demos in the PlcOpenSerializeTest test.

To Access any components inside the project utilize the EMF API.

License

Licensed under Eclipse Public License 2.0

plcopen-xml-xcore's People

Contributors

mattsse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

plcopen-xml-xcore's Issues

Build failure due to version conflict

Hello Matthias,

I'm looking for a Java library which can help me read a PLCOpen project file and use the data in that file to convert the source code to a different brand. If I'm not mistaken, plcopen-xml-xcore can help me do that?

I'm trying to build plcopen-xml-xcore, using the java version of our software, but I get this error:

BuildFailurePLCOpen

Since I cannot 'just upgrade java', I'm looking for a workaround. Any help is appreciated :)

Dummy example doesn't validate against tc6_v201.xsd

Hi,
did you validate the file generated by PLC Open Editor?

I cannot validate the file against the schema. There is a lot of differences that dont match.
Here are some:
Element '{http://www.plcopen.org/xml/tc6_0201}fileHeader', attribute 'creationDateTime': '2018-02-25 15:28:29' is not a valid value of the atomic type 'xs:dateTime'., line 9

  • the date time doesnt take in this kind of format that the editor is exporting.

Element '{http://www.plcopen.org/xml/tc6_0201}content': Character content other than whitespace is not allowed because the content type is 'element-only'., line 175

  • Content element needs sub elements. It cannot hold text. Content is ppx:FormattedText that has a documentation element, which can hold text.

I dont know what xsd PLC Open Editor is using but it ain't tc6_v201.

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.