Solved

pascal modem..........i want it now.

Posted on 2000-04-30
14
212 Views
Last Modified: 2010-04-16
ok people, this question in my oppinion is a thoughy so i want a good answer, if one exists.

I want a piece of coding from someone that will bascially initialize in crt mode, it will ask whether the user wants to dial or recieve. If the user chooses recieve then the program will let the computer wait for a phone call
until another computer dials in (using modems).  If the user chooses to dial then the user is asked for a phone number. When the phone number is entered the computer will dial the number and connnect to the recieving computer on the other side. There will be then data sent back and forth, the sender will send the number 29999 and the reciever will send 29998 whic will be displayed oin the appropriate screen. The numbers will be continuously sent until a key is pressed on either side and the program exits. So the question? how do i do this?
0
Comment
Question by:Ykoorb
[X]
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
  • 7
  • 7
14 Comments
 
LVL 3

Expert Comment

by:Mathias
ID: 2763969
If you want I can post my comport unit with modem detection and data transfer routines.

This unit can dial phone numbers and receiving data. But what do you mean with "another computer dials in", Do you mean another computer is calling you via the net?

Bye, TDS.
0
 

Author Comment

by:Ykoorb
ID: 2765980
by "another computer dials in" i mean that another computer calls via the phone line (direct connection) not via the net.

Your unit maybe of use, could you implement it into a program like the one i described?

Cheers
               Ykoorb
0
 
LVL 3

Expert Comment

by:Mathias
ID: 2769611
That isn't easy, because you must always check your modem, using a protocol. But if you dial another modem and the modem answers, your are able to communicate. I don't have the chance to write a program like this, because I have only one modem. But if you are interested in the source for "normal" communication write it on this site and I will post my code on this site.

Bye, TDS.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:Ykoorb
ID: 2770948
what do you mean by "normal" communication? i am interested in anything which you think will get me closer to my end goal, any help will be appreciated and depending how much help i get may give you the points, thanks for your help so far. This unit sounds interesting, what does it do?

  Cheers
        Ykroob
0
 
LVL 3

Accepted Solution

by:
Mathias earned 200 total points
ID: 2771063
Here is TDS again.
This is a sample code, but the whole code is too big. Send me your Email address and I will send you the package (ca. 36KB).

Features:
- modem identification
- sending and receiving characters

I tested it with TP 7.0 and BP 7.0. I own an US Robotics 33.6 modem.

uses crt, modem;
var B: Boolean;
begin
  B:=modem_init;
  if not B then
    writeln('net: Found no modem')
  else
  begin
    StartModem;            {init Modem !}
    SendChars('+++');       delay(100);
    SendChars('AT DT');     delay(100);
    SendChars('1234'+#13); {dial Number}
    readln;
    SendChars('AT &F'+#13); delay(100);
    EndModem;
  end;
end.
0
 

Author Comment

by:Ykoorb
ID: 2775335
ok here is my e-mail address

doctor.evil@net.ntl.com


That code looks good so far, hoefully should award you the points when i see the rest of the code, cheers

Ykoorb
0
 
LVL 3

Expert Comment

by:Mathias
ID: 2778287
Did you get the mail?
0
 

Author Comment

by:Ykoorb
ID: 2778298
yep, i got the mail, just checking out how it works now, will get back to you soon

 cheers
        ykoorb
0
 

Author Comment

by:Ykoorb
ID: 2778477
hmm, i got the units, compiled them as appropriate and then tested them using your example program above, as it was testing each com port it was ok until it reached com port 3 (the one i use) and then it hung up my system, had to exit pascal. From looking at the code i can't see exactly why this is, it just freezes, think it gets stuck in a repeat loop in the modem.pas. My modem is a rockwell 56k plug and play, but the modem info program seems to work ok. Hopefully you can help.

Cheers
      Ykoorb
0
 
LVL 3

Expert Comment

by:Mathias
ID: 2778810
I don't have this problem, because I use COM2. But it is possible that there are different problems:

- please don't run under Protected Mode, I didn't test it
- please don't run under Windows
- check if there is a mouse driver installed under DOS
- no card modems (ISA, PCI) are detected and supported

If there are no other problems then you can rewrite the "modem.pas" unit like:

procedure SetOwnSettings(Base: Word; IRQ: Byte;
  NewSpeed: Longint; UART: Byte);
var MyCOM: TCOMPort;
begin
  MyCOM.Base:=Base;       PortBase:=Base;
  MyCOM.IRQ:=IRQ;         UsedIRQ:=IRQ;
  MyCOM.UART:=PORT_16450; UARTType := UART;
  Speed:=NewSpeed;
  SetupPort(MyCOM.Base, NewSpeed, MyCOM.IRQ);
  SetupParamPort(MyCOM, 7, N, 1);
  ResetQueue(InQueue);
  ResetQueue(OutQueue);
  SendChars(InitSeq);
  delay(Modem_TimeOut div 5);
end;

Please verify that you call ResetPort(PortBase, UsedIRQ) at the end.

This code was tested and it works very well.

Good luck, TDS.
0
 

Author Comment

by:Ykoorb
ID: 2783960
darn i think i have a software modem, think its ISA, you know why the procedure doesn't support the ISA or PCI ?

p.s it doesn't hang up my machine when run in dos, it just doesn't find my modem.

Cheers
        Ykoorb
0
 
LVL 3

Expert Comment

by:Mathias
ID: 2785476
If you have an ISA modem, then the unit can't find this modem. The unit based on COM detection so you can't use them.

Sorry, TDS.

PS: If you have Linux look in the source directory if you can find something.
0
 

Author Comment

by:Ykoorb
ID: 2794176
thanks for all your help, i am going to try and make my own unit which can be used for software modems.  I've made a few changes to yours and hopefully i should be able to get something working soon. I may mail the result to you when i'm finnished if you're interested. But for now i think you deserve the points. Thanks very much

Ykoorb
0
 
LVL 3

Expert Comment

by:Mathias
ID: 2795950
Ykoorb, I will follow the project and if you have another question, ask me (Email not EE!)...

TDS
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
send click   without cursor 6 379
printers log data 3 369
Youtube stream inside Delphi 1 1,573
TEdit.SetFocus trouble 3 174
Read  the original post  on Monitis Blog. Hi.  My name is Erik Dietrich, and this is the first time I’ve posted on the Monitis blog.  By way of introduction, I thought it would make sense to talk about my initial experience with Monitis.   Befo…
Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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