develop/Logical/Libraries/ac_invlib/ac_invparameter.c
void create_parameterlist( ac_inv_AxIdent *ax_ident )
{
	int index_module = 0;
	ax_ident->number_of_parameters = 0;
	memset( &ax_ident->p_sorted_parameters, 0, sizeof(ax_ident->p_sorted_parameters) );
	while( ax_ident->p_alloc->pcfgpar[index_module] )
	{
		ax_ident->fub_datobjinfo.enable = 1;
		ax_ident->fub_datobjinfo.pName = ax_ident->p_alloc->pcfgpar[index_module];
		DatObjInfo( &ax_ident->fub_datobjinfo );
		if( ax_ident->fub_datobjinfo.status == 0 )
		{
			char *source = (char*) ax_ident->fub_datobjinfo.pDatObjMem;
			while( ax_ident->fub_datobjinfo.len ){					
				if( *source == 0 ){  /* end of a row ? */
					++ax_ident->number_of_parameters;	
					while( *source == 0 && ax_ident->fub_datobjinfo.len ){  /* ignore filling zeros */
						++source;
						--ax_ident->fub_datobjinfo.len;	
					}
				}
				else if( ax_ident->p_sorted_parameters[ax_ident->number_of_parameters] == 0 ) {  /* store pointer to parameter row */
					ax_ident->p_sorted_parameters[ax_ident->number_of_parameters] = (UDINT) source++;							
					ax_ident->fub_datobjinfo.len--;
				}
				else {
					source++;
					ax_ident->fub_datobjinfo.len--;
				}
			}
		}
		if( ++index_module >= 3	)  /* no more data modules */
			break;
	}
}
/* -------------------------------------------------------------------------------------
   create a list of parameters from the data modules
   -------------------------------------------------------------------------------------
*/
create a list of parameters from the data modules
create a list of parameters from the data modules
void create_parameterlist( ac_inv_AxIdent *ax_ident )
{
	int index_module = 0;
	ax_ident->number_of_parameters = 0;
	memset( &ax_ident->p_sorted_parameters, 0, sizeof(ax_ident->p_sorted_parameters) );
	while( ax_ident->p_alloc->pcfgpar[index_module] )
	{
		ax_ident->fub_datobjinfo.enable = 1;
		ax_ident->fub_datobjinfo.pName = ax_ident->p_alloc->pcfgpar[index_module];
		DatObjInfo( &ax_ident->fub_datobjinfo );
		if( ax_ident->fub_datobjinfo.status == 0 )
		{
			char *source = (char*) ax_ident->fub_datobjinfo.pDatObjMem;
			while( ax_ident->fub_datobjinfo.len ){					
				if( *source == 0 ){  
					++ax_ident->number_of_parameters;	
					while( *source == 0 && ax_ident->fub_datobjinfo.len ){  
						++source;
						--ax_ident->fub_datobjinfo.len;	
					}
				}
				else if( ax_ident->p_sorted_parameters[ax_ident->number_of_parameters] == 0 ) {  
					ax_ident->p_sorted_parameters[ax_ident->number_of_parameters] = (UDINT) source++;							
					ax_ident->fub_datobjinfo.len--;
				}
				else {
					source++;
					ax_ident->fub_datobjinfo.len--;
				}
			}
		}
		if( ++index_module >= 3	)  
			break;
	}
}
void create_parameterlist ( ac_inv_AxIdent * ax_ident ) { int index_module = 0 ; ax_ident -> number_of_parameters = 0 ; memset ( & ax_ident -> p_sorted_parameters , 0 , sizeof ( ax_ident -> p_sorted_parameters ) ) ; while ( ax_ident -> p_alloc -> pcfgpar [ index_module ] ) { ax_ident -> fub_datobjinfo . enable = 1 ; ax_ident -> fub_datobjinfo . pName = ax_ident -> p_alloc -> pcfgpar [ index_module ] ; DatObjInfo ( & ax_ident -> fub_datobjinfo ) ; if ( ax_ident -> fub_datobjinfo . status == 0 ) { char * source = ( char * ) ax_ident -> fub_datobjinfo . pDatObjMem ; while ( ax_ident -> fub_datobjinfo . len ) { if ( * source == 0 ) { ++ ax_ident -> number_of_parameters ; while ( * source == 0 && ax_ident -> fub_datobjinfo . len ) { ++ source ; -- ax_ident -> fub_datobjinfo . len ; } } else if ( ax_ident -> p_sorted_parameters [ ax_ident -> number_of_parameters ] == 0 ) { ax_ident -> p_sorted_parameters [ ax_ident -> number_of_parameters ] = ( UDINT ) source ++ ; ax_ident -> fub_datobjinfo . len -- ; } else { source ++ ; ax_ident -> fub_datobjinfo . len -- ; } } } if ( ++ index_module >= 3 ) break ; } }
create a list of parameters from the data modules
create a list of parameters from the data modules
/* end of a row ? */ /* ignore filling zeros */ /* store pointer to parameter row */ /* no more data modules */