Unnecessary events in statistical functions

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
4 posts • Page 1 of 1
RudiKreiner
Posts:198
Joined: Mon May 16, 2011 2:10 pm

Unnecessary events in statistical functions

Post by RudiKreiner »

I am using WinCC OA V3.14, with patch level 16.
I have configured a statistical data point function to set Voltage 2 to be the average value of Voltage 2 Raw over the last 5 seconds.
I was surprised to see that the dp_function sets the time stamp of the averaged value to the beginning of the 5 second period being averaged, even with the delay parameter set to 0, so that it effectively represents the average over the next 5 seconds rather than the last 5 seconds.
That gives the impression that the average function is looking into the future, which doesn't really make sense to me.
I hope that loading an attachment works, then this can be seen in the attached trend.

Is this behavior intentional? I couldn't find anything in the help document describing it.

I saw that delay, is defined as an integer, so I though I would try changing its value to -5 to compensate.
That blocked up the event manager completely and I had to restart the whole project to get it running again, so that did not have the desired effect. Image

What I really wanted to report is that the statistical function creates an event at every interval even if the value does not change.
I actually want to avoid that, and thought that I could use the removeDoneCB() function to do that,
but to do that I would need to know the actual value of the datapoint and I cannot access that in its dp function.

Does anyone know I can suppress the events generated by dp_fct statistical functions if there are no value changes?
Attachments
Dp_Function.PNG

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: Unnecessary events in statistical functions

Post by leoknipp »

The statistical function works correctly. Independent of the delay the timestamp which is set is always the begin of the calculation interval.
With the delay you can only define that the calculation shall be delayed, e.g. to ensure that all value for the calculation period are already available in the system.

In which interval do you receive the raw values?
Is it really necessary to calculate an average value for 5 seconds?
E.g. If the input value is received every second you will have only 5 values used for the average calculation.

You can use the config entry dpFuncOldNewCompare for the Event Manager to activate an old/new comparison for dp functions.
If you do not want to save the values in the database you can use the smoothing options in the _archive config.

Best Regards
Leopold Knipp
Senior Support Specialist

RudiKreiner
Posts:198
Joined: Mon May 16, 2011 2:10 pm

Re: Unnecessary events in statistical functions

Post by RudiKreiner »

Thanks for your prompt feedback, Leopold.

I receive the raw values every second from a driver that has the smoothing config set, so I get no events if the value does not change.
Maybe I should remove the smoothing config to ensure that I always get 5 events in 5 seconds.
Any yes, I want to generate the average at that rate.

I wasn't aware of the dpFuncOldNewCompare setting for the event manager.
It looked like it might help with my problem so I added it to my config file like this:

[event]
dpFuncOldNewCompare


then restarted the project, but with no effect.

I suspect that this feature only works for dp_fct of the type "DPE connection" but not for "Statistical function",
because only "DPE connection" also has the feature to do old/new comparision for an individual datapoint,
but the checkbox for this is not available in para for "Statistical function"
Can you please confirm this?
If that is true, then it would definitely be nice to have that feature for statistical functions too, but maybe there are good reasons why it is not implemented.

Thanks for the tip regarding the smoothing in the archive config, but that is not the reason I am investigating this.
We have other applications connected to these datapoints, I guess we could add an old/new comparison feature to them, if nothing else works.
Another possibility would be to create intermediate datapoints with the statistical function, then give the final datapoints a "DPE connection" dp_fct with old new comparison.
I'm quite sure that would work, but not really very elegant is it?

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: Unnecessary events in statistical functions

Post by leoknipp »

I have tested it and the old/new comparison is not made for statistical functions.
If a statistical function is used you expect to have a value in the defined interval, therefore possibly the old/new comparison is not implemented.

Using an additional element just to have an old/new comparison is not the best solution, depending on the amount of dp elements which will use this implementation.
If there are quite a few you can use it.
When there are a lot of elements having additional elements with dp functions a lot of additional messages will be sent every 5 seconds.

Best Regards
Leopold Knipp
Senior Support Specialist

4 posts • Page 1 of 1