vb6 mscomm.input handling

S

Thread Starter

subhash vatyani

<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>
 
Have u looked at the properties of MScomm?
I believe you can change the s threshold instead of the len thing you did when you capture the string in he input buffer. I am working on a simular project to capture pbx calls
 
C

Cinzia La Morgia

Did you try SMS Server? SMS Server is a add-on for CitectSCADA that lets you to notify via SMS and/or email the alarms coming from the plant. It is equipped with an address book and a calendar by means of which it is possible to define the persons, or groups of persons, to which notify the alarms and time scheduling. SMS Server is strongly configurable and allows you to select single alarms or categories of alarms, or groups of alarms and groups of categories of alarms.

The current version 2.22 is on our web site:
http://www.smsserverweb.com

In September the new beta version 3.00 will be available. It will have support for Citect 7 server clustering.

Goodbye,
Cinzia La Morgia
 
Top