WinCC Flexible log script help

Fiddeflygare

Member
Join Date
Mar 2009
Location
Värnamo, Sweden
Posts
10
Hi all.
I am a student that are taking courses in PLC programming. I have my internship at a company that uses Siemens STEP7 and WinCC Flexible. The problem is that we where thinking of creating a diagnostics log wich in case of a alarm would retrieve information from 15minutes before the alarm occured in a .csv log file and save the values retrieved in a new .csv file. This is made cause of helping diagnose problems and seeking the cause of certain alarms on the machine. Can anyone tell me the easiest way of doing this with a script? Especially how to make the script retreive the values in the normal datalog in the interval 0 to -15 minutes. Can you make the script search and retreive values by making it read the timestamps in a logfile?

Greatful for any help
/Fidde
 
Hejsan Fidde.

Let me try to grasp what you try to do.

You constantly log values to .csv files.
In case there is an alarm, you want to retrieve values from the logfiles from 15 minutes before the alarm was triggered, and then write the values into another .csv file.

I think that it could possibly be done.
But the purpose defeats me, as you could just keep the original log file, and for troubleshooting go back and check the values by comparing the time in a logfile for alarms only.
It is as if you dont think an operator can put 2 and 2 together, that he cannot figure out how to compare the information from two logfiles.

There is also a serious pitfall:
Do not execute scripts upon value change on many tags - such as if you execute scripts when one of many configured alarms are triggered.
There is a limit of max 20 active VBS scripts at one time.
If many alarms are triggered at the same time, or very shortly after each other (something that may well happen), it will cause a script buffer overflow. That again will probably crash the VBS scripting system altogether.
 
Hejsan! =)

Your grasping is correct!

The purpose is that if we get an alarm we can see the alarm number and the behaviour of variables prior to that specific alarm. The thougt is that we want read-out the information direcly instead of having 2 or more files open at the same time especially since the .csv file we retrieve the information from is not stopped when an alarm occurs. Therefor we want to get the information in a logfile for the specific alarm so there won't be any risk of possibly valuable information geting overwritten if there is no one there in time to get the information at the occurance of the alarm.

I do not know if i am making myself easier to understand or if i complicate everything :p.
The person who instructs me at my internship wanted me to investigate the possibility of creating such a log. We build specific purpose machines in a small scale and the function is foremost to one machine in our lab. We do not have operators in place around the clock as in a factory so if we go home and the machine is on and we get a failure/alarm we have a risk that the information in the log will be overwritten by the morning when we get back to work. That is the reason to why we would like to have a log for every alarm 15 minutes prior to the occurance of the alarm.

I am not sure but i think the script is supposed to be linked/activated by about 4 or 5 alarms tops. So i am hoping that it won't exceed the 20 VSB scripts activated limit.

Is it more understandeable now waht i mean or is it still like horseshit?? :p

Thanks for the response though it is appreciated. 🍻
 
Återigen hej !

I think you can setup dummy logfiles, and then use the system function CopyLog to copy from the real active log files to the dummy files. Then open the dummy log files.
You can make a couple of trend views for the process logs, and alarm view for the alarms, and then point them to the dummy log files. I think it will work. :)

As to the risk of losing data from one day back, then I am certain you just have to setup sequental logs, and make sure there are enough sequence files to not lose any data. I am certain you can keep data from months back. If it is a PC RT, then you dont have to worry about the amount of disk space. If it is a panel, then you may have to calculate how much is flash memory is required - but hey, this is also dirt cheap these days.

It is definitely better to try and make it work with the integral system functions, and avoid VBS if possible.
 

Similar Topics

Hi! I have a pretty awkward problem on my runtime system. It's connected to a s7-1200 and this s7-1200 calculate PartsPerMinute(PPM). Every time...
Replies
0
Views
1,207
Does anyone have any experience of Alarm Log (for Historical Data) on a Simatic Touch Panel? What I am trying to do is log history to MMC and...
Replies
0
Views
2,859
Hi all. I am trying smartservice for WinCC Flexible PC RT for the first time, and am doing some tests. When I want to connect to the webserver...
Replies
4
Views
2,263
I have a data log that is setup as a circluar log so the old data will fall off after the file gets so big. 99% of the time the log is getting...
Replies
2
Views
5,074
I am stuck with a Siemens HMI problem.... I am using WinCC Flexible version 5.1 and I have a Siemens MP277 HMI. I have developed an application...
Replies
1
Views
10,297
Back
Top Bottom