General discussion

Locked

serial communications

By thedon11550 ·
how would i access the serial port using visual c++?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

serial communications

by VinnyD In reply to serial communications

Open the Port using "CreateFile"

Send a character using "TransmitCommChar"

Call "ClearCommError" to get status of the port

Call "ReadFile" to get the data characters from the serial device.

These are the functions that I use from the Microsoft SDK in C++ to interface with the serial port.

Collapse -

serial communications

by thedon11550 In reply to serial communications

The question was auto-closed by TechRepublic

Collapse -

serial communications

by rolie In reply to serial communications

You can access serial port register using the address 0x3f8 for COM1 and 0x2E8 for COM2, 0x3e8 and 0x2e8 for COM3 and COM4 respectively. You can read the values of this regiter by using INPORT() function. When writting to this register use OUTPORT()function.

Collapse -

serial communications

by thedon11550 In reply to serial communications

The question was auto-closed by TechRepublic

Collapse -

serial communications

by thedon11550 In reply to serial communications

This question was auto closed due to inactivity

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums