LF: Receive SMS

Use this to receive an SMS message and store it along with its metadata.

 

Parameter Name

Purpose

A

Modem

Select a modem that has been defined in PLC Communications>Modems

B

Buffer

Select the buffer where the received SMS message will be stored

C

SMS Length

Select the tag that will store the length of the SMS (in bytes)

D

SMS Metadata

This is a struct that contains the elements listed below. 

Status

 0 = No errors

 1 = Function has started

 2 = Function in Progress

-3 = Unauthorized phone number

-4 = No SMS in queue (Queue Empty). This occurs when the Modem Struct parameter, SMS Received Queue = 0

-5 = Buffer Overflow

For all other numbers, retry the operation. If it continues to fail, note the error number and contact support.

Received Time

UTC received time

Phone Number

Incoming Phone number

 

 

When you create an SMS message, UniLogic automatically creates a supporting struct.

Name

Data Type

Definition

Send:Success

Bit

ON=Sent Successfully

Send: Fail

Bit

ON=Send Failed

Status

 

UINT32

 

Error

SMS Send Status Message

0

No errors

1

Function start

2

Function in Progress

-1

Modem only: General COM error. Please check the physical connections.

-2

Modem only: Sent message error

-3

Modem only: Telephone number format error

Note that the number cannot contain spaces.

-4

 

Modem only: Parse Message error. This may result because:

- The elements in the message may contain a 'null' character

- Message length exceed the maximum limit,150 for English-only, 70 for non-English characters.
Note that if the message contains list elements, and the lists contain many members, this may cause the message to exceed the maximum limit.

-5

SMS Last Error

-6

Router only: Incorrect Username or Password to Router's SMS module

-7

Router only: General Error. Resend message; if error persists, check the Router authorizations.

 

Related Topics

SMS: Creating Messages

SMS: Sending via Ladder (LF)

LF: Initialize Modem

Buffers

Parse

Configuring a Modem