Giter VIP home page Giter VIP logo

Comments (9)

gijzelaerr avatar gijzelaerr commented on May 26, 2024

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.

stan4 avatar stan4 commented on May 26, 2024

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.

gijzelaerr avatar gijzelaerr commented on May 26, 2024

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.

stan4 avatar stan4 commented on May 26, 2024

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.

spreeker avatar spreeker commented on May 26, 2024

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.

stan4 avatar stan4 commented on May 26, 2024

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.

spreeker avatar spreeker commented on May 26, 2024

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.

stan4 avatar stan4 commented on May 26, 2024

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.

gijzelaerr avatar gijzelaerr commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.