Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLC crashed when executing the "get_cpu_info" function #467

Closed
ltwcare opened this issue Sep 20, 2023 · 1 comment
Closed

PLC crashed when executing the "get_cpu_info" function #467

ltwcare opened this issue Sep 20, 2023 · 1 comment

Comments

@ltwcare
Copy link

ltwcare commented Sep 20, 2023

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}]')
@nikteliy
Copy link
Contributor

nikteliy commented Oct 5, 2023

Hi @ltwcare
Requests to the PLC are generated by the snap7 library. So, perhaps it's better to ask this question there

Repository owner locked and limited conversation to collaborators Oct 10, 2023
@gijzelaerr gijzelaerr converted this issue into discussion #470 Oct 10, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants