| Author |
MScomm control send problem.
|
|
|
| Hi All,
These code can't work. Could you please advice ?
Why can't I send a single byte by:
''''''''''''''''''''''''''''''''''''''''
'
dim a as byte
a=10
mscomm1.output = a
''''''''''''''''''''''''''''''''''''''''
'
Thank you very much!
Best regards,
Boki.
Code:
===============================
Private Sub Boki_Walk(A As Byte, B As Byte, C As Integer)
MSComm1.Output = B
MSComm1.Output = CByte(data \ 256)
MSComm1.Output = CByte(data) '//send low byte
End Sub
===============================
| |
| David Youngblood 2005-12-13, 7:55 am |
| "Boki" <bokiteam@ms21.hinet.net> wrote...
> These code can't work. Could you please advice ?
> Why can't I send a single byte by:
>
> ''''''''''''''''''''''''''''''''''''''''
'
> dim a as byte
> a=10
> mscomm1.output = a
> ''''''''''''''''''''''''''''''''''''''''
'
MSComm.Output requires a string or a byte array. No other data type can be sent
without conversion to a string or byte array. Input has the same restrictions.
David
>
> Best regards,
> Boki.
>
>
> Code:
> ===============================
> Private Sub Boki_Walk(A As Byte, B As Byte, C As Integer)
>
> MSComm1.Output = B
> MSComm1.Output = CByte(data \ 256)
> MSComm1.Output = CByte(data) '//send low byte
>
> End Sub
> ===============================
>
>
| |
|
| could you please advice when we want to send a single hex data?
ex: pass a byte variable through function call...
Best regards,
Boki.
"David Youngblood" <dwy@flash.net> 撰寫於郵件新聞:eWHEzd9$FHA.2320@TK2MSFTNGP11.phx.gbl...
> "Boki" <bokiteam@ms21.hinet.net> wrote...
>
> MSComm.Output requires a string or a byte array. No other data type can be
> sent
> without conversion to a string or byte array. Input has the same
> restrictions.
>
> David
>
>
>
>
| |
| Dick Grier 2005-12-14, 3:55 am |
| Dim Buffer(0) As Byte
Buffer(0) = 10
MSComm1.Output = Buffer
--
Richard Grier (Microsoft Visual Basic MVP)
See www.hardandsoftware.net for contact information.
Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.
| |
|
| Thanks a lot.
Best regards,
Boki.
"Dick Grier" <dick_grierNOSPAM@msn.com> 撰寫於郵件新聞:%23Si$GWGAGHA.2912@tk2msftngp13.phx.gbl...
> Dim Buffer(0) As Byte
> Buffer(0) = 10
> MSComm1.Output = Buffer
>
> --
> Richard Grier (Microsoft Visual Basic MVP)
>
> See www.hardandsoftware.net for contact information.
>
> Author of Visual Basic Programmer's Guide to Serial Communications, 4th
> Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
> www.mabry.com/vbpgser4 to order.
>
>
|
|
|
|