Solved

bioscom

Posted on 1997-03-25
3
4,241 Views
Last Modified: 2008-03-10
I want to be able to get 2 PC's to communicate over a serial link using the bioscom function.  The code I have been experimenting with is shown below.

The first PC runs following code


int main(void)
{
   int i,;
   char send;

   send='b';

   bioscom(0, 0xe3, COM2); //sets up com2 for 9,600 baud , no parity, 1 stop bit

   for (i=0;i<500;i++){
                  bioscom(1, send, COM2); //sends 'b' 500 times
                 }
   }

The second PC runs the following code

int main(void)
{
   int i,;
   char send,recieved;

   send='b';

   bioscom(0, 0xe3, COM2); //sets up com2 for 9,600 baud , no parity, 1 stop bit

   for (i=0;i<500;i++){
                      recieved=bioscom(2, send, COM2); //recieves 500 bytes
                 }
   }


both programs work fine when the other PC is running comms software such as terminal,  but they won't work with each other.
Ultimatly I want to be able to write 2 C programmes each running on a seperate PC's which can send text files to each other over a serial link.
0
Comment
Question by:grahamr032597
3 Comments
 
LVL 5

Expert Comment

by:julio011597
ID: 1249755
Well, and the question is? :)
I mean, at least show a bunch of code to those of us (not me, i'm afraid) who could help you.
Rgds, julio
0
 

Author Comment

by:grahamr032597
ID: 1249756
Edited text of question
0
 

Accepted Solution

by:
klos earned 100 total points
ID: 1249757
Make sure you enable the modem control signals in your programs.  The BIOS will expect to see those signals on when it tries to send or receive data, and fail if it doesn't.  I expect the cable you're using already has these signals since the programs work with other COMM programs.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
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 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.

708 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

11 Experts available now in Live!

Get 1:1 Help Now