"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
This commit is contained in:
parent
15f3e47aeb
commit
f72b2eca75
@ -7,8 +7,8 @@ counter = 0
|
|||||||
while counter < LOOPS:
|
while counter < LOOPS:
|
||||||
try:
|
try:
|
||||||
plc = snap7.client.Client()
|
plc = snap7.client.Client()
|
||||||
plc.connect("172.16.3.231", 0, 1)
|
plc.connect("172.16.4.220", 0, 1)
|
||||||
print(plc.get_cpu_state())
|
pprint.pprint(plc.get_cpu_state())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pprint.pprint(e)
|
pprint.pprint(e)
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user