gsmSendFlashSMS (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.50 / 1.00.00


This function sends a so-called Flash/Alert SMS message over the GSM network. A Flash SMS message will appear on the receiver's mobile phone as an instant pop-up message that will not require entering a menu etc. to read. Not all mobile phones support Flash SMS messages.

 
Please note that you should always check the return value from this function. There are a number of reasons why this function could fail such as too much traffic on the GSM network etc., so always check the return value, and based on that it is possible to make a strategy for resending a message.

 

Note: gsmSendFlashSMS is not designed for use with the RTCU Communication Hub.

 

 

Input:

phonenumber : STRING (max length is 20, excluding " " and "-")

Number to send the SMS message to (if "9999" is used, the message will be sent to a connected PC - either through a cable connection or via an active data connection).

 

In case the device is not connected to the GSM network, the return value will be 1.

 

message : STRING

The actual message to send (maximum of 70 characters).

 

Returns: INT

0

If successful.

1

If general error.

2

If CMS/CME error (error on GSM net).

3

If not connected to a base station.

4

If GSM module is not powered on (see gsmPower()).

5

If GSM module is busy with a data call.

 

 

Declaration:

FUNCTION gsmSendFlashSMS : INT;
VAR_INPUT
  phonenumber : STRING;
  message     : STRING;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
// Turn on power to the GSM module
gsmPower(power := TRUE);
 
BEGIN
  ...
  // Note: we are NOT checking the return code from the gsmSendFlashSMS function in this example
  gsmSendFlashSMS(phonenumber := "+44 12 34 56 789", message := "This is a test message sent using SMS");
  ...
END;
 
END_PROGRAM;