Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Send SMS


Nichol Oct 19, 2021 03:42 PM

Hi,

I try to use scrip below to send SMS but not working

I'm using;

1.CR310 (OS: 10.04)

2.Unimax4Gx Modem (GSM)

Please advice

'CR300 Series Datalogger

'Declare Public Variables
Public PTemp, batt_volt

Public Go_Rcv As Boolean
Public Go_Send As Boolean 'Boolean variable to toggle test
Public SMS_Send_Res(3) As Long 'Array to hold SMSSend responses
Public snd_phone(3) As String 'Array to hold SMS recipient phone numbers
Public snd_msg(3) As String * 50 'Variable to hold the SMS message to send
Public send_swath
Public send_total

'Main Program
BeginProg
send_swath = 3 'send the same message to 3 different phone numbers
snd_phone(1) = "60105992950"
snd_phone(2) = "5555554321"
snd_phone(3) = "5555556789"
snd_msg(1) = "Test Msg to " & snd_phone(1)
snd_msg(2) = "Test Msg to " & snd_phone(2)
snd_msg(3) = "Test Msg to " & snd_phone(3)
SW12 (1)

Go_Rcv = 1

Scan (15,Sec,0,0)
PanelTemp (PTemp,4000)
Battery (batt_volt)
NextScan

SlowSequence
Scan ( 30, Sec, 0, 0 )
If Go_Send Then 'Set Go_Send to true to test SMSSend
SMSSend( SMS_Send_Res(),send_swath,snd_phone(),snd_msg )
If SMS_Send_Res = -1 Then 'SMSSend returns -1 if successful
send_total = send_total + 1 'Increment counter if message send is successful
EndIf
Go_Send = false 'Reset Go_Send test flag
EndIf
NextScan
EndSequence

EndProg


JDavis Oct 19, 2021 10:31 PM

The SMS_Send() instruction is designed to work with the internal cell modem option.

For using an external cell modem, check the documentation for the modem to see if it supports SMS messaging. Modems that support SMS messaging often have an AT command for accessing the functionality.

Log in or register to post/reply in the forum.