Solved

Serial Port Communication in 16-bit Borland C

Posted on 2004-10-04
3
903 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 6

Expert Comment

by:Amritpal Singh
ID: 12224116
0
 
LVL 9

Accepted Solution

by:
ankuratvb earned 500 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
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 how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

861 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now