2005-10-19
评论4
楼主 2004/12/4 9:33:27
发送端: Option Explicit '''''''''''''''''''''''''''''''''''''' Private Sub CmdExit_Click() Comm1.PortOpen = False End End Sub '''''''''''''''''''''''''''''''''''''' Private Sub CmdSend_Click() Comm1.Output = Trim(txtsend.Text) End Sub '''''''''''''''''''''''''''''''''''''' Private Sub Form_Load() Comm1.PortOpen = True End Sub —————————————————————————————————————— 接收端: Private Sub cmdexit_Click() Comm1.PortOpen = False End End Sub '''''''''''''''''''''''''''''''''''''' Private Sub CmdReceive_Click() Dim buf$ buf = Trim(Comm1.Input) If Len(buf) = 0 Then TxtReceive.Text = "empty" Else TxtReceive.Text = buf End If End Sub Private Sub Form_Load() Comm1.PortOpen = True End Sub (转载)
楼主 2005/7/7 11:51:51
我做了一个外接的loopback,在同一台电脑上测试一下,看能不能发送和接受数据,好象不能用啊,什么都收不到啊
楼主 2005/7/17 21:54:30
你的协议没有设置好
楼主 2005/10/19 13:26:56
不设置协议可以吗?我用串口控制仪器,为何控制不到,发送控制命令时,仪器有出错报警。可能是那方面的原因?