Пример #1
0
 def create(self):
     """
     create a SNAP7 client.
     """
     logger.info("creating snap7 client")
     self._library.Cli_Create.restype = c_void_p
     self._pointer = S7Object(self._library.Cli_Create())
Пример #2
0
 def create(self):
     """
     create the server.
     """
     logger.info("creating server")
     self.library.Srv_Create.restype = ctypes.c_void_p
     return S7Object(self.library.Srv_Create())
Пример #3
0
    def __init__(self):
        """Create a Client

        :returns: A Snap7Client object
        """
        logger.info("creating snap7 client")
        self.pointer = S7Object(clib.Cli_Create())
Пример #4
0
    def create(self, active=False):
        """
        Creates a Partner and returns its handle, which is the reference that
        you have to use every time you refer to that Partner.

        :param active: 0
        :returns: a pointer to the partner object
        """
        self.library.Par_Create.restype = ctypes.c_void_p
        return S7Object(self.library.Par_Create(int(active)))