To use the modem in program, look for “SendSMS Triggered” function block and place it into a program:


The function block expects 4 inputs and we will create a auxiliary variables for better debugging. Starting with the variable for input channel. Create a string variable and set its initial value to the name of the created alarm channel. By default it will be alrchannel:


The same we will do for the rest of the variables:

  • recipient: string variable containing a phone number in international format such as 00420777666555)
  • message: string variable containing the actual SMS message
  • trigger: bool variable which will execute the sending of the message on rising edge

The result should look similar:


Now deploy the solution and start the debugging mode. On each change of the variable trigger from False to True, the message will be send:

If the SMS has been send correctly, the Result output will be 0. Otherwise an error code will be issued and you can consult help (F1) for the given function block to determine the cause of the error.