Email a data log report and screenshot

Email a data log report and screenshot
none 0.0 0
  • HMI Model: CMT2078X
  • EasyBuilder Pro Version: V6.10.01.359

We are using the HMI in part of a food production plant. After each batch we need to send reports that include the cooking parameters (for example temperature sensor readings every 5 seconds) as well as a screenshot of batch information.

I have a data sampling objects creating log files that are going to USB1. We are having to pull that USB and email manually, but I would like to automate that data transfer.

I have enabled email functionality in the System Parameter Settings and successfully sent a test email. Now I need to figure out how to send the email with the attached file. I’m guessing the best way is going to be to create a macro with LB2 as a trigger, but I can’t find any email functions. Is there another library that I need to import to get these?

Is email the right way to accomplish this? Maybe it would be better to use an FTP to store this data?

Hi @rjd1234

To send an email of the data logs, the Backup (Global) can be used. For the screenshots, an Event (Alarm) Log will be used.

The Backup object is located within the Data/History tab. Here, create a new backup object.

Within the General tab, I set the trigger to my LB-0 bit and my File Source as a Historical Data Sampling object. This allowed me to choose the data sampling index I wanted to email.

Next, in the Output tab, I set the Backup Position to email.

Lastly, within the Email tab, I added the group of email recipients I want to receive the email.

For the screenshots, I created a new Event (Alarm) Log.

In the General tab, I set the read address to LB-20, as this will be my trigger to send the screenshot.

Lastly, within the Email tab, I enabled the condition Send when event triggered. This allows me to enter the recipients and attach a screenshot of a window using the option near the bottom of the popup window.

Now I can use LB-0 for emailing logs and LB-20 for emailing screenshots. Please let me know if you run into any issues.

Thank you Aaron. This is very helpful. A couple follow up questions:

  1. I would like to send both the log file and the screenshot on the same email. Is that possible?
  2. Is email the best method? Or would it be better to transfer the data to the cloud somehow?
  3. I would like to create a separate data log file for each batch rather than backup everything over a certain time period.

Hi @rjd1234,

  1. No, it’s not possible to send both the screenshot and data log within the same email yet. They will need to be sent in separate emails for now.
  2. The best method we would recommend is using a SQL database.
  3. To separate the data log files:
  • Navigate to the Settings of the Data Sampling object. Here, select the Customized file handling option. Then, click the Settings option.
  • In the example below, I set up my file creation to trigger when the LB-15 bit is activated and allows user input of a new file name at the LW-10 address.
  • Lastly, within my Backup (Global) settings, under the Output tab, I modified the Split by option to Customized file. This allows the emails to be separated by file name. Therefore, when a new batch needs to be started, I can trigger the LB-15 bit, enter a new file name, and then save the batch only.

Please let me know if you have any further questions or ideas for your project !

Hi RJD1234

It sounds like you’re exporting a report similar to one we’ve been trying to create. Would you mind sharing if your data is from different recipes that you run or if you run the same batch each time?

Pat