| Much thanks to the folks who helped me below. It appears I'm still missing something about serial communications. Let me describe the situation and hopefully some nice UFie can show me the light.
I've got a measurement device that sends out data on a serial line. I hooked up the cable to my serial port, fired up a terminal program, and voila, there's the data. Visions of finishing my project really quickly danced through my head. So next I started a VB project, added an MSComm component, set it to display incoming data, clicked the device's "send" button and.... got garbage. All my VB program receives are chr(0) and chr(128) characters. I used Portmon to see what's going on, and as far as I can see the data that is displayed in the terminal program isn't being sent in any direct way. For example, I set Portmon to only display data that contains the letter "A"... nothing shows, even though an "A" is displayed in the terminal.
As far as I can see, my MSComm object and the terminal are listening to com1 in the same way... same parity, same handshake, etc. The one place where they're different is the baud rate. The terminal is listening at 1200 baud. If I set the MSComm object to 1200 nothing is received. If I set the terminal to 9600 it receives nothing. My inclination is that 1200 is where the object oughta be, and I'm just doing something else goofy, but I'm just not familiar enough with this low-level stuff.
So, uh, what's the deal? Any clues would be most helpful. :-) |