We will show you how you can easily send alarm e-mails with DataSuite3 based on machine statuses.
Let’s assume, for example, that you have a hydraulic press with a temperature sensor. If the hydraulic oil exceeds a certain temperature value, an email should be sent to your service team asking them to carry out maintenance on this press.
What do we need? #
To solve this task, we need an email account and the DataSuite software. We assume that the press has an OPC-UA
compatible control system. DataSuite is compatible with many different machine controllers such as Siemens S7, Beckhoff, VIPA, etc.
Alternatively, Siemens controllers can also be addressed directly or you can use OPC-UA compatible temperature measurement technology, e.g. this device from the company Wiesemann und Theis.
Add control #
A PLC simulator is already created in the software, which we will not use in this example. Instead, we will create a new controller of type S7 OPC-UA. In our case, we have an S7 1500 PLC with the IP address 192.168.253.100 and port 4000. We always recommend activating OPC-UA encryption. In our test setup, however, we leave the connection unencrypted.
Now we wait a short moment until the DataSuite software has established the OPC connection to the PLC and the indicator changes to green. Now we can import the required OPC variables. These are then available in many places in the DataSuite software, as we will see later.
Connect e-mail account #
Next, we create an email account. The DataSuite software is compatible with almost all email providers. Please note that a 2-factor authentication is problematic for our planned automated sending of emails. We therefore recommend choosing a provider that allows sending without a second factor. In our example, we have created an address with the largest German email provider, GMX. With GMX, you only need to activate POP3 IMAP so that the DataSuite software can send GMX emails.
Let’s now go to the Account area. There we add a new account of the type Email. Please enter your own names and passwords in the settings. In the case of GMX, the server is… mail.gmx.net… the port is 587.
Create trigger #
Finally, we create a trigger that monitors the temperature in the control unit and sends an e-mail if necessary. We have already created a trigger template for you with the name ‘Send e-mail’.
We now select Individual as the trigger condition and use a variable comparison as the condition. In our case, we compare the temperature variable from the controller with a constant limit value. So we set the comparison to greater and the comparison value to 70 degrees. If the temperature now exceeds this value, the trigger is activated.
As temperatures can fluctuate greatly, but we only want to send one email per incident, we now activate debouncing and hysteresis. Hysteresis is particularly important to prevent an endless number of mails being sent. We set the release condition to less than 65 degrees.
All that remains is to send the email, i.e. the trigger action. To do this, select the previously configured email account and enter a recipient email address. You can now enter your message in the subject line and also in the message text as you wish.
You can also insert variable values anywhere in the text by clicking on the VAR plus button. In our example, we insert the current temperature from the OPC variable and the time.