pycomm3/clx.py
def _read_build_multi_requests(self, parsed_tags):
        """
        creates a list of multi-request packets
        """
        requests = []
        response_size = MULTISERVICE_READ_OVERHEAD
        current_request = self.new_request('multi_request')
        requests.append(current_request)
        tags_in_requests = set()
        for tag, tag_data in parsed_tags.items():
            if tag_data.get('error') is None and (tag_data['plc_tag'], tag_data['elements']) not in tags_in_requests:
                tags_in_requests.add((tag_data['plc_tag'], tag_data['elements']))
                return_size = _tag_return_size(tag_data)
                if return_size > self.connection_size:
                    _request = self.new_request('read_tag_fragmented')
                    _request.add(tag_data['plc_tag'], tag_data['elements'], tag_data['tag_info'])
                    requests.append(_request)
                else:
                    try:
                        return_size += 2  # add 2 bytes for offset list in reply
                        if response_size + return_size < self.connection_size:
                            if current_request.add_read(tag_data['plc_tag'], tag_data['elements'], tag_data['tag_info']):
                                response_size += return_size
                            else:
                                response_size = return_size + MULTISERVICE_READ_OVERHEAD
                                current_request = self.new_request('multi_request')
                                current_request.add_read(tag_data['plc_tag'], tag_data['elements'], tag_data['tag_info'])
                                requests.append(current_request)
                        else:
                            response_size = return_size + MULTISERVICE_READ_OVERHEAD
                            current_request = self.new_request('multi_request')
                            current_request.add_read(tag_data['plc_tag'], tag_data['elements'], tag_data['tag_info'])
                            requests.append(current_request)
                    except RequestError:
                        self.__log.exception(f'Failed to build request for {tag} - skipping')
                        continue
            else:
                self.__log.error(f'Skipping making request for {tag}, error: {tag_data.get("error")}')
                continue

        return (r for r in requests if (r.type_ == 'multi' and r.tags) or r.type_ == 'read')

        creates a list of multi-request packets
        
creates a list of multi-request packets
creates a list of multi - request packets
def _read_build_multi_requests(self, parsed_tags):
        requests = []
        response_size = MULTISERVICE_READ_OVERHEAD
        current_request = self.new_request('multi_request')
        requests.append(current_request)
        tags_in_requests = set()
        for tag, tag_data in parsed_tags.items():
            if tag_data.get('error') is None and (tag_data['plc_tag'], tag_data['elements']) not in tags_in_requests:
                tags_in_requests.add((tag_data['plc_tag'], tag_data['elements']))
                return_size = _tag_return_size(tag_data)
                if return_size > self.connection_size:
                    _request = self.new_request('read_tag_fragmented')
                    _request.add(tag_data['plc_tag'], tag_data['elements'], tag_data['tag_info'])
                    requests.append(_request)
                else:
                    try:
                        return_size += 2  
                        if response_size + return_size < self.connection_size:
                            if current_request.add_read(tag_data['plc_tag'], tag_data['elements'], tag_data['tag_info']):
                                response_size += return_size
                            else:
                                response_size = return_size + MULTISERVICE_READ_OVERHEAD
                                current_request = self.new_request('multi_request')
                                current_request.add_read(tag_data['plc_tag'], tag_data['elements'], tag_data['tag_info'])
                                requests.append(current_request)
                        else:
                            response_size = return_size + MULTISERVICE_READ_OVERHEAD
                            current_request = self.new_request('multi_request')
                            current_request.add_read(tag_data['plc_tag'], tag_data['elements'], tag_data['tag_info'])
                            requests.append(current_request)
                    except RequestError:
                        self.__log.exception(f'Failed to build request for {tag} - skipping')
                        continue
            else:
                self.__log.error(f'Skipping making request for {tag}, error: {tag_data.get("error")}')
                continue
        return (r for r in requests if (r.type_ == 'multi' and r.tags) or r.type_ == 'read')
def _read_build_multi_requests ( self , parsed_tags ) : requests = [ ] response_size = MULTISERVICE_READ_OVERHEAD current_request = self . new_request ( 'multi_request' ) requests . append ( current_request ) tags_in_requests = set ( ) for tag , tag_data in parsed_tags . items ( ) : if tag_data . get ( 'error' ) is None and ( tag_data [ 'plc_tag' ] , tag_data [ 'elements' ] ) not in tags_in_requests : tags_in_requests . add ( ( tag_data [ 'plc_tag' ] , tag_data [ 'elements' ] ) ) return_size = _tag_return_size ( tag_data ) if return_size > self . connection_size : _request = self . new_request ( 'read_tag_fragmented' ) _request . add ( tag_data [ 'plc_tag' ] , tag_data [ 'elements' ] , tag_data [ 'tag_info' ] ) requests . append ( _request ) else : try : return_size += 2 if response_size + return_size < self . connection_size : if current_request . add_read ( tag_data [ 'plc_tag' ] , tag_data [ 'elements' ] , tag_data [ 'tag_info' ] ) : response_size += return_size else : response_size = return_size + MULTISERVICE_READ_OVERHEAD current_request = self . new_request ( 'multi_request' ) current_request . add_read ( tag_data [ 'plc_tag' ] , tag_data [ 'elements' ] , tag_data [ 'tag_info' ] ) requests . append ( current_request ) else : response_size = return_size + MULTISERVICE_READ_OVERHEAD current_request = self . new_request ( 'multi_request' ) current_request . add_read ( tag_data [ 'plc_tag' ] , tag_data [ 'elements' ] , tag_data [ 'tag_info' ] ) requests . append ( current_request ) except RequestError : self . __log . exception ( f'Failed to build request for {tag} - skipping' ) continue else : self . __log . error ( f'Skipping making request for {tag}, error: {tag_data.get("error")}' ) continue return ( r for r in requests if ( r . type_ == 'multi' and r . tags ) or r . type_ == 'read' )
creates a list of multi-request packets
creates a list of multi - request packets
"""
        creates a list of multi-request packets
        """ # add 2 bytes for offset list in reply
self
parsed_tags