gijzelaerr / python-snap7

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

error to read_area #84

Closed Hoouman closed 7 years ago

Hoouman commented 7 years ago

Hello, I am going to read the DBarea from PLC S7 1200, for this goal I try to import some of the libraries in to the python but I could not solve this error. I am new in pythone. Can you help me

import snap7 from snap7.util import * import struct import snap7.client plc=snap7.client.Client() plc.connect('10.1.1.98',0,0) area= 0x84 start=0 length=1 bit=0

byte= plc.read_area(0x82,0,start,length) No handlers could be found for logger "snap7.common" Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/snap7/client.py", line 242, in read_area check_error(result, context="client") File "/usr/local/lib/python2.7/dist-packages/snap7/common.py", line 69, in check_error raise Snap7Exception(error) snap7.snap7exceptions.Snap7Exception: CLI : function refused by CPU (Unknown error)

gijzelaerr commented 7 years ago

Hi @Hoouman I'm sorry but I can't do much, i have no idea what is going wrong.