?
Solved

Serial Port Communication in 16-bit Borland C

Posted on 2004-10-04
3
Medium Priority
?
965 Views
Last Modified: 2012-06-21
I currently in stage of developing a dos based program that could replace our current windows based terminal emulator program. This program is capable to send & receive character in ASCII format and view the data in command line. This program is targetted to provide communication between PC and external electronic device via serial port. I need to program in Borland C since this program will link with other subroutines in this format.
Example communication is :

User send command "C 1" ( i.e C-space-1 )

and the external device will respond with :

<< GRIPS >>

[GRIPS] Interrupt Disable
[GRIPS] Wait Disable
OK

#======================================#
Diag>
#======================================#
[GRIPS                      ] -> [OK]
 +-[REGISTER(IC501)         ] -> o

>>Diag

if the external devices is fail, no respond will be received.

Communication protocol will use COM1 with 38400 baud, No parity, 8 data bits & 1 stop bits.

I am relatively new in port communication within Borland C environment. Hopefully I can get example in order to complete this program.
0
Comment
Question by:eazrul
  • 2
3 Comments
 
LVL 6

Expert Comment

by:Amritpal Singh
ID: 12224107
plz have a look at the following link

http://www.traverse.com/people/poinsett/bcbcomm.html

i hope it'll be of any help
0
 
LVL 9

Accepted Solution

by:
ankuratvb earned 1500 total points
ID: 12227750
You can use bioscom() from TurboC's library:
See:
http://www.experts-exchange.com/Programming/Programming_Languages/C/Q_10030385.html

OR

Check these sites out,they've got very easy to follow,detailed tutorials on serial port programming in 16 bit:

www.beyondlogic.org
www.lvr.com/serport.htm

http://www.experts-exchange.com/Programming/Programming_Languages/C/Q_20794926.html

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question