
Programming the program blocks
5.2 Programming SMS messages via OUC
CP 1243-7 LTE
94
Operating Instructions, 01/2015, C79000-G8976-C381-01
When creating this structure (DB of the data type "Struct"), no optimized block access can be
configured.
The structure should have a size of 194 bytes and the following structure to store the
relevant data of the received SMS message:
●
DTL
12 bytes for the time stamp of the received SMS message (time stamp from the network)
●
String[22]
String of 22 bytes for the phone number of the sender
●
String[160]
String of 160 bytes for the message text
The SMS message text can contain max. 160 characters.
●
Byte
Status of the SMS message:
–
0 = Invalid
1 = Unread
2 = Read
Storing the last 10 received SMS messages
You can output up to 10 received SMS messages from the receive block by making the entry
"SMSSTORE" for the "PhoneNumber" parameter of TCON_PHONE.
In this case, you need to create an adequately large structure (1940 bytes) for the "DATA"
parameter of the receiving block to save the received data of 10 SMS messages. The
structure is then organized as follows:
●
Received data SMS 1 (DTL, String[22], String[160], Byte)
●
Received data SMS 2 (DTL, String[22], String[160], Byte)
... to
●
Received data SMS 10 (DTL, String[22], String[160], Byte)