S
<p>Hi,
<p>Can someone tell me how to go to next sms sent by GSM modem on my serial port? Below I am giving my source code. It does work properly but every time only first message it write in test.txt file.
<p>Every next message pushes the first message to go in buffer$ I used.
<p>Pls let me know how to go 2nd and nth message to read.
<pre>
Private Sub Command1_Click()
' Buffer to hold input string
'Dim data As String
Dim ln As Integer
' Use COM1.
MSComm1.CommPort = 1
' 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
MSComm1.InputMode = 0
' Open the port.
MSComm1.PortOpen = True
' Send the attention command to the modem.
'MSComm1.Output = "ATV1Q0" & Chr$(13) ' Ensure that
' the modem responds with "OK".
Do
buffer$ = buffer$ & MSComm1.Input
DEL5
Loop Until Len(buffer$) > 6
ln = Len(buffer$)
data = buffer$
' MSComm1.Input = ""
Open "C:\DATA.TXT" For Append As #1
Write #1, data
Close #1
buffer$ = ""
' writetxt
' buffer$ = buffer$
MSComm1.PortOpen = False
End Sub
Private Sub DEL5()
PauseTime = 2 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
End Sub
</pre>
<p>Can someone tell me how to go to next sms sent by GSM modem on my serial port? Below I am giving my source code. It does work properly but every time only first message it write in test.txt file.
<p>Every next message pushes the first message to go in buffer$ I used.
<p>Pls let me know how to go 2nd and nth message to read.
<pre>
Private Sub Command1_Click()
' Buffer to hold input string
'Dim data As String
Dim ln As Integer
' Use COM1.
MSComm1.CommPort = 1
' 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
MSComm1.InputMode = 0
' Open the port.
MSComm1.PortOpen = True
' Send the attention command to the modem.
'MSComm1.Output = "ATV1Q0" & Chr$(13) ' Ensure that
' the modem responds with "OK".
Do
buffer$ = buffer$ & MSComm1.Input
DEL5
Loop Until Len(buffer$) > 6
ln = Len(buffer$)
data = buffer$
' MSComm1.Input = ""
Open "C:\DATA.TXT" For Append As #1
Write #1, data
Close #1
buffer$ = ""
' writetxt
' buffer$ = buffer$
MSComm1.PortOpen = False
End Sub
Private Sub DEL5()
PauseTime = 2 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
End Sub
</pre>