Serial data transfer in c++

Status
Not open for further replies.

silver

Newbie level 5
Joined
Mar 15, 2003
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
37
Can some one explain me
how can program serial port with c++
thanks
 

Hi......

U can send data to serial port using "outportb" command......
I have done it in Turbo C++ compiler.........

I am also attatching a file with the title Interfacing the serial / Rs 232 port....it contains all the info one needs to know about serial port data transfer.....also contains C++ codes for doing so.....Hope that this solves ur problem

for proper syntax open turbo C compiler and find outportb in help.....
 

hi, silver

Search google for 'Ramon de Klein cserial'. I used his serial class with good results.
 

serial communication is very easy, because you don't need any driver just use readfile, writefile.
 

you simply use the Windows API if you programming in Windos.
IF you search in google you can find many links and examples to serial port programming.
Bye.
 

Hi guys

First of all thanks for your attention

Are there any componet for rs232 communication for Borland C++ Builder

Thanks
 

Hi guys

First of all thanks for your attention

Are there any componet for rs232 communication for Borland C++ Builder

Thanks 8O
 

you can use a active-x like mscomm from msdn library...
 

silver said:
Are there any componet for rs232 communication for Borland C++ Builder

Yes there are many, go to Delphi Superpages.
I prefer to use google to find it.

Anyway, there is "async32", what good enough to deal with.
You can use it very easly.
 

A common way to do serial transfer from a windows program is to use the Win32 API.

Essentially you: use CreateFile() to obtain a handle to the serial port, then you use a DCB structure (https://msdn.microsoft.com/library/en-us/devio/base/dcb_str.asp) to set the baud rate, etc.

This method will work even under Windows 95. It is probably also the quickest way to do it as it doesn't require any intermediate DLL, ActiveX control, etc to do it.

- Jayson
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…