Computing.Net > Forums > Programming > Reading status of serial port pins

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Reading status of serial port pins

Reply to Message Icon

Name: JimW1234567
Date: August 12, 2003 at 01:36:37 Pacific
OS: MSDOS
CPU/Ram: 800MHz 256MB
Comment:

Can someone post some code that will read the level of the com port (RS232) lines under MSDOS/Windows?

I'm trying to write a small decoder program for an interface that uses only the CTS line of the serial port for it's output, to provide either logic 1 or logic 0.



Sponsored Link
Ads by Google

Response Number 1
Name: jorgen
Date: August 12, 2003 at 09:10:43 Pacific
Reply:

Jim,

Check out this site (you're running DOS, right?) It has code examples, dlls, tutorials and other resources you can use.

http://www-cdr.stanford.edu/biomimetics/documents/serial/serial.html



0

Response Number 2
Name: KTS
Date: September 13, 2003 at 09:41:28 Pacific
Reply:

Actually, it sounds to me like you are NOT in DOS, but rather you are trying to use the .NET framework to do this. If that is the case, I have both bad news and good news. The bad news is that MS did not include any .NET framework classes that will do this. You MUST currently use a P/Invoke and utilize the old Win32 code. Simply put you use Interop to dervive a baseclass that can then be used in any language VB, C#, C++, J#, etc. There is a very good example of how to do this at:

http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/

Good Luck!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


attach serial device with... Spying Scripts



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Reading status of serial port pins

Serial port communication www.computing.net/answers/programming/serial-port-communication/12792.html

Controlling serial port in QB 4.5 www.computing.net/answers/programming/controlling-serial-port-in-qb-45/14261.html

serial port programming www.computing.net/answers/programming/serial-port-programming/6695.html