alertGetPeriod() function returns nothing

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
4 posts • Page 1 of 1
treshnikov
Posts:16
Joined: Tue Nov 12, 2013 7:11 am

alertGetPeriod() function returns nothing

Post by treshnikov »

Hello.

I have a problem with alertGetPeriod() function.

The function returns nothing, but I can see alarm messages on AES Rows component.
Link for download project - https://dl.dropboxusercontent.com/u/203 ... ayaHPP.zip

Image
Image

Version WinCC OA - 3.11

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

Re: alertGetPeriod() function returns nothing

Post by leoknipp »

Hello,

the same question was noticed by one of your colleagues in the Siemens support database.
I had a look at it right now.

The problem is that a limit for historical alert requests is reached and therefore you do not get a result.

Here is the answer to your questions, the same information got your colleague:
I copied the project and started the function at the panel.
Before calling the script I modified it to call the function getLastError() after the dpGetPeriod() to see if an error occured.

dyn_errClass deC_err;

int res = alertGetPeriod(
t1,
t2,
alertTimes,
counts,
":_alert_hdl.._text", dpnames, alarmTexts,
":_alert_hdl.._ack_state", ackState1, ackState2,
":_alert_hdl.._ack_time", ackTime1, ackTime2,
":_alert_hdl.._alert_color", alertColor1, alertColor2);

deC_err = getLastError();
if(dynlen(deC_err) > 0)
throwError(deC_err);
else
DebugTN("dynlen result",dynlen(alertTimes));

With this modification you get the following error:
WCCOAui (1), 2014.06.02 15:11:08.257, IMPL, SEVERE, 54, Unexpected state, DataManRequestHandler, constructAnswerMsg, request returns an error (too many values?)

An explanation for this log-message can be found in the ETM Portal --> FAQ --> Log-Messages:
https://portal.etm.at/index.php?view=it ... &Itemid=54

Best Regards
Leopold Knipp
Senior Support Specialist

treshnikov
Posts:16
Joined: Tue Nov 12, 2013 7:11 am

Re: alertGetPeriod() function returns nothing

Post by treshnikov »

Thank you for quick answer.
Now I know how to work properly with this function.
Indeed, the problem was that the function returns a lot of records.

But I was a little confused, because alertGetPeriod() as a result returned zero and in the documentation was written:

Function alertGetPeriod()
Returns 0, in the event of a failure returns -1.

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

Re: alertGetPeriod() function returns nothing

Post by leoknipp »

The return code only gives the information if the syntax of the function was correct and if the command was started.
It does not give an indication if the result is correct. As described in the online help you have to use the function getLastError() to get the information if an error occured when trying to read data.

Best Regards
Leopold Knipp
Senior Support Specialist

4 posts • Page 1 of 1