CCS Modul   R_FAULTMEM2
 
   $Id: r_faultmem2.C,v 1.1 2005/01/10 12:47:02 nit3an Exp $
   ---------------------------------------------------------------------
   Kurzbeschreibung: 	searches for a target error
   ---------------------------------------------------------------------
   Projekt:		testlisten_anw_module
   Sourcefile:		r_faultmem2.C
   Autor:		AnW/TEF7-Thomas Nickel (28.12.2004)
   Zielsystem:		HP9000/V743 (HP-RT 3.01), /7/C/D (HP-UX 10.20), Linux
   Sprache:		ANSI-C/C++
   ---------------------------------------------------------------------
   Prototyp:
   
   int r_faultmem2
   (shm_stringpointer *zeilen_wert  // <I> Pointer to anzahl STRING parameters
   ,long index   		    // <I> Index number
   ,long anzahl)		    // <I> Number of values
   
   ---------------------------------------------------------------------
   Aufruf:
   error = r_faultmem2
   (*zeilen_wert	// <I> Pointer to anzahl STRING parameters
   ,index		// <I> Index number
   ,anzahl)		// <I> Number of values
   
   if (error != 0) 	// Fehlerbeschreibung ... 
   {
   // Fehlerhandling ... 
   }
   
   ---------------------------------------------------------------------
   Funktionsbeschreibung: Searches for an error number in a hexadecimal input
   string with ECU fault memory data and:
   - returns error number or state flags if the target error number was found
   - returns "0" if the target error number was not found.
   
   Description of module parameters:
1 PRUEFSCHRITT
   GAUDI teststep
2 POSITION
   PAV-position
3 INPUT_STRING
   hexadecimal input string from ECU fault memory (got with module P_AUFTRAG).
   Values are streams of 4 hexadecimal characters each without separation
   characters between them. Every value has an error number and 6 state flags.
   Bit  0 - 9: error number,
   Bit 10 -15: state flags (values 0 or 1).
   The first 4*ERR_COUNT (see next parameter) characters are searched for the target
   error number. E.g.: INPUT_STRING="A753B60FCFAB89B3" will be separated into parts:
   A753 B60F CFAB  (if ERR_COUNT=3)
   separation into bits:
      A753 --> 1010 0111 0101 0011, B60F --> 1011 0110 0000 1111, ...
   separation into state flags and error numbers:
          A753   		   B60F   	       CFAB
   state: 1010 01=0x29=41   	   1011 01=0x2D=45     1100 11=0x33=51
   error: 11 0101 0011=0x353=851   10 0000 1111=0x20F  11 1010 1011=0x3AB
                                   =527                =939
4 ERR_COUNT
   Number of the error numbers in input string which are searched for from the beginning,
   allowed values are 1 <= ERR_COUNT <= MAXERR (see defines); e.g.: 3
5 OUTPUTFLAG
   The OUTPUTFLAG can be set to ERRNO or STATE (see paragraph RESULT_NUMMER1)
6 TARGET_ERRNO
   A decimal error number which is searched for in the input string,
   e.g.: TARGET_ERRNO="527"
7 RESULT_NUMMER1
   The result string containing in case of
   OUTPUTFLAG=ERRNO: the TARGET_ERRNO as decimal number if found, else "0"; e.g. "527"
   OUTPUTFLAG=STATE: the state flags as hexadecimal number if the target error number
                     was found, else "0"; e.g. "2D"