CODESYS SMS Service - Article no. 2111000002
SMS
Connection Interface
To run the following
functions the implementation of the SMS Connection Interface library is needed.
See the SMS Service Example for one possible implementation. If the device
needs hardware handshake and it is not set in the parameters, this can result
in data loss.
Modem
This
function block should represent the physical device. It must only be started
once, before the following ones can be used. To start, the pin for the sim card
is needed, if it requires one. Otherwise, this variable can stay empty.
Additionally the type of connection is needed. Each one of the following
function blocks needs this one to work.
Send SMS
This
function block sends a short message to a receiver. Therefore the user has to
provide the receiver number and text to send. Perhaps the device cannot read
out the service center number from the Sim card. In that case the appropriate
error is returned and the user has to provide this number. Also the instance of
the modem is required for execution
The
execution works just as mentioned above.
Receive SMS
This
function block can receive a short message. Always the oldest one, which can be
found on the device, is returned. The number, message, time, status and index
are returned. The status declares if there was a message on the device or not.
The index is necessary to delete a short message. Also the instance of the
modem is required for execution.
The
execution works just as mentioned above.
Delete SMS
This
function block can delete one message in the device. The user must commit the
short message in the format, as he received it from the device. Also the
instance of the modem is required for execution.
The
execution works just as mentioned above.
Visualization
The
processes of sending, receiving and deleting can also be done with
visualization, but not the initialization of the modem.
After
entering the number of the receiver and the message, the button has to be
pressed for sending. The lamp next to it shows the current status. A yellow one
means that the current process is busy. Green means that the message was send
and red that a problem occurred.
The
other visualization combines the reading and deleting of a short message. The
oldest message of the device is displayed. When no message is available a
comment is written. Only the currently displayed message can be deleted. The
lamps also show the status as mentioned before