Hi Tim
if you are not seeing the bytes available increase then that would suggest that the data is not getting to the computer for whatever reason.
please forgive me if the following is already known to you.
I do not use API2 as for some unknown reason the serial port has be renamed and I am not interested in changing everything I know about API1, event names are API1 only in the text below.
one mistake I made at the start was expecting the DataAvailable event to know (a) when the data I want starts and (b) it would know when the data I want stops.
well believe me, its no idea about your data at all!
the event will fire when it has received data and the event is magically told to fire by the OS, thats not likely to be when your data has stopped arriving, it is just as likely to be in the stop bit phase of a random point in your data.
the event is not fired when your data stops sending, how could the event know that?
the method I use recently is to have a timer set at 100ms which simply has Serial.Poll in the Action event.
this will make the DataAvailable event fire every 100ms where you can then test if all the data is in there.
as suggested above, if you are able, use an end of packet identifier and search for it with LookAhead, if found then ReadAll the data and the buffer is cleared which should be the data you want (this is what I do).
if you want to count bytes then you need to be sure there are none in there that you do not know about or you may see issues that are not actually there, noise on the line is just as valid data to the computer as expected data you send.
Read and ReadAll empty the buffer of data, LookAhead looks at the buffer data but leaves it in there.
my question would be more about the transport system between sender and receiver.
serial 232 in single ended and as such is very prone to electrical noise messing the data up, if you are running over greater than a couple of meters then this could be an issue if you are not using high quality screened cable, above 5m then a standard cable is much more likely to have issues.
with genuine serial data (such as a MAX232 chip) that is ±12v, a 24v differential, you might bet 10 or 15m reliably.
the standard USB to serial are usually running at 0 to 5v at best, only intended to work over the lending of cable supplied.
then there is the question of baud rate, the faster you go the shorter the reliable distance.
if I were testing your system I would try at 9600 baud first to see if the data is getting through.
if you are using 57600 and above then I am afraid its going to be far more unreliable.
those speeds may be ok over a very short path.
supposing all that is ok and you still have problems then I would download CoolTerm (which was made with Xojo) and test the hardware using that very good application.
if it works on that then its your code, if it does not its the hardware.
the Xojo serial class is used in all my projects in the last few years and it is as reliable as any class I ever used, any issues have either been me being a bit stupid in code or, bad hardware feeding the data to the receiver.
good luck, I have no doubt you will get it working in no time.
Mark