From f72b2eca75f6f065938354739e1e5aca77193e5c Mon Sep 17 00:00:00 2001 From: Igor Barcik Date: Wed, 11 Dec 2024 07:20:07 +0100 Subject: [PATCH] "Enhance PLC data monitoring and error handling" Key changes include: Improved error handling and logging in PLC data reading Added detailed debug information with pprint Restructured logging format for better readability Removed redundant docstrings Fixed PLC data reading logic with proper value extraction Added support for extra properties in logger setup Code cleanup and formatting improvements --- snap7_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snap7_test.py b/snap7_test.py index 3c97818..ba4a876 100644 --- a/snap7_test.py +++ b/snap7_test.py @@ -7,8 +7,8 @@ counter = 0 while counter < LOOPS: try: plc = snap7.client.Client() - plc.connect("172.16.3.231", 0, 1) - print(plc.get_cpu_state()) + plc.connect("172.16.4.220", 0, 1) + pprint.pprint(plc.get_cpu_state()) except Exception as e: pprint.pprint(e) finally: