Comments (9)
I think you forgot to connect, run client.connect() after the set_connection_params().
look here:
http://python-snap7.readthedocs.org/en/latest/client.html#snap7.client.Client.set_connection_params
If that didn't help, can you examine the python logging output? prepend this to your script:
import logging
logging.basicConfig(level=logging.DEBUG)
from python-snap7.
The revised script:
client = snap7.client.Client()
print repr(client)
x = client.set_connection_params('192.168.99.192', 0x0100, 0x0200)
print repr(x)
client.connect('192.168.99.192', 1, 0 )
y = client.get_connected()
print repr(y)
Output:
INFO:snap7.client:creating snap7 client
<snap7.client.Client object at 0x2b02a10> handle
None
INFO:snap7.client:connecting to 192.168.99.192 rack 1 slot 0
DEBUG:snap7.common:error text for 0xa006e
ERROR:snap7.common: ISO : An error occurred during recv TCP : Connection
timed out
Traceback (most recent call last):
File "step7.py", line 58, in
client.connect('192.168.99.192', 1, 0 )
File "/usr/local/lib/python2.7/dist-packages/snap7/client.py", line
21, in f
check_error(code, context="client")
File "/usr/local/lib/python2.7/dist-packages/snap7/common.py", line
56, in check_error
raise Snap7Exception(error)
snap7.exceptions.Snap7Exception: ISO : An error occurred during recv
TCP : Connection timed out
client.connect requires a port and slot, I thought that would not work
with LOGO 0BA7 ?
On 02/05/2014 02:36 AM, Gijs Molenaar wrote:
I think you forgot to connect, run client.connect() after the
set_connection_params().look here:
http://python-snap7.readthedocs.org/en/latest/client.html#snap7.client.Client.set_connection_params
If that didn't help, can you examine the python logging output?
prepend this to your script:import logging
logging.basicConfig(level=logging.DEBUG)—
Reply to this email directly or view it on GitHub
#6 (comment).
Stan Yankoo
1-416-573-7258 Cell
[email protected]
Notice of Confidentiality:
The information transmitted in this message, including attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.Any review, re-transmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
If you received this message or attachment in error, please contact the sender immediately by return electronic transmission and then immediately delete this transmission, including all attachments, without copying, distributing or disclosing same.
from python-snap7.
are you sure it is the right IP? it just looks like that address is just not responding. can you ping the IP?
from python-snap7.
Yes I can ping the IP and I can control the PLC at that IP using the
Snap7 GUI and libnodave.
On 02/06/2014 03:16 AM, Gijs Molenaar wrote:
are you sure it is the right IP? it just looks like that address is
just not responding. can you ping the IP?—
Reply to this email directly or view it on GitHub
#6 (comment).
Stan Yankoo
1-416-573-7258 Cell
[email protected]
Notice of Confidentiality:
The information transmitted in this message, including attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.Any review, re-transmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
If you received this message or attachment in error, please contact the sender immediately by return electronic transmission and then immediately delete this transmission, including all attachments, without copying, distributing or disclosing same.
from python-snap7.
try:
client.connect('192.168.99.192', 0, 1 )
first one is the rack second one is the slot imho. the slot cannot be 0. we should add an error message for that.
from python-snap7.
I thought it was just the rack that could not be zero? Slot 0 works with
libnodave.
The Snap7 documentation says that connecting to a LOGO will not work
with rack/slot. It will only work with TSAP.
On 02/06/2014 08:15 AM, stephan preeker wrote:
try:
client.connect('192.168.99.192', 0, 1 )
first one is the rack second one is the slot imho. the slot cannot be
0. we should add an erro message for that.—
Reply to this email directly or view it on GitHub
#6 (comment).
Stan Yankoo
1-416-573-7258 Cell
[email protected]
Notice of Confidentiality:
The information transmitted in this message, including attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.Any review, re-transmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
If you received this message or attachment in error, please contact the sender immediately by return electronic transmission and then immediately delete this transmission, including all attachments, without copying, distributing or disclosing same.
from python-snap7.
Well this library was written using an S400 PLC here on my desk I do not have a LOGO device. It would be very helpfull if you could narrow down what causes this and make a pull request, the library is not that big and just a wrapper around snap7 library. so if snap7 works this python libary should be able to work to!
from python-snap7.
Thanks Stephan, I'll keep working on it a bit longer. If I figure it out
I'll let you know.
On 02/06/2014 08:26 AM, stephan preeker wrote:
Well this library was written using an S400 PLC here on my desk I do
not have a LOGO device. It would be very helpfull if you could narrow
down what cause this. the library is not that big and just a wrapper
around snap7 library. so if snap7 works this python libary should be
able to work to!—
Reply to this email directly or view it on GitHub
#6 (comment).
Stan Yankoo
1-416-573-7258 Cell
[email protected]
Notice of Confidentiality:
The information transmitted in this message, including attachments, is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.Any review, re-transmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
If you received this message or attachment in error, please contact the sender immediately by return electronic transmission and then immediately delete this transmission, including all attachments, without copying, distributing or disclosing same.
from python-snap7.
hi stan4, any update on this issue? i've made a new 0.2 release that you can try.
from python-snap7.
Related Issues (20)
- PLC crashed when executing the "get_cpu_info" function HOT 1
- How to read and write values of type bool using snap7 module?
- Can not use this library to read timers of simatic S7-200 smart PLC HOT 2
- Redundant 400-H get_cpu_state() returning incorrect value.
- Add python 3.12 support, build wheels HOT 2
- RuntimeError: b' ISO : An error occurred during recv TCP : Connection timed out'
- Error in util.Set_String and util.Get_String
- as_db_read() doesnt work
- Wrong values set_lreal
- db[0]['x']=22.33 raises ValueError HOT 2
- Improve doc for area_read in client HOT 2
- Communication between PLC and PC HOT 1
- Can't read from S210 Drive
- Get data block layout
- TypeError: '_ctypes.PyCArrayType' object is not subscriptable HOT 1
- Make client and server a contextmanager HOT 1
- Drop Python 3.8 from metadata and doc HOT 1
- Drop Snap7Library singleton and use python functools caching HOT 1
- version 1.4 broken on python 3.8 HOT 2
- Snap7Exception is not used HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-snap7.