?
Solved

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

Posted on 2004-10-03
9
Medium Priority
?
226 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
[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
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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 1500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

650 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