ORGANIZATION_BLOCK "Programming error"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1

BEGIN
	"DB_Error".BlockNr := #BlockNr;
	"DB_Error".Reaction := #Reaction;
	"DB_Error".Fault_ID := #Fault_ID;
	"DB_Error".BlockType := #BlockType;
	"DB_Error".Area := #Area;
	"DB_Error".DBNr := #DBNr;
	"DB_Error".Csg_OBNr := #Csg_OBNr;
	"DB_Error".Csg_Prio := #Csg_Prio;
	"DB_Error".Width := #Width;
	"DB_Error".xErrorActive := TRUE; //Wird am Anfang von OB1 wieder auf FALSE gesetzt
	CASE #BlockType OF
	    16#01:
	        //Fehler in OB
	        "DB_Error".sErrorText := CONCAT_STRING(IN1 := 'Programming Error in OB ', IN2 := UINT_TO_STRING(#BlockNr));
	    16#02:
	        //Fehler in FC
	        "DB_Error".sErrorText := CONCAT_STRING(IN1 := 'Programming Error in FC ', IN2 := UINT_TO_STRING(#BlockNr));
	    16#03:
	        //Fehler in FB
	        "DB_Error".sErrorText := CONCAT_STRING(IN1 := 'Programming Error in FB ', IN2 := UINT_TO_STRING(#BlockNr));
	    16#06:
	        //Fehler in DB
	        "DB_Error".sErrorText := CONCAT_STRING(IN1 := 'Programming Error in DB ', IN2 := UINT_TO_STRING(#BlockNr));
	END_CASE;
	        
END_ORGANIZATION_BLOCK

