python-opcua-modbus-driver
python-opcua-modbus-driver copied to clipboard
Python OPC UA Modbus Driver
python-opcua-modbus-driver
Python OPC UA Modbus Driver
Elementary implementaion which bridges Modbus RTU data to OPC UA server.
The basic principle is this:
- Start
server_minimal.py - This will import the
driver_ModbusRTU.pywhich will kick off a thread which scans a modbus network - The server will import an XML file which has an Object Type for a hardware device, the example has one device (MyDevice)
- The server will instantiate a python
Deviceobject which has anupdatemethod for getting data from Modbus - The
Deviceobject subclassesUaObjectwhich will auto subscribe to all children and keep the python class in sync with the OPC UA object - MyDevice links to the modbus driver via parameters from OPC UA, so it can be configued from an HMI or UA client
This example is not tested and has never been run. It is a generic starting point created from a working implementation.
Dependencies:
python-opcua
modbus_tk