我的串口MODE上电后就会向串口发送很多的字符:
System started!
Press 's' key continuously to enter configure program.
GPRS-1000T Configure Program:
Use the extended AT commands configure the
arguments needed 现在我想在出现“Press 's' key continuously to enter configure program.” 这一句后就向设备发送“S”,我应该怎么办啊?
System started!
Press 's' key continuously to enter configure program.
GPRS-1000T Configure Program:
Use the extended AT commands configure the
arguments needed 现在我想在出现“Press 's' key continuously to enter configure program.” 这一句后就向设备发送“S”,我应该怎么办啊?
解决方案 »
- 【请教】VB6的哪个表格控件可是实现在表格内直接修改内容?
- 求助 StdPicture对象如何调整大小
- 用VB做的UserControl能不能置于Label的下层?
- 急~~~在vb中怎样执行javac和java???不用shellexecute......解决就给分
- 这几天要做MIS实习,还没有合适的项目,大家帮忙提出一个项目来做把
- 这应该是ole的问题吧!
- 关于WebBrowser控件
- 在vb中如何计算两个日期的间隔???
- 哪位大侠知道在用printform打印窗体时如何在纸头部留一段空白
- 请问,如何改动vb编的exe文件中的工具栏汉字?使得个性化一点?
- mscomm控件问题,200分求解决!!
- 急!!求VB6.0英文版下载地址!
Dim ST As String
ST = MSComm1.Input
Select Case MSComm1.CommEvent
Case comEvReceive
If InStr(ST, "Press 's'") <> 0 Then
MSComm1.Output = "s" & vbcrlf
End If
end select
end sub
,我断点调试了一下,ST是空的啊!是不是由于我设置了OnComm事件?我RThreshold设置为1。
Dim ST As String
Select Case MSComm1.CommEvent
Case comEvReceive
If InStr(ST, "Press 's'") <> 0 Then
MSComm1.Output = "s" & vbcrlf
End If
end select
end sub
Dim ST As String
Select Case MSComm1.CommEvent
Case comEvReceive
ST = MSComm1.Input
If InStr(ST, "Press 's'") <> 0 Then
MSComm1.Output = "s" & vbcrlf
End If
end select
end sub
定义全局变量
Dim ST as String在load()中初始化
ST=""原程序改为:
Private Sub MSComm1_OnComm()
Dim ST As String
Select Case MSComm1.CommEvent
Case comEvReceive
ST =ST + MSComm1.Input
If InStr(ST, "'s'") <> 0 Then
MSComm1.Output = "s" & vbcrlf
ST="" '(或者处理后再清空)
End If
end select
end sub