Send e-mail with an S7 PLC
Reducing downtime is quite difficult at times. Especially in large machine parks, it’s easy to lose track of everything. That’s why we offer you a way to reduce downtime cost-effectively and efficiently. In this article, we will show you how you can automatically receive an e-mail with the cause and machine data with your S7 in the event of a fault.
Why sending e-mails from the S7 is worthwhile
To reduce downtime in production, you can improve the monitoring of your machines and plants. This works particularly well with DataSuite, our versatile software for collecting and processing machine data. Later in this article, we’ll show you how to automatically receive an email when one of your machines fails.
This article builds on the article: “Reduce downtime in production”. There we demonstrated how DataSuite can help you save time, money, and frustration.
DataSuite allows you to send an e-mail without modem software when a machine has a fault condition. This e-mail then contains valuable information, i.e. a detailed description of the error. This can be measured values, error messages directly from the machine, or other information. With DataSuite, you can even send a diagnostic and error log as a PDF in the e-mail. In addition, the e-mail dispatch is always free of charge and in the event of an alarm, you will receive an e-mail with a stored text and the values you have selected, e.g. current temperature, machine number etc.
How the information exchange works in the event of an alarm
If your machine changes to the “fault” operating state, a trigger is released. Each trigger has trigger conditions and actions. If these conditions are met, the actions are executed.
For example, you can define a temperature value at which your machine switches to the “fault” operating state. Then, your PLC transmits the data to DataSuite, which processes the information and compiles an error message as an e-mail. You will then receive this e-mail on your e-mail address with the information you requested, which is already contained in your control system anyway.
We will then show you in practice how you can send e-mails using DataSuite. For this you logically need DataSuite, but we also offer you a trial version at the end of this article.
Note: How to send an SMS with a fault message, we have shown for you in this article:
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 e-mail with an S7 PLC
In this part of the article, we will show you what you need to configure in DataSuite to be able to receive error messages automatically by e-mail. In our example, an error has occurred in the “Saw 4” plant, so you will automatically receive an email with the error message and a log.
To be able to send e-mails with an S7, you must first create an e-mail account. To do this, click on the “Accounts” menu item and then on “Create new account”.
Then select the “Email account” option in the dialog and click “Create”. In the next window, you will need to make some settings to set up the email account. DataSuite can only send emails, so only the outgoing mail server is needed. Below the configuration, there is a button to test the settings. In addition, below it, you can limit the number of emails sent per minute and per hour to prevent spam during startup in case of configuration errors.
At the top, enter the name that you want to be displayed as the sender of the e-mail. For “Email address”, enter the address from which the mails should be sent. Underneath, log in with your email login details to link your account. Finally, all you need is the address, encryption, and port of your outgoing mail server. You can find this information from your email provider.
Define email for the incident
If you have successfully added the e-mail account, you can now define the message for the incident. To do this, you must create a new trigger in the “Trigger” menu. Then search for “PLC sends email” in the search bar and click on “create”.
First, you have to define the trigger conditions. You can find out exactly how this works in the manual, which will be sent to you free of charge when you purchase or test DataSuite. For now, though, we’ll focus on configuring the email itself. To do this, please click on the “Send an email” field below. The configuration could look like this:
At the top, select the email account you just created. Below that, you can enter the recipient. Multiple recipients can be entered, separated by a semicolon ([email protected];[email protected]). Below that, enter a subject and a message. The line with the recipient, subject, and message can also contain variables. Finally, you can add an attachment at the very bottom, for example an Excel file with machine data.
This is how your malfunction mail can look like
If you have configured the trigger correctly, it will trigger at a certain temperature, for example. In this way, your S7 immediately sends an e-mail as soon as a threshold value defined by you is reached. Of course, you can also receive an e-mail in other cases of malfunction, for example in case of a simple error. The e-mail, which you receive automatically in this fault case, could look like this:
As you have seen, you can customize the error message according to your needs. This way, you will always get exactly the information you really require. This can be error codes, logs or similar.
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 software, you can reduce your downtime by improving your monitoring. With our handy features, you can automatically receive an email with a detailed damage report when a machine breaks down. This will save you a lot of time and money.
You want to make your machine data available centrally on a web server? We have a simple solution for you.