
(* any combination of flyways and xbots - GetErrorLog, GetWarningLog. Any existing 'warning_log.txt' or 'error_log.txt' file in the root directory of the FileDevice will be overwritten *)
FUNCTION_BLOCK FileExample02_ReadLogs
	//get the PMC warning log
	PMC_GetWarningLog1(Execute := Execute,Bytes := warninglog,PM_Controller := PM_Controller);

	//write the warning log to disk
	write_warning_log(Execute := PMC_GetWarningLog1.Done,file_device := FileDevice,file_path := 'warning_log.txt',data_adr := ADR(warninglog),file_size := PMC_GetWarningLog1.nBytes);

	//get the PMC error log
	PMC_GetErrorLog1(Execute := write_warning_log.Done,Bytes := errorlog,PM_Controller := PM_Controller);

	//write the error log to disk
	write_error_log(Execute := PMC_GetErrorLog1.Done,file_device := FileDevice,file_path := 'error_log.txt',data_adr := ADR(errorlog),file_size := PMC_GetErrorLog1.nBytes);
	Done := write_error_log.Done;
END_FUNCTION_BLOCK
