pycomm3/clx.py
def _get_instance_attribute_list_service(self, program=None):
        """ Step 1: Finding user-created controller scope tags in a Logix5000 controller

        This service returns instance IDs for each created instance of the symbol class, along with a list
        of the attribute data associated with the requested attribute
        """
        try:
            last_instance = 0
            tag_list = []
            while last_instance != -1:
                # Creating the Message Request Packet
                path = []
                if program:
                    if not program.startswith('Program:'):
                        program = f'Program:{program}'
                    path = [EXTENDED_SYMBOL, Pack.usint(len(program)), program.encode('utf-8')]
                    if len(program) % 2:
                        path.append(b'\x00')

                # just manually build the request path b/c there my be the extended symbol portion
                path += [
                    # Request Path ( 20 6B 25 00 Instance )
                    CLASS_TYPE["8-bit"],  # Class id = 20 from spec 0x20
                    ClassCode.symbol_object,  # Logical segment: Symbolic Object 0x6B
                    INSTANCE_TYPE["16-bit"],  # Instance Segment: 16 Bit instance 0x25
                    Pack.uint(last_instance),  # The instance
                ]
                path = b''.join(path)
                path_size = Pack.usint(len(path) // 2)
                request = self.new_request('send_unit_data')

                attributes = [
                    b'\x01\x00',  # Attr. 1: Symbol name
                    b'\x02\x00',  # Attr. 2 : Symbol Type
                    b'\x03\x00',  # Attr. 3 : Symbol Address
                    b'\x05\x00',  # Attr. 5 : Symbol Object Address
                    b'\x06\x00',  # Attr. 6 : ? - Not documented (Software Control?)
                    b'\x08\x00'  # Attr. 8 : array dimensions [1,2,3]
                ]

                if self.info.get('version_major', 0) >= MIN_VER_EXTERNAL_ACCESS:
                    attributes.append(b'\x0a\x00')  # Attr. 10 : external access

                request.add(
                    TagService.get_instance_attribute_list,
                    path_size,
                    path,
                    Pack.uint(len(attributes)),
                    *attributes

                )
                response = request.send()
                if not response:
                    raise DataError(f"send_unit_data returned not valid data - {response.error}")

                last_instance = self._parse_instance_attribute_list(response, tag_list)
            return tag_list

        except Exception as err:
            raise DataError('failed to get attribute list') from err
 Step 1: Finding user-created controller scope tags in a Logix5000 controller

        This service returns instance IDs for each created instance of the symbol class, along with a list
        of the attribute data associated with the requested attribute
        
Step 1: Finding user-created controller scope tags in a Logix5000 controller
This service returns instance IDs for each created instance of the symbol class, along with a list
of the attribute data associated with the requested attribute
Step 1 : Finding user - created controller scope tags in a Logix5000 controller This service returns instance IDs for each created instance of the symbol class along with a list of the attribute data associated with the requested attribute
def _get_instance_attribute_list_service(self, program=None):
        try:
            last_instance = 0
            tag_list = []
            while last_instance != -1:
                path = []
                if program:
                    if not program.startswith('Program:'):
                        program = f'Program:{program}'
                    path = [EXTENDED_SYMBOL, Pack.usint(len(program)), program.encode('utf-8')]
                    if len(program) % 2:
                        path.append(b'\x00')
                path += [
                    CLASS_TYPE["8-bit"],  
                    ClassCode.symbol_object,  
                    INSTANCE_TYPE["16-bit"],  
                    Pack.uint(last_instance),  
                ]
                path = b''.join(path)
                path_size = Pack.usint(len(path) // 2)
                request = self.new_request('send_unit_data')
                attributes = [
                    b'\x01\x00',  
                    b'\x02\x00',  
                    b'\x03\x00',  
                    b'\x05\x00',  
                    b'\x06\x00',  
                    b'\x08\x00'  
                ]
                if self.info.get('version_major', 0) >= MIN_VER_EXTERNAL_ACCESS:
                    attributes.append(b'\x0a\x00')  
                request.add(
                    TagService.get_instance_attribute_list,
                    path_size,
                    path,
                    Pack.uint(len(attributes)),
                    *attributes
                )
                response = request.send()
                if not response:
                    raise DataError(f"send_unit_data returned not valid data - {response.error}")
                last_instance = self._parse_instance_attribute_list(response, tag_list)
            return tag_list
        except Exception as err:
            raise DataError('failed to get attribute list') from err
def _get_instance_attribute_list_service ( self , program = None ) : try : last_instance = 0 tag_list = [ ] while last_instance != - 1 : path = [ ] if program : if not program . startswith ( 'Program:' ) : program = f'Program:{program}' path = [ EXTENDED_SYMBOL , Pack . usint ( len ( program ) ) , program . encode ( 'utf-8' ) ] if len ( program ) % 2 : path . append ( b'\x00' ) path += [ CLASS_TYPE [ "8-bit" ] , ClassCode . symbol_object , INSTANCE_TYPE [ "16-bit" ] , Pack . uint ( last_instance ) , ] path = b'' . join ( path ) path_size = Pack . usint ( len ( path ) // 2 ) request = self . new_request ( 'send_unit_data' ) attributes = [ b'\x01\x00' , b'\x02\x00' , b'\x03\x00' , b'\x05\x00' , b'\x06\x00' , b'\x08\x00' ] if self . info . get ( 'version_major' , 0 ) >= MIN_VER_EXTERNAL_ACCESS : attributes . append ( b'\x0a\x00' ) request . add ( TagService . get_instance_attribute_list , path_size , path , Pack . uint ( len ( attributes ) ) , * attributes ) response = request . send ( ) if not response : raise DataError ( f"send_unit_data returned not valid data - {response.error}" ) last_instance = self . _parse_instance_attribute_list ( response , tag_list ) return tag_list except Exception as err : raise DataError ( 'failed to get attribute list' ) from err
Step 1: Finding user-created controller scope tags in a Logix5000 controller
This service returns instance IDs for each created instance of the symbol class, along with a list
of the attribute data associated with the requested attribute
Step 1 : Finding user - created controller scope tags in a Logix5000 controller This service returns instance IDs for each created instance of the symbol class along with a list of the attribute data associated with the requested attribute
""" Step 1: Finding user-created controller scope tags in a Logix5000 controller

        This service returns instance IDs for each created instance of the symbol class, along with a list
        of the attribute data associated with the requested attribute
        """ # Creating the Message Request Packet # just manually build the request path b/c there my be the extended symbol portion # Request Path ( 20 6B 25 00 Instance ) # Class id = 20 from spec 0x20 # Logical segment: Symbolic Object 0x6B # Instance Segment: 16 Bit instance 0x25 # The instance # Attr. 1: Symbol name # Attr. 2 : Symbol Type # Attr. 3 : Symbol Address # Attr. 5 : Symbol Object Address # Attr. 6 : ? - Not documented (Software Control?) # Attr. 8 : array dimensions [1,2,3] # Attr. 10 : external access
self
program