Send SMS with a S7 PLC
When it comes to reducing unplanned downtime, problems can often arise. We offer you an easy way to keep track of your downtimes. In this article, we show you how you can automatically receive an SMS with a comprehensive error message and PLC variables of your S7 in case of a machine downtime.
Why sending SMS from the S7 is worthwile
Improving the monitoring of your machines and plants will in most cases lead to a drastic reduction of your downtimes. Our versatile software for collecting and processing machine data, DataSuite, can have a big positive impact on this. Later in this article, we will show you how you can automatically receive an SMS when one of your machines fails. The big advantage is that you will be notified immediately with comprehensive information about the possible source of the error. Moreover, the SMS feature can be used with any cell phone, completely without installing an additional app or needing an internet connection.
This article builds on the article: “Reduce downtime in production”. There we showed how you can save time, money, and nerves with the help of DataSuite.
Importance of the DataSuite in this process
DataSuite allows you to send SMS without a SIM card. If you have set it up correctly, you will automatically receive an SMS with valuable information when a machine has a fault condition. This can be error texts directly from the plant, measured values or even other information. With the help of DataSuite, you can even include PLC variables in the SMS. In case of an alarm, you will then receive an SMS with a stored text and the values you have selected, e.g. current temperature, machine number etc. However, it should be noted that there are small costs for sending SMS at the SMS service provider SMS77. However, there is no basic fee and for an SMS with 160 characters, currently only 0.075 euros.
This is how information is exchanged in the event of a fault condition
The purpose of this article is that you will end up understanding and being able to practically implement the structure shown here. You will notice that it is actually quite simple. In order to successfully send an error message as an SMS at the end of this article, we need a trigger created in the DataSuite software. A trigger has trigger conditions and actions. If these conditions are met, the actions will be executed. So if your machine changes to the operating state “malfunction”, in this case the trigger will be triggered.
There are many ways to define a trigger. For example, you can define a temperature value from which your machine changes to the operating state “Fault”. In this case, your PLC transmits the data to the DataSuite software, which then compiles an error message in the form of an SMS. Which information the SMS should contain, you can define yourself in our software.
Praxisbeispiel und wie man eine E-Mail mit einer S7 verschicken kann
We will then show you a real-life example of how you can use DataSuite to send SMS messages. The DataSuite is mandatory for this. At the end of the article, you can enter your email address to request a free trial version of DataSuite.
Note: How you can send an e-mail with a fault message, we have shown for you in this article: Send e-mail with an S7 PLC
You would like to get a live insight into DataSuite 3?
In a live online demonstration, we will go into detail about the individual functions and answer any questions you may have. Together we will find out whether DataSuite 3 is suitable for your needs.
Send SMS with a S7 PLC
In this part of the article, we will show you the required configurations in DataSuite to be able to receive error messages automatically via SMS. In our example, an error has occurred in the “Press 3” plant, which is why you will receive an SMS with the associated error message.
To be able to send SMS with an S7, you have to create your sms77 account in the DataSuite. If you do not have an account yet, please create a new account on the sms77 website beforehand.
If you have created an account, you can now set it up in DataSuite. To do so, please click on the menu item “Accounts” and then on “Create new account”.
Then select the option “Sms77 Account” in the dialog and click on “Create” afterwards. Now you have to make some settings for the setup of the Sms77 account. Next, we will customize exactly this SMS account in DataSuite. There you can activate the debug mode at the very top.
What is the debug mode?
You can activate the debug mode when configuring the SMS account. In this case, the SMS are not sent to save costs during setup or testing. Before commissioning, this mode should definitely be deactivated, because this way no SMS are sent.
You will find a button at the bottom of the configuration page to test the settings. You can also limit the number of sent SMS per minute and hour underneath. This makes sense to prevent high costs due to accidentally sent SMS during commissioning in case of configuration errors.
Enter the name that is to be displayed in the SMS as the sender. Below this, your API key must be entered. To be able to send SMS, you have to create an API key at sms77. We will show you in the next step how this works exactly.
Create API key at sms77
Now we will show you how to create an API key at sms77 to then link this account to DataSuite. First open the developer page of sms77. After you have logged in, please click on the + button at the tile “API keys”. Now a small menu will open, where you please enter a name at the top. After you have clicked on “Save”, your API key will be displayed below.
With a click on the key, it can now be copied to continue with the setup in DataSuite. Go back to the configuration page of your SMS connection in DataSuite and paste your API key into the field provided. Now you can save the configuration like this. Make sure that debug mode is enabled if you’re still testing and don’t want to send an SMS for now. In the next step, we will show you how to define the SMS using a trigger.
Define SMS for the alert case
If you have successfully created an API key and added your SMS account, you can now define the message for the alert case. To do this, create a new trigger in the “Trigger” menu. Then search for “PLC sends SMS” in the search bar and click on “Create”.
First, the trigger conditions must be defined. When you purchase or test DataSuite, we will send you a free manual that explains the trigger conditions of a trigger. For now, we will deal with the configuration of the SMS itself. To define the SMS, please click on the “Send email” field below. The configuration could look like this:
Select the sms77 account at the top. Enter the recipient below. Multiple recipients can be entered, separated by a semicolon (0274296887280; 0274296887281). Now you can enter the message of the SMS. The message can also contain variables. With a click on the “var+” symbol on the right side, you can select a variable directly from the control. In this example, we use the error code from the PLC. Note that sms77 charges per 160 characters. After saving, you can execute the trigger. Remember that no SMS can be sent in debug mode.
Your malfunction SMS can look like this
If the trigger was configured correctly, everything should now work. If the trigger condition you defined is met, an SMS is sent directly to the numbers you entered. However, the trigger can also be activated manually in the “Trigger” menu.
You can of course also receive an SMS in other fault conditions, the possibilities are not limited to you here. The SMS you would then receive could look like this:
As you can see, you can customize the error message you receive in the event of a fault according to your needs. This way, you will always receive exactly the information you require.
Further DataSuite functions and information options
DataSuite offers many more functions, for example you can use it to create PDF or Excel documents from machine data and automatically write machine data to a database.
You can find much more information and setting options in the DataSuite software manual, which is included in the download. There you can find detailed instructions with screenshots.
More information and help free of charge from our experts:
Phone: +49 2742 72927 80
E-mail: [email protected]
With the help of DataSuite, you can have an SMS sent automatically when a machine breaks down. This can contain a detailed damage report and even PLC variables. This can greatly reduce your downtime, saving you time and money in fixing the problem.
You want to make your machine data available centrally on a web server? We have a simple solution for you.