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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading and writing to serial port--basic way

Status
Not open for further replies.

Sypher2

Programmer
Oct 3, 2001
160
US
I've got a serial port connection between a PC and an OpenVMS system. The serial port from the PC goes into a DEC-Server. Data comes across as straight ASCII.

I want to send ASCII text across the serial port and receive the ASCII responses.

I am using CreateFile to open the port which works fine.

I am using GetCommMask and SetCommMask to get and set the port setting which works fine.

I am using GetCommTimeouts and SetCommTimeouts to get and set the port timeouts which works fine.

I am using WriteFile to send data to the port which appears to be working fine.

I am using ReadFile to read data... This is where I'm having trouble. I just want to send some data, put the thread to sleep a second or two, then read the response. All I am getting is nothing or an echo of what I sent.

Any ideas?
 
Can ask what language you are using, as I suspect you are using something other that Visual Basic.

You may get more specific help by posting in a more appropriate forum!

Take Care

Matt
If at first you don't succeed, skydiving is not for you.
 
I'm using Visual Basic.

But this thread can be ignored. I got it to work finally.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top