Giter Club home page Giter Club logo

Comments (6)

gijzelaerr avatar gijzelaerr commented on July 3, 2024

hi @lkraider , thanks for the report. Can you create a gist with a minimal version of your code that triggers this segmentation fault?

from python-snap7.

lkraider avatar lkraider commented on July 3, 2024

I should state that I am testing on OSX 10.9.2 with the x86_64 library compiled with lldb.
The examples/plain-c/server and client from the snap7 source work fine.

Looking at the source, the S7Object in python-snap7 is 32bit, which is the problem.
The code below works:

import ctypes

lib = ctypes.cdll.LoadLibrary('lib/libsnap7.so')
print(lib)

lib.Cli_Create.restype = ctypes.c_void_p
cli = lib.Cli_Create()
print(hex(cli))

lib.Cli_ConnectTo.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_int, ctypes.c_int]
res = lib.Cli_ConnectTo(cli, '127.0.0.1', 0, 0)
print(res)

result:

<CDLL 'lib/libsnap7.so', handle 7f983b462ed0 at 10f360f50>
0x7f983b875000
0

from python-snap7.

gijzelaerr avatar gijzelaerr commented on July 3, 2024

interesting, we've developed python-snap7 on 64bit linux so i'm not sure why this is a problem for 64 osx.

from python-snap7.

spreeker avatar spreeker commented on July 3, 2024

ikraider, out of curiosity what kind of project are you using snap7 for?

from python-snap7.

lkraider avatar lkraider commented on July 3, 2024

It's in a new custom production line for printing codes in a thermal printer. We use a PLC to control several parts of the line, and I read and also write to it from a python app that I created that generates these codes.

from python-snap7.

spreeker avatar spreeker commented on July 3, 2024

You are AWESOME ;)

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.