Solved

Serial Port Communication in 16-bit Borland C

Posted on 2004-10-04
3
890 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
Comment Utility
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
Comment Utility
0
 
LVL 9

Accepted Solution

by:
ankuratvb earned 500 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

744 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

16 Experts available now in Live!

Get 1:1 Help Now