FUNCTION "FC_WriteDatalogToDB" : Bool
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
   VAR_INPUT 
      sErrorData : "DataLogBuffer";
   END_VAR


BEGIN
	// unten reinschieben -> Fifo
	 
	 IF "dbDataLogBuffer".nIdx < "cNoTempDataLog" THEN
	     "dbDataLogBuffer".nIdx += 1;
	     "dbDataLogBuffer".DataLogBuffer["dbDataLogBuffer".nIdx] := #sErrorData;
	     IF "dbDataLogBuffer".nIdxMax < "dbDataLogBuffer".nIdx THEN
	         "dbDataLogBuffer".nIdxMax := "dbDataLogBuffer".nIdx;
	     END_IF;
	     #FC_WriteDatalogToDB := TRUE;
	 ELSE
	     #FC_WriteDatalogToDB := FALSE;
	 END_IF;
	
END_FUNCTION

