Private Sub Command1_Click()
Dim BL As Byte '数据长度
Dim n As Byte '循环量
Dim Cmd As String '字符串
Dim fx() As Byte '发送的数据
Cmd = Text1.Text
BL = Len(Cmd) / 2
ReDim fx(BL - 1) '按命令长度重新定义数组
For n = 0 To BL - 1
fx(n) = CLng("&H" & Mid(Cmd, 2 * n + 1, 2)) '分解命令为字节
Next
MSComm1.Output = fx() '发送命令,字节形式
不清楚再联系我
注意:要把通信控件inputmode属性设为1