推 johnpage: 重點 10/03 05:57
→ johnpage: 應該是要多加" //.//" 10/03 05:57
我不太清楚要加在哪邊,我的程式碼是這一段
看起來都像是只用到數字而已?
void __fastcall TForm1::Button3Click(TObject *Sender)
{
// if (Comm1->PortOpen)
// {Comm1->PortOpen=false;}
Comm1->CommPort=TComPortNumber(ComPort->ItemIndex);
Comm1->RThreshold=11;
//-----------default----------------
Comm1->BaudRate=br1200;
Comm1->DataBits=DB8;
Comm1->HwHandShaking=hhNone;
Comm1->SwHandShaking=shNone;
Comm1->Parity=None;
Comm1->StopBits=SB1;
//----------------------------------
if (Comm1->PortOpen)
{
Comm1->PortOpen = false;
Button3->Caption="Open";
}
else
{
Comm1->PortOpen = true;
Button3->Caption="Close";
}
StatusBar1->SimpleText = "Status: Link to
Com"+IntToStr(ComPort->ItemIndex+1)+" 1200,8,N,1"; //COM寫入數值
}
推 johnpage: c 10/03 12:29
推 johnpage: com port的device name設為\\.\com11 10/03 12:31
額外再加這一行的意思嗎?因為1-9都沒用到
※ 編輯: sakido (140.138.227.152), 10/03/2014 12:39:59