Ankündigung

Einklappen

Serverwartung 21.2.



Am 21.2. im Laufe des späten Abends wird eine Serverwartung durchgeführt. Das Forum ist dadurch für gut zwei Stunden nicht erreichbar.
Es wird eine Wartungsseite geschaltet.

Mehr anzeigen
Weniger anzeigen

Siemens Steuerung S7-300 Anbindung

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    #16
    Habe jetzt die Lösung gefunden.
    Nach der Installation von Snap7 und python-snap7 muss die common.py im /usr/local/lib/python2.7/dist-packages/snap7/ geändert werden.
    Folgender Eintrag muss hinzugefügt werden

    lib_location='/usr/local/lib/libsnap7.so'

    Code:
    class Snap7Library(object):
        """
        Snap7 loader and encapsulator. We make this a singleton to make
        sure the library is loaded only once.
        """
        _instance = None
        def __new__(cls, *args, **kwargs):
            if not cls._instance:
                cls._instance = object.__new__(cls)
                cls._instance.lib_location = None
                cls._instance.cdll = None
            return cls._instance
    
        def __init__(self, lib_location=None):
    [COLOR=#FF0000][B]lib_location='/usr/local/lib/libsnap7.so' # add this line here[/B][/COLOR]
            if self.cdll:
                return
            self.lib_location = lib_location or self.lib_location or find_library('snap7')
            if not self.lib_location:
                msg = "can't find snap7 library. If installed, try running ldconfig"
                raise Snap7Exception(msg)
            self.cdll = cdll.LoadLibrary(self.lib_location)
    siehe: http://simplyautomationized.blogspot...m-s7-1200.html



    Kommentar


      #17
      Mich irritiert, das das bei python2.7 gemacht werden soll...

      Kommentar


        #18
        also, ich habs auch mal installiert, nur zur vollständigkeit:
        snap7 und snap7-python müssen installiert sein
        sudo pip3 install snap7-python

        #download and compile snap7 for rpi2/3

        wget http://sourceforge.net/projects/snap...ar.gz/download
        tar -zxvf download
        cd snap7-full-1.4.1/build/unix
        sudo make –f arm_v7_linux.mk all

        #copy compiled library to your lib directories
        sudo cp ../bin/arm_v7-linux/libsnap7.so /usr/lib/libsnap7.so
        sudo cp ../bin/arm_v7-linux/libsnap7.so /usr/local/lib/libsnap7.so
        so hat es bei mir funktioniert, dann tut auch das Plugin was es soll, wobei ich das noch etwas angepasst habe

        Kommentar

        Lädt...
        X