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!
  • Students Click Here

*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

How to get or wait for the result code of an AT Command?

How to get or wait for the result code of an AT Command?

How to get or wait for the result code of an AT Command?

How can I get or wait for the result code of an AT Command without using the `Sleep()` function in PowerBuilder? I am using the MSComm OLE Control for PowerBuilder. Could I do a While Loop unti the `MSCOmm.Input` property returns the proper buffer?(e.g, `OK`) However, I tried this but the `Input` returns an empty string.

Here is my PB Code:

CODE -->

String numbers[]

    numbers[1] = "+639394854493"
    numbers[2] = "+639394854491"
    numbers[3] = "+639394854492"
    numbers[4] = "+639394854493"
    numbers[5] = "+639394854494"

    int cnt = 1 
    for cnt = 1 to 5
	    ole_1.object.Output = "AT" + Char(13) + Char(10)
	    ole_1.object.Output = "AT+CMGF=1" + Char(13) + Char(10)
	    ole_1.object.Output = "AT+CMGS=" + Char(34) + numbers[cnt] + Char(34) + Char(13) + Char(10)
	    ole_1.object.Output = sle_2.text + " - " + string(cnt) + Char(26)

And here is the port settings:

CODE --> Powerscript

ole_1.object.CommPort = 7
	ole_1.object.Settings = "115200,n,8,1"
	ole_1.object.RThreshold = 1
	ole_1.object.InputLen = 0
	ole_1.object.InputMode = 0
	ole_1.object.PortOpen = True 

Any suggestions? Or am I doing something wrong?

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