var
comDev : THANDLE;
buf : char;
Count:integer;
begin
comDev := CreateFile('COM1', GENERIC_READ or GENERIC_WRITE, 0, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nil);
if comDev <> INVALID_HANDLE_VALUE then
begin
buf := 'M';
WriteFile(comDev, buf, 1, Count, nil);
buf := 'S';
WriteFile(comDev, buf, 1, Count, nil);
end;
CloseHandle(comDev);
end;