Click to See Complete Forum and Search --> : Serial Port Communication (NT)


danigraf
July 19th, 1999, 09:09 PM
I'm using VC 6.0++ and Windows NT 4.0. I have to implement a serial
port communication with the following requirements:

- Port initialization: baudrate, parity, etc.

- Writing to port: I have to write strings to the port.

- Receiving from the port: I have to receive strings from the port.
Single characters would be ok as well. It has to be done with polling
and not with messaging, which also should be easier. Is there a buffer I
can read from? If yes, is it also possible to clear that buffer?

I want to write my own class with these three methods. It would be great
if somebody could give me some help, because I'm not that experienced in
this.

Thanks a lot
Daniel

Bernhard Reif
July 20th, 1999, 01:03 AM
Hi,

Do you have to implement a specific protocol?
I have the same problem, but my communication builds on a protocol (3964R from Siemens), so I prefer to use a tool because then I don't have to care about handshake and all this stuff.

Harald Singer
July 20th, 1999, 03:26 AM
You can try this:

http://www.codeguru.com/misc/serialport.shtml

Hope it helps!

danigraf
July 20th, 1999, 08:22 AM
I don't have to implement a certain protocol. I just have to read strings to the port and to write strings from the port.

Gruesse nach Deutschland
Daniel

Bernhard Reif
July 20th, 1999, 08:36 AM
Oh,
If you want to use standard classes, I think I'm not able to tell you anything new that you don't know alreay.

Good luck!

Eugene N
July 23rd, 1999, 11:14 AM
1. CreateFile( "COMx", ..... ).
2. SetupComm( ... )
3. WaitForCommEvent(...)
4. ReadFile(...)
5. CloseHandle(...)
Any question ? Write to me N.Eugene@iname.com ! I have more own examples.

Eugene.