ysimonx / OpcuaToJson

Converts a OPCUA folder of nodes to JSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpcuaToJson

by Yannick Simon

The main goal of this repo is to build a python script that converts any OPCUA data to JSON.

In addition, each variables nodes are subscribed and the JSON data are updated when the OPCUA node values change

Installation

sudo apt install python3-venv
python3 -m venv ./env
source ./env/bin/activate
pip install opcua jsonpath_ng cryptography

Run

  • Convert an OPCUA folder of nodes to a JSON file
  • Subscribe to each variable and update JSON file

source ./env/bin/activate
python OpcuaToJson.py -u opc.tcp://MacBook-Air-M1.local:53530/OPCUA/SimulationServer -p "Root/Objects/Simulation" -o ./export_opcua.json -d 2

Exemple with Prosys Simulation Server

cf : www.prosysopc.com these variables changes each second

Capture d’écran 2023-03-12 à 21 01 16

Capture d’écran 2023-03-12 à 20 57 38

About

Converts a OPCUA folder of nodes to JSON

License:Apache License 2.0


Languages

Language:Python 92.3%Language:Shell 7.7%