Thank you for your suggestion, but I was following the recommendations found in the manual:
CAUTION
A query with the SQL statement SELECT ALERT ..., must not be used because of performance reasons!
But your recommendation is for dpQueryConnectSingle()... I assume the performance reasons for ConnectALL are not valid?
Since 2 people have been tricked by the same statement in the manual, maybe we can change the CAUTION statement in the manual.
CAUTION
A query with the SQL statement SELECT ALERT ..., must not be used for the dpQueryConnectAll() function because of performance reasons! Consider using the function dpQueryConnectSingle().
Todd Malone
HMI CoC USA
Total Alarm Count
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: Total Alarm Count
Hello,
I had a look at the WinCC OA help for 3.14.
At the function dpQueryConnectAll() the information is given that SELECT ALERT shall not be used.
At the explanation for dpQueryConnectSingle() I cannot find this hint.
Therefore the help seems to be correct.
If you have found in another part of the help please tell us which chapter you have been looking at.
Best Regards
Leopold Knipp
Senior Support Specialist
I had a look at the WinCC OA help for 3.14.
At the function dpQueryConnectAll() the information is given that SELECT ALERT shall not be used.
At the explanation for dpQueryConnectSingle() I cannot find this hint.
Therefore the help seems to be correct.
If you have found in another part of the help please tell us which chapter you have been looking at.
Best Regards
Leopold Knipp
Senior Support Specialist
- tmalone
- Posts:192
- Joined: Mon Nov 22, 2010 11:21 pm
Re: Total Alarm Count
For completeness of this thread. Here is the agreed upon script:
Code: Select all
main()
{
dpQueryConnectSingle("AlertsHappening", TRUE, "", "SELECT ALERT '_alert_hdl.._prior, _alert_hdl.._act_state, _alert_hdl.._ackable, _alert_hdl.._sum' FROM '*' WHERE ('_alert_hdl.._sum' == 0)", 500);
}
AlertsHappening(anytype userData, dyn_dyn_anytype ret)
{
int i;
int Prio1, Prio2, Prio3, Prio4;
int P1State = 5, P2State = 5, P3State = 5, P4State = 5;
for(i=2; i