Introduction - If you have any usage issues, please Google them yourself
Use RS-232 Com port send and receive data
Private Sub btnOpenCOM_Click()
//設定Com Port 號碼
MSComm1.CommPort = CInt(txtCOM.Text)
//Set Dataformat
MSComm1.Settings = "9600,n,8,1"
//開啟Com Port
MSComm1.PortOpen = True
End Sub
Private Sub btnSend_Click()
//傳送資料
MSComm1.Output = txtSend.Text
End Sub
Private Sub cmdReceive_Click()
//接收資料
txtReceive.Text = txtReceive.Text & MSComm1.Input
End Sub