The SendSMS function block is used to establish a connection with a GSM modem and send an SMS to a specified receiver. For example, the controller can send SMS when a trigger is raised to transmit an alarm to a specified cell phone:
NOTE:
Be sure to have your GSM modem properly configured as follows:
oMake sure the SIM card in the modem is unlocked.
oMake sure the telephone number of the SMS center is valid.
You can use the ConfigSim function block to properly set these parameters from your application program.
Input |
Type |
Description |
---|---|---|
phoneNb |
STRING |
The phoneNb input contains the phone number of the receiver. |
smsText |
STRING(255) |
The smsText input contains the body of the text message (255-character maximum). |
This figure shows the declaration and use of the ReceiveSMS function: