保存桌面快捷方式 - - 设为首页 - 手机版
凹丫丫旗下网站:四字成语大全 - 故事大全 - 范文大全
您现在的位置: 范文大全 >> 理工论文 >> 计算机论文 >> 正文

用Visual Basic 5.0开发无线通讯数据采集应用程序



BinDataarr = BinData

UserDataLenth = BinDataarr(5) '用户数据的长度

Wait1:

    If BinDataarr(5) > frmTerminal.MSComm1.InBufferCount Then   '未接受完数据

        delay 6 '延时6s

        GoTo Wait1

    End If

    frmTerminal.MSComm1.InputLen = UserDataLenth

    BinData = frmTerminal.MSComm1.Input

  ReDim Preserve BinDataarr(UserDataLenth)

   &nbs

p;BinDataarr = BinData

   GetStringFromComm = BinTotext(UserDataLenth, 0)

  frmTerminal.MSComm1.InBufferCount = 0 '清空接受缓冲区

End Function

2 从串口向电台发送数据程序SendStringToComm()

Public Sub SendStringToComm(ByVal TransCommand As Integer, ByVal TransString As String)

ReDim BinDataarr(5)

frmTerminal.MSComm1.OutBufferCount = 0    '//清空发送缓冲区

'TransString = makestring(Val(mc.txtdesstation.Text), 4) + TransString

'//设置标志码

(略)

Select Case TransCommand

    Case 0:transmit text

        ReDim Preserve BinDataarr(6 + Len(TransString))

        TextTobin (TransString)

        BinData = BinDataarr

        frmTerminal.MSComm1.Output = BinData  '发送

    Case 1:transmit binary data

        ReDim Preserve BinDataArr(5 + Len(TransString) + UserDataLenth) As Byte

        TextTobin (TransString)

        BinDataArr(5) = UserDataLenth + Len(TransString)

        Dim i As Integer

       For i = 1 To UserDataLenth

        BinDataArr(5 + Len(TransString) +

《用Visual Basic 5.0开发无线通讯数据采集应用程序(第2页)》
本文链接地址:http://www.oyaya.net/fanwen/view/168029.html

★温馨提示:你可以返回到 计算机论文 也可以利用本站页顶的站内搜索功能查找你想要的文章。