Running below snap7 client script for python using Siemens S7-1200 PLC shows the below common CLI refusal error. What is here the common problem and how to solve it?
Script:
import snap7
from snap7.util import *
import struct
import snap7.client
from snap7.snap7types import S7AreaDB
plc=snap7.client.Client()
plc.connect('192.168.0.69',0,1)
area = 0x84
start = 0
length = 1
bit = 0
byte= plc.read_area(area,0,start,length)
Traceback error:
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)