Giter VIP home page Giter VIP logo

transforming-xpath-to-opc-ua's Introduction

Transforming XPath to OPC-UA (X2OPC)

X2OPC is a Python implementation of the XPath to OPC UA translator.

Authors: Max Kocher, Johannes Theissen-Lipp, Patrick Sapel, and Mauritius Schmitz.

Requirements

Usage

To run the files, fileAnalysis.py and OPCtranslator.py must be in the same folder.
To extract the address space of the OPC UA Server you have to execute the file extractor.py.
You have to specify the url of the OPC UA server in line 175 like

url = "opc.tcp://...:53530/OPCUA/SimulationServer/"

and the path of the output file in line 179 like

path = 'D:\\Downloads\\Files\\OpcExport.txt'

After the execution the file OpcExport.txt is created.

The XML image of the export is created with the fileAnalysis.py file.
To run the file, the path of the OpcExport.txt file must be specified in line 9 like

open('D:\\Downloads\\Files\\OpcExport.txt', 'r').read().split("\n")

and the path of the XML file to be generated must be specified in line 419 like

file_object = open('D:\\Downloads\\Files\\OpcExport.xml', 'w')

After XML expressions have been created, they can be transformed to OPC UA in the file OPCtranslator.py.
For this purpose the url of the OPC UA server must be specified in line 290 like

  url = "opc.tcp://.....:53530/OPCUA/SimulationServer"

The following table describes ten axes and their counterpart in OPC UA:

XPath Function
child child(client, connected, nodeList, offlineList)
parent parent(client, connected, nodeList, offlineList)
ancestor ancestor(client, connected, nodeList, offlineList, rootnode)
ancestor-or-self ancestorOrSelf(client, connected, nodeList, offlineList, rootnode)
descendant descendant(client, connected, nodeList, offlineList)
descendant-or-self descendantOrSelf(client, connected, nodeList, offlineList)
preceding preceding(client, connected, nodeList, offlineList)
following following(client, connected, nodeList, offlineList)
preceding-sibling precedingSibling(client, connected, nodeList, offlineList)
following-sibling followingSibling(client, connected, nodeList, offlineList)

The client parameter references the server specified by the url.
The parameter connected can be True or False and indicates whether the server or the server's export is used.
The parameter nodeList contains a list of NodeIds on which the function is executed.
The offlineList parameter contains the information of the server's export and is defined in line 292.
The rootnode parameter contains the nodeId of the server's root node.

Visualizations

The visualizations folder contains the code to generate all the illustrations shown in chapter 5. Each file can be executed independently and already contains all the necessary information.

transforming-xpath-to-opc-ua's People

Contributors

max-lab-prog avatar

Watchers

 avatar  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.