Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Serial Port Communication in 16-bit Borland C

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
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 how to use strings and some functions related to them in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

839 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