DCB: TDCB;
FHandle: THandle;
BytesTrans: Integer;
FHandle := CreateFile(
PChar('//./' + FPort),
GENERIC_READ or GENERIC_WRITE,
0,
nil,
OPEN_EXISTING,
0,
0);
DCB.DCBlength := SizeOf(TDCB);
GetCommState(FHandle, @DCB);
DCB.BaudRate := 2400;
...
SetCommState(FHandle, DCB);
WriteFile(FHandle, Str, Count, BytesTrans, 0);