Home All Groups Group Topic Archive Search About

Sending chr(255) to serial port

Author
31 Jul 2006 10:30 AM
...
Hi

I need to send a chr(255) to a serial port. When I send it, through
comm.write (chr(255)) it sends a chr(63) ... in Hex, I write chr(&FF) and it
actually sends chr(&3F) ... why does this happen, and how can I send it
right ?

I'm using vb.net 2005 express with framework 2.0

Thanks for an answear ...

Mike

Author
31 Jul 2006 1:11 PM
Chris Dunaway
.... wrote:

> I need to send a chr(255) to a serial port. When I send it, through
> comm.write (chr(255)) it sends a chr(63) ... in Hex, I write chr(&FF) and it
> actually sends chr(&3F) ... why does this happen, and how can I send it
> right ?

How are you verifiying what is being sent?  Can you show some code you
are using that demonstrates the problem?  What encoding are you using?
Author
31 Jul 2006 3:10 PM
...
Hi Chris

I'm using "Classic" writing to the port ... something like

Comm.write (chr(255) + chr(30) + ...)

I installed a Comm Spy program to capture everything that flows across the
serial port. The machine doesn't work as it was supposed, so I decided to
"listen" to the stream and noticed that.

I'm not using any encoding. I supposed there was no need for it ... :|

Thanx

Mike
-----------------------

Show quoteHide quote
"Chris Dunaway" <dunaw***@gmail.com> escreveu na mensagem
news:1154351475.682209.238110@i42g2000cwa.googlegroups.com...
> ... wrote:
>
>> I need to send a chr(255) to a serial port. When I send it, through
>> comm.write (chr(255)) it sends a chr(63) ... in Hex, I write chr(&FF) and
>> it
>> actually sends chr(&3F) ... why does this happen, and how can I send it
>> right ?
>
> How are you verifiying what is being sent?  Can you show some code you
> are using that demonstrates the problem?  What encoding are you using?
>
Author
31 Jul 2006 3:07 PM
Dick Grier
See my reply in the .dotnet.general newsgroup.

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.