Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need 2 API calls

Status
Not open for further replies.

mbaddar

Programmer
May 10, 2001
120
US
Hi

I'd like to know if there are a couple of API calls
out there that I can use. I need one to send
a carriage return and another to read data from
a serial port. Does anyone know if these exist?

Desperate!!!

MBaddar
 
You can use
fSerialPort = fopen("COM1", "r");
fgets(szILine, sizeof(szILine), fSerialPort);
Please let me know your results.....
 
Hi,

Thanks, okay, that looks pretty easy. Is the "r" the way
to send a carriage return in VB?

Thanks,
MBaddar


 
No, the "r" is for "read" because you want to open the port
for a read operation.
If you want to send a carriage-return somewhere (e.g. to a port), open the port with "w" for "write" and use any write
function like WriteFile to write the correct ascii sequence
(maybe you will recognize the term "escape sequence").
Anyway, the sequence is usually platform-dependent and is defined in the library's header files.
 
Hi,

Okay, thanks for the clarification.

Thanks,
MBaddar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top