×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

sending AT commands using QBASIC

sending AT commands using QBASIC

sending AT commands using QBASIC

(OP)
hey all,

Ive been trying to send some AT commands using qbasic but have had limited success. I downloaded a program from one of the forums thanks to "agual" and the terminal program there was great. HOWEVER :-(

I am sending this commmand,

ATE1N1X4&C0S8=2S9=5

The modem returns OK

I then send ATDT xxxxx-xxxxxx (uk)

The modem dials the number, this is where it gets tricky.

When i send the ATH command the modem disconnects but ALWAYS returns

NO CARRIER  

But if it rings it should return RING, if its BUSY it should return BUSY but it does not. It always, always returns NO CARRIER!

Can someone please HELP !


RE: sending AT commands using QBASIC

ATH is hang up.
if you want it to complete the call don't use ath until
you are done.

RE: sending AT commands using QBASIC

When the other modem answers the calling modem should leave command mode. But as Buff1 notes, you are disconnecting before it has a chance to connect.
If this is hayes compatible you should be able to do a at$ for a command summary.

Ed Fair
Give the wrong symptoms, get the wrong solutions.

RE: sending AT commands using QBASIC

BTW you can usually use (if i remember correctly) +++ to get back to the modem command mode

RE: sending AT commands using QBASIC

(OP)
Thanks for your advice.

My ultimate goal is this.

To send an AT command using QB and then when the modem returns a result code i want to be able to capture the response within the program.

However it needs to be done quite quickly for example each call needs to return the correct result code within 5 seconds.

So when the call takes place if there is no answer the modem returns RING, or if its engaged it returns BUSY. But everytime the modem hangs up on its OWN or using ATH command i always receive the message NO CARRIER...

RE: sending AT commands using QBASIC

Have you looked at the X4 responses for your modem?  The busy and ring responses may not be included in the command set.
Use a terminal emulator to connect the way you want QB to connect and see what the responses are.

Ed Fair
Give the wrong symptoms, get the wrong solutions.

RE: sending AT commands using QBASIC

(OP)
Ok, Had a little frustrating play and looks like i can only get a NO ANSWER response if i use the @ i.e atdt123456@ but still not fully functional.

So my next question is... how can i capture response from a modem using QB, for example, I type AT, the repsonse is OK how do i get the "OK" in a variable for which i can use?

RE: sending AT commands using QBASIC

Try using a random or binary file for the com port.
then read/write to/from it.

RE: sending AT commands using QBASIC

Maybe this will help you. First I would like to say I'm learning as mess things up along the way hehe. Well the modem has lots of commands
ATS0=1 tells the modem to wait for a call connect after first ring
ATDT DIAL OUT
ATHT OR ATZ HANG UP
ETC
you can even set your modem up like a fraggin' caller id if you wanted to. Ok now about sending modem commands to the one machine to the other. First code then I'll explain. I need help so the net help me along the way and I got this code, but bugs where in it. In the end I got a full working chat program sending data to one box to the other.


OPEN "COM2:9600,N,8,1,RB2048,TB2048" FOR RANDOM AS #1
PRINT #1, "ATZ"
CLOSE

OPEN "COM1:9600,N,8,1,TB2048,RB2048" FOR RANDOM AS #1
PRINT #1, "ATDT4940716"

a$ = ""
DO
IF LOC(1) THEN a$ = a$ + INPUT$(1, 1)
LOOP UNTIL INSTR(a$, "CONNECT")
PRINT #1, a$

ok open the come etc
print #1, "MODEM COMMAND" tell to send a command to the modem
no that a$"" loop part waits till a connect is made and will
not go to the next line of code till it reads connect.

RE: sending AT commands using QBASIC

change that first com2 to com1 sorry dang the bugs :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close