pycomm3/packets/requests.py
def _create_tag_rp(tag, tag_cache, use_instance_ids):
    """

    It returns the request packed wrapped around the tag passed.
    If any error it returns none
    """

    tags = tag.split('.')
    if tags:
        base, *attrs = tags
        base_tag, index = _find_tag_index(base)
        if use_instance_ids and base_tag in tag_cache:
            rp = [CLASS_TYPE['8-bit'],
                  ClassCode.symbol_object,
                  INSTANCE_TYPE['16-bit'],
                  Pack.uint(tag_cache[base_tag]['instance_id'])]
        else:
            base_len = len(base_tag)
            rp = [EXTENDED_SYMBOL,
                  Pack.usint(base_len),
                  base_tag.encode()]
            if base_len % 2:
                rp.append(b'\x00')
        if index is None:
            return None
        else:
            rp += _encode_tag_index(index)

        for attr in attrs:
            attr, index = _find_tag_index(attr)
            tag_length = len(attr)
            # Create the request path
            attr_path = [EXTENDED_SYMBOL,
                         Pack.usint(tag_length),
                         attr.encode()]
            # Add pad byte because total length of Request path must be word-aligned
            if tag_length % 2:
                attr_path.append(b'\x00')
            # Add any index
            if index is None:
                return None
            else:
                attr_path += _encode_tag_index(index)
            rp += attr_path

        return Pack.epath(b''.join(rp))

    return None


    It returns the request packed wrapped around the tag passed.
    If any error it returns none
    
It returns the request packed wrapped around the tag passed.
If any error it returns none
It returns the request packed wrapped around the tag passed . If any error it returns none
def _create_tag_rp(tag, tag_cache, use_instance_ids):
    tags = tag.split('.')
    if tags:
        base, *attrs = tags
        base_tag, index = _find_tag_index(base)
        if use_instance_ids and base_tag in tag_cache:
            rp = [CLASS_TYPE['8-bit'],
                  ClassCode.symbol_object,
                  INSTANCE_TYPE['16-bit'],
                  Pack.uint(tag_cache[base_tag]['instance_id'])]
        else:
            base_len = len(base_tag)
            rp = [EXTENDED_SYMBOL,
                  Pack.usint(base_len),
                  base_tag.encode()]
            if base_len % 2:
                rp.append(b'\x00')
        if index is None:
            return None
        else:
            rp += _encode_tag_index(index)
        for attr in attrs:
            attr, index = _find_tag_index(attr)
            tag_length = len(attr)
            attr_path = [EXTENDED_SYMBOL,
                         Pack.usint(tag_length),
                         attr.encode()]
            if tag_length % 2:
                attr_path.append(b'\x00')
            if index is None:
                return None
            else:
                attr_path += _encode_tag_index(index)
            rp += attr_path
        return Pack.epath(b''.join(rp))
    return None
def _create_tag_rp ( tag , tag_cache , use_instance_ids ) : tags = tag . split ( '.' ) if tags : base , * attrs = tags base_tag , index = _find_tag_index ( base ) if use_instance_ids and base_tag in tag_cache : rp = [ CLASS_TYPE [ '8-bit' ] , ClassCode . symbol_object , INSTANCE_TYPE [ '16-bit' ] , Pack . uint ( tag_cache [ base_tag ] [ 'instance_id' ] ) ] else : base_len = len ( base_tag ) rp = [ EXTENDED_SYMBOL , Pack . usint ( base_len ) , base_tag . encode ( ) ] if base_len % 2 : rp . append ( b'\x00' ) if index is None : return None else : rp += _encode_tag_index ( index ) for attr in attrs : attr , index = _find_tag_index ( attr ) tag_length = len ( attr ) attr_path = [ EXTENDED_SYMBOL , Pack . usint ( tag_length ) , attr . encode ( ) ] if tag_length % 2 : attr_path . append ( b'\x00' ) if index is None : return None else : attr_path += _encode_tag_index ( index ) rp += attr_path return Pack . epath ( b'' . join ( rp ) ) return None
It returns the request packed wrapped around the tag passed.
It returns the request packed wrapped around the tag passed .
"""

    It returns the request packed wrapped around the tag passed.
    If any error it returns none
    """ # Create the request path # Add pad byte because total length of Request path must be word-aligned # Add any index
tag
tag_cache
use_instance_ids