FUNCTION "FC_TeleClear" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
   VAR_IN_OUT 
      stInOutTelegram : "UDT_TelegramData_Send";   // The telegram structure that will be cleared
   END_VAR

   VAR_TEMP 
      i : DInt;   // Loop-Variable
      j : DInt;   // Loop-Variable
      k : DInt;   // Loop-Variable
   END_VAR


BEGIN
	#stInOutTelegram.sIDString := '';
	#stInOutTelegram.nID := 0;
	#stInOutTelegram.xCRC32ValidationResult := FALSE;
	
	// FOR #i := 1 TO "TELEGRAM_DATA_MAX" DO
	//     FOR #j := 1 TO "TELEGRAM_DATA_FIELD_MAX" DO
	//         #stInOutTelegram.arData[#i, #j] := 0;
	//     END_FOR;
	// END_FOR;
	
	
	FOR #k := 1 TO "TELEGRAM_DATA_MAX" DO
	    #stInOutTelegram.arDataString[#k] := '';
	END_FOR;
	
	#stInOutTelegram.nDataCount := 1;
	
END_FUNCTION

