View Single Post
  #3 (permalink)  
Old March 30th, 2004, 12:25 PM
CNewbie CNewbie is offline
Authorized User
 
Join Date: Mar 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for the reply Dave:

Thank you for the Reply. Basically the format will always be the same regardless of what the bytes are. The bytes all come in as one string as I posted previously like this:

Code:
48 40 20 00 39 40 7F 11 23 7C 57 BD A3 DB 80 D4 B5 D4 85 9A 3B 32 3B 2C 31 90 24 B0 23 01 91 0B 1E 79 02 41 82 07 00 06 42 00 01 B5 F9 03 33 42 00 03 62 0D 00 67 08 F7 EE 7E 8A 4C 76 CC 12 90 20
Yellow = Header
Blue = Acknowledgement Byte
Red = Bytes in packet
Orange = Packet Response

With the exception of the first byte "48" the bytes will always be the same. Also one other important fact I left out before; The 4th byte of the header is the Byte Length which tells us how many bytes are in the Packet.

Now What I was hoping to do is this:
  1. Take first 5 byte header and put them on the line(Store 4th byte)
  2. Get next byte from string and put then on the line
  3. Then test the 4th byte I stored previously and allow that to determine how many bytes to get and store on the next line.
  4. Finally get last 2 bytes and store that

Also, I would like to point out that I thought about doing this byte by byte instead of in strings, but It would not work out. Instead of it coming out like this:

48 40

It would come out like this:

4
8
4
0

Maybe someone can help me out there as well.

Thank You
Reply With Quote