initialization lCom := tComport.create(nil); with lCom do begin BaudRate := comport.br9600; DeviceName := 'COM1'; open; active := true; WriteString(#$0d); end; finalization with lCom do begin active := false; close; free; end; end.