Hi,
I'm writing some logging software for an embedded alarm panel design that uses an RS485 bus and proprietary protocol. I've attached the obligatory RS485 -> RS232 converter and connected to a free serial port on my PC. All good so far!
Now, the alarm panel deliberately causes a parity error on the header byte of all packets transmitted on the bus. This parity error is used by all peripherals on the bus to sync to the header byte. Fair enough say I (doesn't sound a great idea but who am I to complain).
Here's the problem... I'm using the mscomm32.ocx control in my VC++ application (used lots of times before with no problems). I have parity replace turned-on at the moment so that all parity errors are substituted with a custom character. When a header byte comes in (and a parity error is detected), this seems to cause the mscomm control to stop. Not good.
I've googled and only found answers for VB. None for VC++. The VB answer I've found does not work in VC++.
Has anyone ever come across this in VC++ and knows how to reset the error WITHOUT turning mscomm off then back on again (looses data doing it this way - I've tried it!).
Cheers Jim