SoftPLC
 
Font size:      

Usage

Ladder Instructions

TLI: SENDSMS

The SENDSMS instruction is used to send a SMS message containing a block of data. It is an edge triggered instruction and will queue a message to be sent each time the rung goes from false to true.

There are four (4) parameters for this TLI:

SENDSMS TLI Parameters
Parameter NameDescrption
"Control:"Control element (R) address. The ".LEN" word is used to indicate to the TLI how many words to send. The ".CTL" word bits are used to indicate activity status for the TLI. When the instruction is triggered, the enable (EN) and queue (EU) bits are set. On completion of sending, either the done (DN) or error (ER) bit will be set: the DN for a successful send, the ER for any error. The ER bit will also be set if the message queue is currently full. In addition to the ER bit being set in the ".CTL" word, the ".POS" word is used to store an integer value that maps to the type of error that occurred.
"Phone #:"String element (ST) address. This is a string in the data table that contains the destination number which will receive the SMS messages.
"Data:"Integer (N) block address. This is a block address (e.g. #N7:0) which will be used to stuff the message with data. The data sent will be a continuous section from the start element specified in this parameter and will include CONTROL.LEN elements.
"Result:"String element (ST) address, which returns a text string indicating success or failure status of the SENDSMS operation. This is a text representation of the value in the ".POS" word of the control parameter.


TLI: SENDTEXTSMS

The SENDTEXTSMS instruction is used to send a SMS plain text message, containing the value from a single String element in the SoftPLC data table. It is an edge triggered instruction and will queue a message to be sent each time the rung goes from false to true.

There are four (4) parameters for this TLI:

SENDTEXTSMS TLI Parameters
Parameter NameDescrption
"Control:"Control element (R) address. The ".LEN" word is NOT used for this TLI - it sends a single String element (up to 80 characters in length). The ".CTL" word bits are used to indicate activity status for the TLI. When the instruction is triggered, the enable (EN) and queue (EU) bits are set. On completion of sending, either the done (DN) or error (ER) bit will be set: the DN for a successful send, the ER for any error. The ER bit will also be set if the message queue is currently full. In addition to the ER bit being set in the ".CTL" word, the ".POS" word is used to store an integer value that maps to the type of error that occurred.
"Phone #:"String element (ST) address. This is a string in the data table that contains the destination number which will receive the SMS messages.
"Data:"String element (ST) address. This is a string in the data table that contains the text to be sent in the SMS message.
"Result:"String element (ST) address, which returns a text string indicating success or failure status of the SENDTEXTSMS operation. This is a text representation of the value in the ".POS" word of the control parameter.


TLI: RCVSMS

The RCVSMS instruction is used to receive a SMS message containing a block of data. It is an edge triggered instruction and will queue a receive attempt each time the rung goes from false to true.

There are three (3) parameters for this TLI:

RCVSMS TLI Parameters
Parameter NameDescrption
"Control:"Control element (R) address. The ".LEN" word is used to indicate how many words of data were received. The ".CTL" word bits are used to indicate activity status for the TLI. When the instruction is triggered, the enable (EN) and queue (EU) bits are set. On completion of the request, either the done (DN) or error (ER) bit will be set: the DN for a successful receive, the ER for any error - including no messages to be received. The ER bit will also be set if the request queue is currently full. In addition to the ER bit being set in the ".CTL" word, the ".POS" word is used to store an integer value that maps to the type of error that occurred.
"Data:"Integer (N) block address. This is a block address (e.g. #N7:0) which will be written to with the message data. The data received will be written in a continuous section from the start element specified in this parameter. The number of elements received will be noted in the CONTROL.LEN word.
"Result:"String element (ST) address, which returns a text string indicating success or failure status of the SENDSMS operation. This is a text representation of the value in the ".POS" word of the control parameter.


TLI: RCVTEXTSMS

The RCVTEXTSMS instruction is used to receive a SMS plain text message. It is an edge triggered instruction and will queue a receive attempt each time the rung goes from false to true.

While it is possible to send up to 160 (ASCII) characters with a normal SMS text message, SoftPLC STRING elements only support 80 characters. Any text received beyond the 80-character max will be truncated (discarded).

There are three (3) parameters for this TLI:

RCVTEXTSMS TLI Parameters
Parameter NameDescrption
"Control:"Control element (R) address. The ".LEN" word is used to indicate how many characters of text were received. The ".CTL" word bits are used to indicate activity status for the TLI. When the instruction is triggered, the enable (EN) and queue (EU) bits are set. On completion of the request, either the done (DN) or error (ER) bit will be set: the DN for a successful receive, the ER for any error - including no messages to be received. The ER bit will also be set if the request queue is currently full. In addition to the ER bit being set in the ".CTL" word, the ".POS" word is used to store an integer value that maps to the type of error that occurred.
"Data:"String (ST) element address. This is a string in the datatable which will store the recieved text of the SMS message.
"Result:"String element (ST) address, which returns a text string indicating success or failure status of the SENDSMS operation. This is a text representation of the value in the ".POS" word of the control parameter.