标题:[求助]使用MSComm1.Output时出现380无效属性值
只看楼主
wk6014111
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-11-9
 问题点数:0 回复次数:1 
[求助]使用MSComm1.Output时出现380无效属性值
Private Sub Command1_Click()
Dim Num As Integer
Dim outT As Byte
Num = Val(Text1.Text)
outT = CByte(Num)
MSComm1.OutBufferCount = 0
MSComm1.Output = outT 实时错误‘380’ 无效的属性值
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
= 2
MSComm1.Settings = "9600,n,8,1"
MSComm1.PortOpen = True
End Sub
Private Sub MSComm1_OnComm()
Dim indata As Variant
Dim bte(0) As Byte
Select Case
Case comEvReceive
indata = MSComm1.Input
bte(0) = AscB(indata)
Text2.Text = bte(0)
MSComm1.InBufferCount = 0
End Select
End Sub
小弟自学vb 想做毕业设计
照着教程写一个简单的串口通讯程序 和单片机通讯
当在text里赋值后 一点Command1就会报错
Command1 第六行MSComm1.Output = outT 报错“实时错误 380 无效的属性值”
请各位大神帮忙看一下 怎么改
万分感谢
搜索更多相关主题的帖子: 380 
2011-11-09 16:58
W11400661
Rank: 8Rank: 8
来 自:达拉达斯
等 级:蝙蝠侠
威 望:2
帖 子:163
专家分:834
注 册:2008-10-12
得分:0 
Private Sub Command1_Click()
Dim Num As Integer
Dim outT As Byte  ’Dim outT(0) As Byte
Num = Val(Text1.Text)
outT = CByte(Num) ’outT(0) = CByte(Num)
MSComm1.OutBufferCount = 0
MSComm1.Output = outT 实时错误‘380’ 无效的属性值
End Sub
基本功都不学扎实,做啥设计
2011-11-17 21:42



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-354739-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.125496 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved