ModemCommandDelay Property

Description:

The ModemCommandDelay property defines the minimum time gap, in milliseconds, between two consecutive AT commands sent to the modem. The time gap is calculated as time elapsed between the last communication to/from the modem and the next AT command. The default value is set as 100. Accepts a value between 50 and 5000.

In most cases the default value does not require to be changed, however, certain GSM modems and SIM cards are slower and the value may require to be changed. If too many CMS ERROR 500 are caused then increasing this value can (not always) solve the problem.

   

Usage
  • ObjectName.ModemCommandDelay = lngModemCommandDelay
  • lngModemCommandDelay = ObjectName.ModemCommandDelay
Value Type Long
Access Mode Read/Write
Valid Values 50 to 5000 milliseconds
Default Value 100

Usage Example:

Visual Basic / ASP (VBScript)
Dim objSMS As mCore.SMS, strMessage As String
Dim i As Integer, strPhone() As String, blnAllMsgsSent As Boolean
Set objSMS = New mCore.SMS
' You can also use Set objSMS = CreateObject("mCore.SMS")
' In case of ASP (VBScript) to create object use
' Set objSMS = Server.CreateObject("mCore.SMS")
' In ASP use Response.Write instead of MsgBox
objSMS.LogType = 2
objSMS.Port = "COM3"
objSMS.BaudRate = 19200
objSMS.Parity = "N"
objSMS.DataBits = 8
objSMS.StopBits = "1"
' It is not necessary to execute the 'Connect' method.
' Connection state is detected internally by mCore and
' the 'Connect' method is executed accordingly.
objSMS.Timeout = 10000
objSMS.ModemCommandDelay = 150
objSMS.LongMessage = 3
objSMS.SendRetry = 2
strPhone(0) = "+919811054321"
strPhone(1) = "9810056432"
strPhone(2) = "9812345678"
strPhone(3) = "+919820054321"
strPhone(4) = "+919832087654"
strMessage = "This is a test message to test send delay property."
blnAllMsgsSent = True
For i = 0 To 4
     objSMS.SendSMS strPhone(i), strMessage
     If objSMS.IsError(True, "My Application") Then
          blnAllMsgsSent = False
     End If
Next
If blnAllMsgsSent Then
     MsgBox "All messages sent successfully!"
Else
     MsgBox "At least one message was not sent!"
End If
' Disconnect method is executed internally
' whenever the SMS object is terminated.
Set objSMS = Nothing

  

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved