Sending SMS - ST
CHANNEL : STRING := 'ALRCHANNEL';
RECIPIENT : STRING := '00420123456789';
MESSAGE : STRING;
IF TESTSMS THEN
MESSAGE := 'TEST SMS HAS BEEN SENT.';
TESTSMS := FALSE;
The function sends a SMS in each PLC computing cycle. It is highly recommended to be used in ST code only to prevent occassional flooding of the recipient with many messages of the same contents. If You want to send more than one message at the time, You have to use this block multiple times or create some sort of switcher for recepients. Every GSM gate has it's queue lemit, for example limit of four messages. We highly recommend to send the messages with some breaks, for example pause between two messages can be 10 seconds. Messages that can't be handeled by the queue are forgotten.
||reference to variable with the communication connection definition (set in PLC properties, see below)
||reference to variable with recipient's phone number
||reference to variable with the SMS message text (ASCII)
||Numeric status; result of the system settings check
At each of the sendsms function calls, a SMS is sent from the predefined GSM modem to the recipient phone number. The SMS contents is taken from the message variable.
The channel variable refers to the predefined communication channel. This has to be created in the PLC properties: doubleclick the PLC and select Message definition, then right-click the context menu and Add alarm channel.
Now, define the channel name which is the value of the channel variable. Then, the GSM connection type must be defined: click to select the channel and set the port to communicate to the modem in the channel properties. Set the channel communication properties. If the SIM card is secured by a PIN, enter the PIN here. Finally, confirm all changes by clicking OK in the red dialogue.
If some of the predefined modem types is used, like Siemens TC-35 chipset, or Wavecom, it is possible to set in the AT command settings predefined commands to set up the modem. Then click the Apply button. The necessary AT commands are then added to the table. Click the Close button and confirm by clicking OK in the red dialogue. If another modem type is used, the AT command sequence has to be entered manually. (In case of unsupported modem types please contact the Domat Control System technical support.)
The output variable result indicates the result of the system settings check.
||Error - impossible to determine the status
||Port can not be opened or modem can not be initialised (e.g. wrong COM port number)
||Timeout at the AT command (default 2 s)
||GSM channel error (e.g. wrong PIN, network not available …)
||Internal error - contact Domat Control System support
The function is typically used to send alarm messages or regular reports with energy consumption, environmental parameters etc. See ST call above for function call