Package: c104
iec104-pythonTable of contentsIntroductionLicensingSystem requirementsInstallationWikiContributionIntroductionThis software provides an object-oriented high-level python module to simulate scada systems and remote terminal units communicating via 60870-5-104 protocol.The python module c104 combines the use of lib60870-C with state structures and python callback handlers.Example remote terminal unitimportc104# server and station preparationserver=c104.Server(ip="0.0.0.0",port=2404)# add local station and pointsstation=server.add_station(common_address=47)measurement_point=station.add_point(io_address=11,type=c104.Type.M_ME_NC_1,report_ms=1000)command_point=station.add_point(io_address=12,type=c104.Type.C_RC_TA_1)server.start()Example scada unitimportc104client=c104.Client(tick_rate_ms=1000,command_timeout_ms=5000)# add RTU with station and pointsconnection=client.add_connection(ip="127.0.0.1",port=2404,init=c104.Init.INTERROGATION)station=connection.add_station(common_address=47)measurement_point=station.add_point(io_address=11,type=c104.Type.M_ME_NC_1,report_ms=1000)command_point=station.add_point(io_address=12,type=c104.Type.C_RC_TA_1)client.start()Seeexamplesfolder for more detailed examples.LicensingThis software is licensed under the GPLv3 (https://www.gnu.org/licenses/gpl-3.0.en.html).SeeLICENSEfile for the complete license text.Dependencieslib60870-CThis project is build on top of lib60870-C v2 from MZ Automation GmbH, which is licensed underGPLv3.The library is used for 60870-5-104 protocol based communication.» Source code» DocumentationmbedtlsThis project is build on top of mbedtls from the Mbed TLS Contributors, which is licensed underApache-2.0.The library is used to add transport layer security to the 60870-5-104 protocol based communication.» Source code» Documentationpybind11This project is build on top of pybind11 from Wenzel Jakob, which is licensed under aBSD-style license.The library is used to wrap c++ code into a python module and allow seamless operability between python and c++.» Source code» Documentationcatch2This project is build on top of catch2 from the Catch2 Authors, which is licensed underBSL-1.0.The library is used as testing framework for test-automation.» Source code» DocumentationSystem requirementsOperating systemsDebian/Ubuntu (x64): YES >= 20.04Raspbian (arm32v7): YESWindows (x64): YESRaspbian (aarch64): Not yet testedPython versionspython >= 3.6, < 3.13InstallationPlease adjust the version number to the latest version or use a specific version according to your needs.Install from pypi.orgpython3-mpipinstallc104Install from git with tagpython3-mpipinstallc104@git+https://github.com/fraunhofer-fit-dien/iec104-python.gitDocumentationRead more about theClassesand theirPropertiesin ourread the docs documentation.ContributionHow to contributeAdd feature requests and report bugs using GitHub's issuesCreate pull requestsHow to build for multiple python versions (linux with docker)Build wheels via docker/bin/bash./bin/linux-build.shHow to build (linux)Install dependenciessudoapt-getinstallbuild-essentialpython3-pippython3-devpython3-dbg
python3-mpipinstall--upgradepipBuild wheelpython3-mpipwheel.How to analyze performance (linux)Install dependenciessudoapt-getinstallgoogle-perftoolsvalgrind
sudopip3installyepCopy pprof binarycd/usr/bin
sudowgethttps://raw.githubusercontent.com/gperftools/gperftools/master/src/pprof
sudochmod+xpprofExecute profiler script./bin/profiler.shHow to build (windows)Install dependenciesPython 3Buildtools für Visual Studio 201x(Scroll down » All Downloads » Tools for Visual Studio 201x)Build wheelpython3-mpipwheel.Generate documentationBuild c104 moduleInstall dependenciespython3 -m pip install --upgrade sphinx breathe sphinx-autodoc-typehintsdoxygengraphvizBuild doxygen xmldoxygenDoxyfileBuild sphinx htmlpython3bin/build-docs.pyChange logTrack all changes in ourCHANGELOGdocumentation.