|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Sending chr(255) to serial portHi
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 .... wrote:
> I need to send a chr(255) to a serial port. When I send it, through How are you verifiying what is being sent? Can you show some code you> 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 ? are using that demonstrates the problem? What encoding are you using? 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? > 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.
How to change printer's physical print margins thru VB coding?
2 pieces of the same code doing different things Custom Attributes, Shared methods, Derived classes and reflection allowing just numeric value in my textbox How to validate Date entries. Placing a .lnk file on the desktop Font with Bold and italic Going from A to Z How to save iamge in database? Positioning Other Applicaitons |
|||||||||||||||||||||||