|
-
Aug 2nd, 2008, 06:45 PM
#1
Thread Starter
New Member
Serial Port Binary Data Conversion
I've searched the forum and although some threads come close, none answer my question. I have a data acq box that transmits data via RS232. The data is binary with two header bytes (250 or 11111010) and one EOM byte (254 or 11111110). The data that I'm interested in resides in the 28 bytes in between the headers and EOM. I can connect to the box and receive data but I can't figure out how to parse it and use it. If I try to put it in a text box a get a lot of ? and some random characters. I know the box is working because I used a port monitor setup for binary and was able to see all of the data. My problem is how do I collect the data, identify the headers and EOM, parse the bytes and convert the data into a number that I can assign to a varible and use to set the properties of a gauge. I wrote a function to convert a byte to a number but I think it needs 1 and 0 characters for it to work. I don't want to convert it to characters unless I have to. I rather just convert it to numbers. Also, most are single byte data but some of the data requires two bytes. How does that change things. Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|