pycomm3/packets/requests.py
def _build_header(self, command, length) -> bytes:
        """ Build the encapsulate message header

        The header is 24 bytes fixed length, and includes the command and the length of the optional data portion.

         :return: the header
        """
        try:
            return b''.join([
                command,
                Pack.uint(length),  # Length UINT
                Pack.udint(self._plc._session),  # Session Handle UDINT
                b'\x00\x00\x00\x00',  # Status UDINT
                self._plc.attribs['context'],  # Sender Context 8 bytes
                Pack.udint(self._plc.attribs['option']),  # Option UDINT
            ])

        except Exception as e:
            raise CommError(e)
 Build the encapsulate message header

        The header is 24 bytes fixed length, and includes the command and the length of the optional data portion.

         :return: the header
        
Build the encapsulate message header
The header is 24 bytes fixed length, and includes the command and the length of the optional data portion.

:return: the header
Build the encapsulate message header The header is 24 bytes fixed length and includes the command and the length of the optional data portion . : return : the header
def _build_header(self, command, length) -> bytes:
        try:
            return b''.join([
                command,
                Pack.uint(length),  
                Pack.udint(self._plc._session),  
                b'\x00\x00\x00\x00',  
                self._plc.attribs['context'],  
                Pack.udint(self._plc.attribs['option']),  
            ])
        except Exception as e:
            raise CommError(e)
def _build_header ( self , command , length ) -> bytes : try : return b'' . join ( [ command , Pack . uint ( length ) , Pack . udint ( self . _plc . _session ) , b'\x00\x00\x00\x00' , self . _plc . attribs [ 'context' ] , Pack . udint ( self . _plc . attribs [ 'option' ] ) , ] ) except Exception as e : raise CommError ( e )
Build the encapsulate message header
The header is 24 bytes fixed length, and includes the command and the length of the optional data portion.
Build the encapsulate message header The header is 24 bytes fixed length and includes the command and the length of the optional data portion .
""" Build the encapsulate message header

        The header is 24 bytes fixed length, and includes the command and the length of the optional data portion.

         :return: the header
        """ # Length UINT # Session Handle UDINT # Status UDINT # Sender Context 8 bytes # Option UDINT
self
command
length