コード例 #1
0
ファイル: client.py プロジェクト: lance5107B/python-snap7
    def connect(self, address, rack, slot, tcpport=102):
        """
        Connect to a S7 server.

        :param address: IP address of server
        :param rack: rack on server
        :param slot: slot on server.
        """
        logger.info("connecting to %s:%s rack %s slot %s" % (address, tcpport,
                                                             rack, slot))

        self.set_param(snap7.snap7types.RemotePort, tcpport)
        return self.library.Cli_ConnectTo(self.pointer, c_char_p(six.b(address)),
                                          c_int(rack), c_int(slot))
コード例 #2
0
ファイル: client.py プロジェクト: palmarytech/python-snap7
    def connect(self, address, rack, slot, tcpport=102):
        """
        Connect to a S7 server.

        :param address: IP address of server
        :param rack: rack on server
        :param slot: slot on server.
        """
        logger.info("connecting to %s:%s rack %s slot %s" %
                    (address, tcpport, rack, slot))

        self.set_param(snap7.snap7types.RemotePort, tcpport)
        return self.library.Cli_ConnectTo(self.pointer,
                                          c_char_p(six.b(address)),
                                          c_int(rack), c_int(slot))
コード例 #3
0
ファイル: client.py プロジェクト: palmarytech/python-snap7
 def set_session_password(self, password):
     """Send the password to the PLC to meet its security level."""
     assert len(password) <= 8, 'maximum password length is 8'
     return self.library.Cli_SetSessionPassword(self.pointer,
                                                c_char_p(six.b(password)))
コード例 #4
0
ファイル: client.py プロジェクト: jdugge/python-snap7
 def set_session_password(self, password):
     """Send the password to the PLC to meet its security level."""
     assert len(password) <= 8, 'maximum password length is 8'
     return self.library.Cli_SetSessionPassword(self.pointer,
                                                c_char_p(six.b(password)))