求助VB与串口问题
采用VB发送接收ascii码!我的接收怎么是乱码?
VB code:
Private Sub com_init()
With MSComm1
.CommPort = 1 'COM1
.Settings = "9600, E, 7, 1"
.InputMode = comInputModeBinary
.InputLen = 14
.InBufferCount = 0
.InBufferSize = 50
.OutBufferCount = 0
.OutBufferSize = 50
.RThreshold = 14
.SThreshold = 1
.PortOpen = True
If MSComm1.PortOpen = False Then MsgBox "请先设置串口", 16, "提示"
End With
If Err Then '错误处理
MsgBox "串口通信无效"
End If
End Sub
Private Sub MSComm1_OnComm()
Dim filename As String
' Dim btReceive As Variant
Select Case MSComm1.CommEvent
Case comEvReceive
btReceive = MSComm1.Input
Picture1.Print btReceive(0); btReceive(1); btReceive(2); btReceive(3); btReceive(4); btReceive(5);
Picture1.Print btReceive(6); btReceive(7); btReceive(8); btReceive(9); btReceive(10); btReceive(11);
Picture1.Print btReceive(12);
相关问答:
我用Delphi写了一个DLL, DLL里有MDI的子窗体,DLL初始化时 传递调用者的TApplication给DLL, 在Delphi7中调用已经通过,但是不知道在VB中有无TApplication对应类型, 是否能在VB中调用?
你好,用instance不是就可以了 ......
我有自动生成序列号的程序,但是怎么跟打包后的安装程序结合在一起,在安装时提示用户输入序列号,正确后再继续安装???
方法1:你可以在运行程序后输入序列号注册,很多软件都是这样的。
方法2:使用Setu ......
初学VB,请各位大侠给予指点
Private Shared Function GetWorkflow(ByVal flow As WorkflowFlow) As WorkflowDocument3
GetWorkflow = Nothing
If ......
怎么在VB中把excel中的数导入到数据库中
直接在vb中调用数据库的导入功能进行导入。
自己百度一下,代码海了去了,方法有好多
参考
http://blog.sina.com.cn/s/blog_4a384544010004zk.html
'判断 ......