各位大侠,请帮帮小弟!
我在VB中用mscomm控件同一块嵌入式Linux单片机通信。
我可以接收到从单片机返回的以下信息:
Use External PCI Clock
Processor: SL3316a3
PCI Enable
AHB Bus Clock:100MHz Ratio:3/2
RAM: 0x00000000-0x04000000, 0x00049250-0x03fef000 available
FLASH: 0x70000000 - 0x70800000, 135 blocks of 0x00010000 bytes each.
==> enter ^C to abort booting within 3 seconds ......接着,我就要给单片机发送一个ctrl+C的命令。我试着发送MSComm1.output = 3 '3为Ctrl^c的ASCII码
可是,单片机并没有任何提示。请问,我应该如何给这个单片机发送ctrl+c命令呢?谢谢!!!如果命令发送成功,会有以下的提示符:
Boot Menu
====================================================================
1: Start the Kernel Code
2: List Image
3: Delete Image
4: Create New Image
5: Set IP adderss
6: Setting MAC addressX:Upgrade Boot Y:Upgrade Kernel=> Select:
我在VB中用mscomm控件同一块嵌入式Linux单片机通信。
我可以接收到从单片机返回的以下信息:
Use External PCI Clock
Processor: SL3316a3
PCI Enable
AHB Bus Clock:100MHz Ratio:3/2
RAM: 0x00000000-0x04000000, 0x00049250-0x03fef000 available
FLASH: 0x70000000 - 0x70800000, 135 blocks of 0x00010000 bytes each.
==> enter ^C to abort booting within 3 seconds ......接着,我就要给单片机发送一个ctrl+C的命令。我试着发送MSComm1.output = 3 '3为Ctrl^c的ASCII码
可是,单片机并没有任何提示。请问,我应该如何给这个单片机发送ctrl+c命令呢?谢谢!!!如果命令发送成功,会有以下的提示符:
Boot Menu
====================================================================
1: Start the Kernel Code
2: List Image
3: Delete Image
4: Create New Image
5: Set IP adderss
6: Setting MAC addressX:Upgrade Boot Y:Upgrade Kernel=> Select:
解决方案 »
- 求助。如何获得IE窗口的句柄
- 找到二个数组中第几大的数据。(答案讨论贴),如果想答题拿分的建议先去答题,再来看答案
- Dim rs1 As New ADODB.Recordset,编译时说用户类型未定义??是怎么回事啊???谢谢
- 一个奇怪的问题。
- 窗体的初始化
- 为何查询时总是说“至少一个参数没有被指定”??????
- 如何数据库可用空间检测?
- 怎样得到当前程序所在的目录路径?
- 程序打包在WIN98中如何进行???
- 关于winsock的延时问题
- 模块内的函数好象是软件认为它没定义,提示compile error:Ambiguous name detected:checkport,是什么原因?
- 高手帮忙啊,如何用INET控件来获取.net页面上datagrid控件里的第2页的源代码?
a(0)=3
MSComm1.output =a
If Comm1.PortOpen = False Then
Comm1.PortOpen = True
Comm1.InputMode = comInputModeBinary
End If
Form1.Comm1.CommPort= 2
Form1.Comm1.Settings=2400,n,8,1
发送函数如下:
Private Sub send_Click()
Dim check_sumer, check_sum, check_response As Integer
Dim i As Integer
Dim bytebuf(1 To 1) As Byte
Dim buf1$
check_sum = 0
'设置进度条,检查串口
If Comm1.PortOpen = False Then
MsgBox "请打开串口", vbOKOnly, ""
Else
Counter = Len(Trim(textS.Text)) '计算发送数据的长度
ProgressBar1.Min = 0
ProgressBar1.Max = 512
ProgressBar1.Visible = True
ProgressBar1.Value = ProgressBar1.Min
'接收到的字节数
'If check_sumer Mod 4 = 1 Or check_sumer Mod 4 = 2 Or check_sumer Mod 4 = 3 Then
' bytebuf(1) = Int(counter/ 4) + 1
' Else
' bytebuf(1) = Int(counter/ 4)
bytebuf(1) = 128
Comm1.Output = bytebuf
'按照每次发送四个数据的批次发送
For i = 1 To 512 Step 4
If i <= Counter Then
buf1 = Mid(textS.Text, i, 4)
bytebuf(1) = Operate(buf1)
If bytebuf(1) = 255 Then
Comm1.Output = bytebuf
Exit Sub
Else
check_sum = check_sum + bytebuf(1)
End If
If check_sum > 25600 Then
check_sum = check_sum - 25600
End If
Else '发送零,以清显存
bytebuf(1) = 0
End If
Comm1.Output = bytebuf
ProgressBar1.Value = i
Next i
'发送累加和
Delay 100
check_sum = check_sum Mod 256
bytebuf(1) = check_sum
Comm1.Output = bytebuf
ProgressBar1.Visible = False
send.Enabled = False
'接收回应信息
Delay 100
buf1 = Comm1.Input
If buf1 = "" Then
check_response = 255
Else
check_response = AscB(buf1)
End If
If check_response = 88 Then
MsgBox "通过校验,接收成功", vbOKOnly, "信息提示"
ElseIf check_response = 255 Then
MsgBox "接收失败,请检查接收端连路", vbOKOnly, "信息提示"
ElseIf check_response = 78 Then
MsgBox "校验失败,请重新发送", vbOKOnly, "信息提示"
End If
End If
End Sub我就是做这个的,这个实验已做成功了,你根据上面的仔细检查一下就知道了