Link to home
Start Free TrialLog in
Avatar of allsopp
allsopp

asked on

Reading Binary Data from Serial Port

I need to read binary data from a serial port. The data is in the format of 23 single byte values. After the values are read I need to combine pairs of byte values (high  and low) to get a 16 bit value.

I have read text values from the serial port before but have no experience in binary data. How do I ....

1) read binary data into a variable?
2) convert high and low single byte values into one 16 bit value?

Some simple code examples would be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of nmcdermaid
nmcdermaid

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of allsopp
allsopp

ASKER

Thanks. The actual equipment I need to talk to is arriving sometime this week. I'll try it out and respond then.
thinking
the parallel port is much easier to manipulate in vb, if you get dlportio from DriverLINX you can just use a function to return a value for the port,, but if the equiptment you are using will only support the serial port then it will be quite a bit harder to do
Avatar of allsopp

ASKER

The equipment is a radio tx/rx unit with a receiver that outputs to RS485 serial.
The code example you provided worked perfectly first time so the points are yours
Sounds like fun whatever you're doing!