Solved

I tried to execute the sms program from VB it gives an error saying invalid port number

Posted on 2004-10-03
9
201 Views
Last Modified: 2006-11-17
' Set up the communications port
MSComm1.CommPort = 1 ' Com Port 1

' Set for 9600 baud, no parity, 8 data, and 1 stop bit.
MSComm1.Settings = "9600,N,8,1"

' Tell the control to read entire buffer when Input is used
MSComm1.InputLen = 0

' Open the port
MSComm1.PortOpen = True

' Send an 'AT' command to the phone
MSComm1.Output = "AT" & Chr$(13) & Chr(10)
' The phone will respond with an 'OK'

' Set up the phone for a text message
MSComm1.Output = "AT+CMGF=1" & Chr$(13) & Chr(10)
' The phone will respond with an 'OK'

' Prep for SMS, give destination type and destination address.
' Enter the destination type and destination address to prep for SMS
' e.g. AT+CMGS="+2145551212",129
MSComm1.Output = "AT+CMGS= " & Chr(34) & _
    "+2145551212"" & Chr(34) & ",129" & Chr$(13) & Chr(10)
' The phone will return a'>' prompt, and await entry of the SMS message text.

' Now send the text to the phone and terminate with (Ctrl-Z)
MSComm1.Output = "This is a test. WOW! "
' The phone will respond with a conformation containing
' the 'message reference number' eg. +CMGS:

' Close the port
MSComm1.PortOpen = False


i tried to execute this program in  Nokia 6230 mobile which is connected to my computer. It gave an error Invalid Port number. whats the reason ? i tested with my nokia software , its running properly. only in VB its giving an error. I have connected the USB to first USBport. i have 4 USB port in my laptop, i am using WinXp Prof.
0
Comment
Question by:raj_ms
  • 4
  • 4
9 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 12213431
You have provided an example for RS232 SERIAL COMMUNICATION, so unless your USB cable is a USB-2-Serial-Converter, then it is not possible.
0
 

Author Comment

by:raj_ms
ID: 12213436
how to make it work do you have any idea. i have only USB cable. is there any way to send mesage to mobile using usb cable?
0
 

Author Comment

by:raj_ms
ID: 12213440
how do i communicate to my mobile using usb cable
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 12213473
Nokia 6230 has a software called 'PC Suite', this software include modem drivers, according to manuals, if you have installed drivers, you can use the phone as a standard SERIAL modem, but first have to look in Control Panel for serial number.

PS. USB numbering is not related to serial numbering.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 12213476
0
 

Author Comment

by:raj_ms
ID: 12213489
i have already installed this software. how do i find the serial number.i dont want to use that software. i want to write the code in vb, may be i can use the usb driver library file,but tell me how to use that as well.
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
ID: 12213522
If you have correctly installed the software, then a serial port will be emulated, I guess. Launch 'Control Panel', pick 'Modems' Icon, and see the 'COMx' number in its properties.
0
 

Author Comment

by:raj_ms
ID: 12272257
I am sorry for the delay, but i cant find the port no. in control panel i haave clicked the system icon's property. in hardware tab, device manager i clicked the ports, it doesnt show the nokia phone port, where can i find the port no of my nokia phone 6230 to send and recieve message.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

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

16 Experts available now in Live!

Get 1:1 Help Now