tree: 0415d66f135fdfa40052e9f6e4f2f3cbb16489ff [path history] [tgz]
  1. src/
  2. pom.xml
  3. README.md
  4. setup.py
sandbox/plc4py/README.md

Python binding for the interop server

This module provides the (experimental) Python support for the interop server. Or, simpler, a python 3 binding for PLC4X.

The only thing which needs to be done as installation is to run the initialize_interop_server.sh script to build the interop server and copy it to lib/ forder.

Then, you are good to go.

Some tests can be found in test/test_PlcDriverManager.py.

Here is some example code:

with PlcDriverManager() as manager:
    with manager.connection("s7://192.168.167.210/0/1") as conn:
        for _ in range(100):
            result = conn.execute(Request(fields={"field1": "%M0:USINT"}))
            print("Response Code is " + str(result.get_field("field1").get_response_code()))
            # We know that we want to get an int...
            print("Response Value is " + str(result.get_field("field1").get_int_value()))

All generated files (from thrift) are in org.apache.plc4x.interop. I built a very simple Python API in org.apache.plc4x.