Re: Grief with a serial port
Could it be that the serial device gets a stray character when the PC boots and that locks up the communication? Maybe the C# application knows how to resolve such a lockup?
When debugging serial communication issues sniffing the communication line is often very useful. Either use another computer (with 2 ports) or a special hardware like http://www.hardware-serial-monitor.c...ta-capture.htm (first I found. I bet there are cheaper stuff around)
Re: Grief with a serial port
"Could it be that the serial device gets a stray character when the PC boots and that locks up the communication? Maybe the C# application knows how to resolve such a lockup?"
Hi S !
Indeed that seems quite possible. But I think it's not the C# application that knows how to resolve the issue, it's .NET's SerialPort class. I know because I wrote both the C# app and the Win32 C++ app.
What I must do is somehow determine what is wrong with the port (IF IT IS THE PORT!) and write the code to correct the condition explicitly ... I don't think Win32 has anything even remotely analogous to SerialPort. That is what I am attempting to determine with this plea for help. What are my alternatives, if any ? (Migrating to .NET is a non-starter, guys!)
re the hardware .... yeah I brought my laptop in this morning. It's old enuf that it has a serial port but the ol' frustration index began to climb when I found that I need a gender-bender (and probably a null-modem) to get the two PCs to talk to each other over the serial cable. I'll try it again t'morra if I can find the appropriate gender-bender, etc.
So, perhaps someone out there is very familiar with the serial port DCB and knows of something I missed or should try.
thanks all.
OldFool
Re: Grief with a serial port
Ok it sounds like it's more of a DCB issue even though you said that the DCB was the same for both situations. I live by the rule to assign every single field of the DCB just to be sure what I get. Mostly because I many years ago had an issue where the method GetCommState, a minimalistic change and then SetCommState failed when changing OS.
Maybe you forgot to disable the flow control?
What protocol does the device use? Is it possible to run it using a serial terminal software? If so I'd recommend PuTTY since it can be handy for other stuff as well.
Yes to listen on the communication you will need some hardware but such boxes are quite cheap and well spent money compared to do the soldering yourself. An example on (not so cheap) a hardare http://www.fte.com/products/serialanalyzers-RS232.aspx I've seen these for about the 10th of that price but failed to find it this time.