Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSComm32 port reading error.

Status
Not open for further replies.

nimishp

Programmer
Dec 6, 2001
1
GB
Dear All

I am writing an application that talks to a RS232 device.

On one command when i recieve data from the device the check sum is incorect from the device when it enters the port and is routed through the MSCOMM32 ActiveX object.

The incoming data is of VARAINT type.

When I interigate the variable in a watch window I cast it down to a BYTE (unsigned char) I get a '0' (48) value.
If the value is cast to an int the value is 8230.

There are no other chars coming into the port after that.

The value coming from the device is correct as I checked it with an RS232 Tap. The Checksum is correct but it changes when it enters the port.

The incoming Check Sum is then compared with the calculated check sum.

Are there any issues when reading data from the port in terms of converting from a variant to a BYTE.

Thanks in advanced for any advice given.

Nimish Pankhania
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top