VB串行通信中MSComm1.Output用法

来源:百度知道 编辑:UC知道 时间:2024/05/26 15:10:27
我在用VB向下位机串行通信发送个地址时,用了语句
MSComm1.Output = &H01 却不行,说 无效属性值.
这是怎么回事. 不能直接赋值吗?
请教一下,哪为大虾了解

发送1字节
Dim sj(0) As Byte
sj(0) = &H1
MSComm1.Output =sj
发送2字节
Dim sj(1) As Byte
sj(0) = &H1
sj(1) = &H1A
MSComm1.Output =sj

通常 不 直接赋值

你dim 一个 byte 数据


dim addr as byte
addr = &h01
MSComm1.Output = addr

试试

祝你顺利