文件名称:CommTest485
- 所属分类:
- 串口编程
- 资源属性:
- [Windows] [Visual C] [Basic/ASP] [源码]
- 上传时间:
- 2015-07-23
- 文件大小:
- 19kb
- 下载次数:
- 0次
- 提 供 者:
- 王**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
测试com口程序Private Sub Form_Load()
Dim I As Integer
Dim Msg As String
Me.Enabled = False
Msg = 串行端口通讯测试 V & App.Major & . & App.Minor & App.Revision
cboCommSettings.Text = GetSetting(App.EXEName, frmCommTest , CommSettings , 2400,N,8,1 )
Me.Show
Me.Refresh
With MSComm1
For I = 1 To 16
Me.Caption = Msg & - 测试通讯端口:COM & I & ...
Me.Refresh
Delay 100
On Error Resume Next
.CommPort = I
.Settings = 2400,N,8,1
.PortOpen = True
.PortOpen = False
If Err = 0 Then cboCommPort.AddItem COM & Trim(I)
Next I
End With
cboCommPort.ListIndex = 0
optCommData(0).Value = True
Me.Caption = Msg & (Programming by WJY)
Me.Refresh
If cboCommPort.ListCount = 0 Then MsgBox 程序检测不到可用的串行端口!
Me.Enabled = True
End Sub
-test com port
Dim I As Integer
Dim Msg As String
Me.Enabled = False
Msg = 串行端口通讯测试 V & App.Major & . & App.Minor & App.Revision
cboCommSettings.Text = GetSetting(App.EXEName, frmCommTest , CommSettings , 2400,N,8,1 )
Me.Show
Me.Refresh
With MSComm1
For I = 1 To 16
Me.Caption = Msg & - 测试通讯端口:COM & I & ...
Me.Refresh
Delay 100
On Error Resume Next
.CommPort = I
.Settings = 2400,N,8,1
.PortOpen = True
.PortOpen = False
If Err = 0 Then cboCommPort.AddItem COM & Trim(I)
Next I
End With
cboCommPort.ListIndex = 0
optCommData(0).Value = True
Me.Caption = Msg & (Programming by WJY)
Me.Refresh
If cboCommPort.ListCount = 0 Then MsgBox 程序检测不到可用的串行端口!
Me.Enabled = True
End Sub
-test com port
(系统自动生成,下载前可以参看下载内容)
下载文件列表
CommTest485
...........\CommTest.frm
...........\COMMTEST.FRX
...........\Commtest.PDM
...........\CommTest.SWT
...........\Commtest.vbp
...........\COMMTEST.VBW
...........\CommTest485.exe
...........\desktop.ini
...........\MSSCCPRJ.SCC