Siemens S7 error DB daily report

leem2209

Lifetime Supporting Member
Join Date
May 2015
Location
Wirral, UK
Posts
210
Can someone give me some pointers....

I'd like to generate a daily report of all the alarms, warnings and messages generated by a machine, and have it email me and others.

There's various reasons behind this, the WinCC advanced doesn't save all historic messages, only the errors (I think) and sometimes the warnings and the messages can be handy to see too when looking into a fault.

So it would be nice to have a list generated daily and emailed, which shows the time of the alarm/warning/message etc. I'm thinking of MS Excel for this?

The errors are all conveniently contained in a single datablock (Siemens S7) so it would be a case of somehow sending the datablock info into a PC system and have something monitoring it and each time a bit in the DB is TRUE, mark it up on the Excel sheet.

I'm sure this is possible but not sure where to start with it!

As always, many thanks in advance.
 
Can someone give me some pointers....

I'd like to generate a daily report of all the alarms, warnings and messages generated by a machine, and have it email me and others.

There's various reasons behind this, the WinCC advanced doesn't save all historic messages, only the errors (I think) and sometimes the warnings and the messages can be handy to see too when looking into a fault.

Why do you think WinCC doesn't save all historic messages?

I would create 3 message archives in WinCC flexible, as file format CSV (ASCII), one for alarms, one for warnings, and one for messages. Set the message archive for the message classes you have.

I've done a project with a MP277. where these message archives are stored on the mmc flash card. And each day these message archives are copied to a USB stick. On the USB stick there is automatically a directory hierachy created (year/month/day) where the messages archives are copied to. I am copying also variable-archives in this way. Works absolutely without problems since many years.
 
Why do you think WinCC doesn't save all historic messages?

I would create 3 message archives in WinCC flexible, as file format CSV (ASCII), one for alarms, one for warnings, and one for messages. Set the message archive for the message classes you have.

I've done a project with a MP277. where these message archives are stored on the mmc flash card. And each day these message archives are copied to a USB stick. On the USB stick there is automatically a directory hierachy created (year/month/day) where the messages archives are copied to. I am copying also variable-archives in this way. Works absolutely without problems since many years.

We aren't using WinCC Flexible on this particular machine. We have PC based systems running WinCC (Currently V6.4 I think - working on an upgrade route). When you go into the error history, it is limited and only goes back a few days.

But, there are other systems with ProTool/WinCC flexible HMI's that I may be able to do as you have suggested. But would there be any way to forward those error logs to a PC instead of daily collecting off a USB? I'm not in every day and doing this over 10 machines would be timely.
 
http://accautomation.ca/heres-is-a-quick-way-to-send-email-text-messages-from-the-plc/

http://accautomation.ca/how-to-send-email-to-smtp-server/

http://accautomation.ca/creating-a-hmi-login-screen-on-advancedhmi/

Here are a few links to help you get started.
Break the task down into smaller sections.
1 - Email from the PLC or Software Collection
2 - Establish DB logging
3 - Communicate to the PLC via protocol

Hope this helps you out,
Regards,

Thanks Gary, looks like some good informations here to look over. I will have a good read over tomorrow for a better idea (second link lost me a little - new territory! Third link right over my head!)

In the first link, the programming is done on a Do-More PLC? I've not heard of them before. We have Siemens and Omron CPU's in our plant and would need to utilise those. As far as I am aware, they do not have any sort of emailing functionality in them.

Maybe worth sending data to a new PLC with this functionality?
 
We aren't using WinCC Flexible on this particular machine. We have PC based systems running WinCC (Currently V6.4 I think - working on an upgrade route). When you go into the error history, it is limited and only goes back a few days.

WinCC V6.2 was the latest of the 6.x series I think.
If you are using the standard Alarm OCX control: this is limited to display a maximum of 1000 entries. If you want to see older entries before the last 1000, you have to set an appropriate SQL filter.
Providing that you have setup the alarm logging archive so that it contains older data.

Since WinCC 7.0 the alarm control can export the displayed messages as CSV file.
I haven't done automatic export with WinCC. Maybe using the Report Designer to create reports from the Alarms is easier to handle (pdf?). Sending an email from a PC based system is rather simple.

Edit:
You can also get the alarm data from the SQL database. But the name of the alarm-logging runtime database changes sometimes (additional timestamp). So dumping the SQL database and emailing the data should also be possible.
 
Last edited:
WinCC V6.2 was the latest of the 6.x series I think.
If you are using the standard Alarm OCX control: this is limited to display a maximum of 1000 entries. If you want to see older entries before the last 1000, you have to set an appropriate SQL filter.
Providing that you have setup the alarm logging archive so that it contains older data.

Since WinCC 7.0 the alarm control can export the displayed messages as CSV file.
I haven't done automatic export with WinCC. Maybe using the Report Designer to create reports from the Alarms is easier to handle (pdf?). Sending an email from a PC based system is rather simple.

Edit:
You can also get the alarm data from the SQL database. But the name of the alarm-logging runtime database changes sometimes (additional timestamp). So dumping the SQL database and emailing the data should also be possible.

It may be worth looking into further after the WinCC upgrade then... currently that is out of my hands and has gone to Siemens Manheim (was some rather complicated database servers and Excel integration utilised that isn't "standard" and even our Siemens representatives struggled with.)

PS we are running WinCC v6.0 SP4
 
Last edited:
K1WH8FW-SuzlQoQoVOIg1b-WsWcF0AadqR_7TEJH0js


I've created a simple diagram to hopefully better show what I am after.

The machines utilise a datablock for errors and the local WinCC stations monitor this DB and when the error bit is active, triggers the WinCC tag and displays the error.

I want to also monitor the same DB and as an error becomes active, it adds the error to a daily report, along with the time and date. This can then be utilised later on or emailed as required.

I also want to be able to run a query each month to see what the top 5 errors were for each machine and then use this data as a focus for activities for machine improvement.

I'm struggling to find any sort of solution... I've come across some info on using an OPC server to get the data from the PLC to the data PC. But then how to record this data, how often, how to create reports, etc.
 
K1WH8FW-SuzlQoQoVOIg1b-WsWcF0AadqR_7TEJH0js


I want to also monitor the same DB and as an error becomes active, it adds the error to a daily report, along with the time and date. This can then be utilised later on or emailed as required.

I also want to be able to run a query each month to see what the top 5 errors were for each machine and then use this data as a focus for activities for machine improvement.
You can also use the WinCC alarm control for this, see option "hitlist". It shows you which alarms came how often in the desired time area.
The Siemens website has some samples of what you can do with this (calculate availability, MTBF and so on).
 
You can also use the WinCC alarm control for this, see option "hitlist". It shows you which alarms came how often in the desired time area.
The Siemens website has some samples of what you can do with this (calculate availability, MTBF and so on).

Thanks Thomas (y)
 
I can tell you what I did in WinCC flexible 2008...

I used VB Script to copy the alarms from the alarm log database (SQL) to a separate SQL Server (MS SQL Standard 2014) in order to keep the alarms permanently. I created an VBA-driven Excel document for customized reporting. Emailing was one alarm at a time, which is a built-in feature of WinCC flexible (with Sm@rtService license add-on).

I was looking into the emailing feature of SQL Server 2014, and it looks possible to schedule emails with SQL data in it. I might even use this feature in the future.

You'll need some pretty good experience with SQL and VBA to accomplish this.

As long as WinCC V6 allows access to the database via C or VB script, it should be possible to do the same.
 
Easiest is to log the data into an historian. Then have another application pull the data from the historian once a day, assemble the report and then send the email.

I'm going to do the exactly same thing as you, except that I will not email it, just present the info on a website.

I'm going to go S7 to Siemens OPC server that the client already have. From there it is logged in another server running a process historian they also have. And I'll fetch the data from there once a day and make the report.

If I didn't have anything I'd look for something that can log data from S7 systems into a PC and then send email from there. You could use modbus, s7 communication if you wanted to do it yourself. Here is an example that Garry posted complete with a video. He is logging data from another PLC using modbus tcp into a PC.

http://www.plctalk.net/qanda/showthread.php?t=102051

I don't believe that WinCC is the right tool for this job at all. Separate presentation (HMI) from higher level logging and IT tasks. If you pull data like I propose, WinCC is not involved in the process at all.

I also recommend avoiding Excel for this task. It is not up to background tasks that needs to work without operator assistance. It's actually in Microsoft's recommendation to avoid using it for tasks like this as they themselves say that the Office applications aren't robust enough to use in servers and similar applications.

Just make a html table or something like that. It will produce a very nice email. I have several applications doing exactly that and they have been running 24/7 for many years. But they are not logging alarms which I intend to do, similar to you.
 
Last edited:
There is also another simpler option you might want to explore. You can put a CP 343-1 Advanced version module in your siemens system.

The advanced (IT) version can also act as an ftp server and also send emails. So accumulate the errors in your siemens PLC program and put them in a DB. Either send this an email (I haven't used this function) or configure it as an ftp server. Then you have another program connecting to the CP 343-1 Advanced ftp server and fetching the DB, rearrange it for a nice looking email and send it. This I have done on a few systems and it works very well.
 

Similar Topics

Hi everyone, i have a Siemens S7-300 Cpu 314C-2 DP with several cards of i/o and servos my laptop has TIA version 16 and 17 loaded and...
Replies
4
Views
132
Hi, At the moment, If the user fails to provide a valid username/password, the image attached appears "Invalid password or user name. Logon has...
Replies
12
Views
1,567
Good Afternoon. I am having a problem going online with S7-400. Attached is the error that I am getting. I have looked at the help file but the...
Replies
7
Views
1,759
I have a customer who had a faulty Siemens OP7. They sourced a replacement. They have the original program. I downloaded the program to the...
Replies
10
Views
2,528
Hello Friends I have this error in a MP277 8" Touch. The "\Flash\Simatic\PDATA.FWX" configuration file could not be loaded. The application...
Replies
4
Views
4,754
Back
Top Bottom