Is it sending over a character or a byte? If it is a byte, then you don't
have to convert to a number... it already is a number. If it is sending a
character, then somewhere along the way, the binary value was mapped to a
code table to get a character. You'd need to map it back!
What mechanism are you using to read the byte? a COM component perhaps?
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Director - Minvent" <Di*************@discussions.microsoft.com> wrote in
message news:37**********************************@microsof t.com...
Hi,
I am reading from a serial port from a device which sends over an ascii
character. It uses the full extended 256 character set and therefore has
non-printing characters too. So what i want to do is convert the input to
the
associated decimal.
I.E
ASCII Char 'NUL' will become 0
ASCII Char 'SOH' will become 1
ASCII Char 'STX' will become 2
ASCII Char '0' will become 48
ASCII Char '1' will become 49
All the way to up to the decimal value 255
I know it must be some thing simple but I can't find it! I'm using C#.net
or
VB.net
Thanks in advance
--
If at first you don't succeed... Hide the evidence that you tried!