question about binary and serial info

nephish at xit.net nephish at xit.net
Sun Aug 21 17:15:15 EDT 2005


Sorry i am late getting back on this.
ord() is finally what is giving me what i wanted.
the vendor told me that what was comming in was an ascii string
representing hex characters. So i expected when i used the serial
module
that what i would be getting was something along the lines of 4A, 3D,
etc..
but i got weird characters. So then (with the help of this very thread)
discovered that i am reading raw bytes. i am supposed to validate the
bytes as they come in because the message comes in four at a time. and
i validate each byte
like this
var = (validation number)
a = ser.read(1)
x = ord(a)
then to validate : x = (x & var)

I am really sorry about the confusion. i am really new at this.
but i am getting what i am supposed to now.

i dont have the details on the script, because it is at work.
but i will post it monday.
thanks for everything.
i would still be banging my head if not for this thread




More information about the Python-list mailing list