Skip to content
Snippets Groups Projects

SOIL-OPC-UA

Name

OPC UA-Generation from JSON-Files

Description

This project can iterate JSON-Models generated from SOIL-Interfaces and convert them into an OPC UA Server. At the moment everything except enums can be generated. Our code generates the functions as empty bodies, but you get a descripton and a small guide on how to integrate your algorithm.

Installation

  1. Clone Project in a Directory of your choice

  2. Copy the jsonfile you want to generate in that folder

  3. If you want to run the code manually run:

    $ pip install -r requirements.txt

Usage:

Usage with Dockerfile

  1. Change file name of the json file in line 16 of the Dockerfile to the name of the file which you wish to generate
  2. run the dockerfile

Usage manually

run:

$ python newmodeljsonparse.py <name of your file>

How to modify the server

  1. Functions:
    • To get the value of a node use:

      await node.get_value()

    • To change the value of a node use:

      await node.set_value()

  2. For everything else it is the easiest to just change your Json-Model accordingly and generate a new server.

Roadmap

One could work on connecting the events and Streams to their respective objecttypes, to make it easier for the user. The dynamic streams also can't be generated at the moment. Ranges are not enforced as of now.