Discussion Locked

Serial Communications

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello,
I'm attempting to write a couple of applications that need to communicate with external hardware via a serial port (a UPS in this case, since the packaged software doesn't have the feature set I want).
So far, the only method for talking over a serial port is the MSComm ActiveX control, and I can't seem to get it to work. At the most basic level, a UPS is supposed to maintain +5V on one pin of the serial port as long as utility power is active (the Windows NT UPS service depends on this). My problem is figuring out how to read this voltage, since MSComm doesn't acknowledge any signal when I open the port.
If code is provided, I would prefer a solution in Basic (any version), but C, C++, and Java source is also acceptable.
Thanks,
Ben
P.S. If someone knows of a good reference for hardware communications, I would appreciate it. I would prefer something roughly 50% theory / 50% technical & code, too many books / documents are 90% theory (white papers) or 90% technical & code (RFCs).

4 replies

by rfoster

Hi Ben,

A little more information would be useful here. In particular, do you happen to know which pin remains asserted? I would imagine it's probably Carrier Detect (CD), Data Set Ready (DSR), or Clear To Send (CTS) - which (on a 9 pin cable) appear on pins 1, 6 and 8 respectively.

Assuming it is one of those pins, you should be able to test if the pin is asserted using the CDHolding, DSRHolding, or CTSHolding properties, all of which return True if the pin is asserted, False otherwise.
Hope this helps,
Regards,
Richard

by shanghai sam

Ok, it appears that I had it backwards, CTS is used to signal utility power failure. Depending on the UPS, this can be held positive or negative on a power failure, I'll have to find out which from the manual. Thanks,
Ben

by txitguy

I'm not sure which pin it is actually, I have to check and get back to you.
Thanks.

This discussion is closed to new replies.