现在我通过串口读外设的信息,外设发的数据是二进制格式,我用MSCOMM控件读
但我想把它读到数组里为什么不行呢dim buf(128)  as byte
buf = MSComm1.Input
(提示不能给数组赋值)或者
dim buf as string
buf =mscomm1.input
text1.text=buf
(这个错极了)

解决方案 »

  1.   

    http://search.csdn.net/Expert/topic/642/642738.xml?temp=8.179873E-02
      

  2.   

    '初始化设备时首先要设定为用字符接收.
    MSComm1.InputMode =comInputModeText然后
    dim buf as string
    buf =mscomm1.input
    text1.text=buf
      

  3.   

    .InputMode =comInputModeText
    呵呵~
      

  4.   

    dim buf(128)  as byte
    开始别定义固定长的数组,接收之后再定义就可以了。
      

  5.   

    开始dim buf() as byte接收完毕
    redim preserve buf(128) 好像没写错吧
      

  6.   

    http://community.csdn.net/Expert/topic/3682/3682097.xml?temp=.6836359
      

  7.   

    MSComm1.InputMode = comInputModeBinary
    Buf = MSComm1.Input
    a = Hex(Buf(0))
    b = Hex(Buf(1))
    c = Hex(Buf(2))
    Me.Text4.Text = a + b + c上面才是我要的
    谢谢各位了