I am using version 1.3 of python-snap7 to read data from an S7-300 PLC. Reading out the data works perfectly, both on inputs, flags and data blocks. However, as soon as I execute the function 'get_cpu_info()', the PLC crashes and all LEDs starts to flash. To bring the PLC 'back to life', it must be completely powered down.
Python version: 3.10.6
Python Snap7: v1.3
Reproducible on the following PLCs
CPU 315F-2 PN/DP 6ES7 315-2FJ14-0AB0 v3.2
CPU 317F-2 PN/DP 6ES7 317-2FK13-0AB0 v2.6.7
Message buffer PLC after restart
Number | Time | Date | Event
1 | 12:46:10:971 pm | 20.09.2023 | Mode transition from STARTUP to RUN
2 | 12:46:10:967 pm | 20.09.2023 | Request for manual warm restart
3 | 12:46:10:763 pm | 20.09.2023 | Mode transition from STOP to STARTUP
4 | 12:45:58:008 pm | 20.09.2023 | Memory reset executed
5 | 12:45:50:993 pm | 20.09.2023 | STOP caused by CPU memory management
6 | 12:45:50:993 pm | 20.09.2023 | Power on backed up
7 | 12:45:50:993 pm | 20.09.2023 | Illegal module: replace module and reset memory
8 | 12:42:29:983 pm | 20.09.2023 | DEFECTIVE: internal system error
9 | 11:45:21:496 am | 20.09.2023 | Mode transition from STARTUP to RUN
10 | 11:45:21:492 am | 20.09.2023 | Request for manual warm restart
code snippet
try:
for j in range(self.nr_clients):
self.client[j].set_connection_type(0xFD)
self.client[j].connect(address=self.config.s7_ip, rack=self.config.s7_rack, slot=self.config.s7_slot)
await asyncio.sleep(1)
test = self.client[0].get_cpu_info() # EXECUTE ==> CRASH!
self.connection_finished = True
except Exception as ex:
self.logger.error(f'Client: Error while open the S7 connection to {self.config.s7_ip} ID: {j}! [{ex}]')
I am using version 1.3 of python-snap7 to read data from an S7-300 PLC. Reading out the data works perfectly, both on inputs, flags and data blocks. However, as soon as I execute the function 'get_cpu_info()', the PLC crashes and all LEDs starts to flash. To bring the PLC 'back to life', it must be completely powered down.
Python version: 3.10.6 Python Snap7: v1.3
Reproducible on the following PLCs
Message buffer PLC after restart
Number | Time | Date | Event 1 | 12:46:10:971 pm | 20.09.2023 | Mode transition from STARTUP to RUN 2 | 12:46:10:967 pm | 20.09.2023 | Request for manual warm restart 3 | 12:46:10:763 pm | 20.09.2023 | Mode transition from STOP to STARTUP 4 | 12:45:58:008 pm | 20.09.2023 | Memory reset executed 5 | 12:45:50:993 pm | 20.09.2023 | STOP caused by CPU memory management 6 | 12:45:50:993 pm | 20.09.2023 | Power on backed up 7 | 12:45:50:993 pm | 20.09.2023 | Illegal module: replace module and reset memory 8 | 12:42:29:983 pm | 20.09.2023 | DEFECTIVE: internal system error 9 | 11:45:21:496 am | 20.09.2023 | Mode transition from STARTUP to RUN 10 | 11:45:21:492 am | 20.09.2023 | Request for manual warm restart
code snippet