gijzelaerr / python-snap7

A Python wrapper for the snap7 PLC communication library
http://python-snap7.readthedocs.org/
MIT License
650 stars 245 forks source link

Communication between PLC and PC #495

Closed Schadi0815 closed 5 months ago

Schadi0815 commented 6 months ago

Hello,

I am trying to establish communication between a non-optimized DB in my PLC and a PC. On the PC I am using the Python programming language with a Snap7 library. The PUT/GET function is activated on the PLC.

Communication must be very fast (~100ms). The PLC is a 1513F-1 PN with the following part number: 6ES7 513-1FL02-0AB0 and this firmware version: V2.9 The cycle time of the PLC is around 40-60 ms.

Unfortunately, the evaluation is not stable. For example: We have physically mounted two triggers. One trigger goes to the PLC The other trigger goes to a camera, which triggers if the trigger is interrupted. The images are retrieved from the PC via a Python script. This also works so far.

The PC counts up 1 for each photo and sends the value to the PLC. Unfortunately, not all values written by the PC arrive at the PLC. In other words: 1000 triggers sent to the PC --> 997 triggers arrive in the PLC Does anyone have any experience as to why this could be and can they please help me?

nikteliy commented 6 months ago

Such behavior can have multiple reasons, and the python-snap7 library is far from being the first one. In any case, without details, it's difficult to suggest anything.

I would start by checking the PLC settings. For example, this may be related to the short cycle time. You might want to try increasing it. image