script python, library snap7, Help!!

babido10

Member
Join Date
Nov 2017
Location
rabat
Posts
28
code python:

import snap7
from time import sleep
import struct
import snap7.client as c


plc = snap7.client.Client()
plc.connect("192.168.0.1")

plc.writeMem('QX0.0',True) # write Q0.0 to be true, which will only turn on the output if it isn't connected to any rung in your ladder code
print plc.getMem('MX0.1') # read memory bit M0.1
print plc.getMem('IX0.0') # read input bit I0.0
plc.plc.disconnect()

////

error line ==> plc = snap7.client.Client()

I connected with the plc but the problem stay same
if some one here can help me to resolve this problem
 

Similar Topics

Hello I wanna do script python ( if detect color ==> Set memory bit ) WriteMemory(plc,0,1,S7WLBit,True) if 'orange': (0, 140, 255)==1 this...
Replies
5
Views
2,645
When I simulated the program it gives me an error code python(part of main program): if okLeft: #random.randrange(2): resultLeft = "OK"...
Replies
2
Views
1,735
Hi all ; if someone here can help me to convert this code to python code: public static libnodave.daveOSserialType fds; public static...
Replies
11
Views
3,724
Hello, I am learning to create shapes and VB Scripts in HMIWeb Display Builder. I wanted to change color of my rounded rectangle by script. I...
Replies
0
Views
71
Hello, I have a quick question. I have been using scripts to change the color of buttons. The reason, I am usually using multiple hmiruntime.tags...
Replies
1
Views
81
Back
Top Bottom