Sending an SMS with a Function Block on the PC via the PC's Serial Interface

Source text: TcPlcSMSPCTest.exe (do not forget to change the telephone number)

Task

A simple program that uses the SMS function block on a PC to send an SMS via its serial interface.

Description

As is described in the documentation for the 'Serial Communication' library, the serial interface is served in a fast task, while the SMS message is sent by a slower task.

Sending is initiated by a rising edge at the Send input. The Busy variable can be used to detect when the SMS message has been transferred to the modem.

Configuration in the System Manager

So that the serial interface can be controlled, it must be inserted as an I/O device in the System Manager. The interface must be configured for KL6xx1 operation with 64 data bytes. The inputs and outputs of the COM port device must then be linked to the variables in the PLC program (SerInData and SerOutData).

Implementation of the Program in the Slow Task to Send the SMS

Sending an SMS with a Function Block on the PC via the PC's Serial Interface 1:

Implementation of the Program in the Fast Task for Serving the Serial Interface

Sending an SMS with a Function Block on the PC via the PC's Serial Interface 2:

Global Variables

Sending an SMS with a Function Block on the PC via the PC's Serial Interface 3:

Task configuration

Sending an SMS with a Function Block on the PC via the PC's Serial Interface 4: