pycomm3/clx.py
def _register_session(self) -> Optional[int]:
        """
        Registers a new CIP session with the target.

        :return: the session id if session registered successfully, else None
        """
        if self._session:
            return self._session

        self._session = 0
        request = self.new_request('register_session')
        request.add(
            self.attribs['protocol version'],
            b'\x00\x00'
        )

        response = request.send()
        if response:
            self._session = response.session
            self.__log.debug(f"Session = {response.session} has been registered.")
            return self._session

        self.__log.warning('Session has not been registered.')
        return None

        Registers a new CIP session with the target.

        :return: the session id if session registered successfully, else None
        
Registers a new CIP session with the target.
Registers a new CIP session with the target .
def _register_session(self) -> Optional[int]:
        if self._session:
            return self._session
        self._session = 0
        request = self.new_request('register_session')
        request.add(
            self.attribs['protocol version'],
            b'\x00\x00'
        )
        response = request.send()
        if response:
            self._session = response.session
            self.__log.debug(f"Session = {response.session} has been registered.")
            return self._session
        self.__log.warning('Session has not been registered.')
        return None
def _register_session ( self ) -> Optional [ int ] : if self . _session : return self . _session self . _session = 0 request = self . new_request ( 'register_session' ) request . add ( self . attribs [ 'protocol version' ] , b'\x00\x00' ) response = request . send ( ) if response : self . _session = response . session self . __log . debug ( f"Session = {response.session} has been registered." ) return self . _session self . __log . warning ( 'Session has not been registered.' ) return None
Registers a new CIP session with the target.
Registers a new CIP session with the target .
"""
        Registers a new CIP session with the target.

        :return: the session id if session registered successfully, else None
        """
the session id if session registered successfully, else None
the session id if session registered successfully else None
self