I'm looking for a way to detect all(or part of) the SCADA important alarms-came by using 'dpQueryConnectSingle()', in order to trigger some advanced functions.
like this:
#####################
{
string qureyDpNames; // this is a very long string like "dp1,dp2,dp3,..."
string dpName; // single dp name.
int n;
for (......)
{
qureyDpNames = qureyDpNames + dpName + ",";
}
sDpQueryString = "SELECT ALERT SINGLE '_alert_hdl.._value', '_alert_hdl.._text' FROM '{"+ qureyDpNames +"}' ";
n = dpQueryConnectSingle("workCB", 0, "ident", sDpQueryString,500);
....
}
workCB()
{
......
}
####################
let's assume my SCADA system has more than 2000 datapoints (with alert config) which need to be detect, the qureyDpNames string length is very long. Then, the logviewer prompt the doQuery is larger than 32k size and terminates.
Should I reduce the qureyDpNames string length ? Or is there a better way?
Is there a limitation in using dpQueryConnectSingle?
- lizhigang
- Posts:2
- Joined: Wed Mar 12, 2014 9:28 am
Is there a limitation in using dpQueryConnectSingle?
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: Is there a limitation in using dpQueryConnectSingle?
Hello,
please provide the information which PVSS- or WinCC OA version you are using.
In the past we had some limitations concerning the maximum size of string variables. As fas as I know this limitation does not apply to new versions.
If you want to get the alerts for all or a list of dp-elements (which have an _alert_hdl-config) in your project you can use wildcards in the FROM-statement. There is no need to specify every dp-element in the FROM-clause.
Another possibility would be to use a datapoint group where the elements are configured. At the query only the datapoint group is passed at the FROM-statement.
Best Regards
Leopold Knipp
Senior Support Specialist
please provide the information which PVSS- or WinCC OA version you are using.
In the past we had some limitations concerning the maximum size of string variables. As fas as I know this limitation does not apply to new versions.
If you want to get the alerts for all or a list of dp-elements (which have an _alert_hdl-config) in your project you can use wildcards in the FROM-statement. There is no need to specify every dp-element in the FROM-clause.
Another possibility would be to use a datapoint group where the elements are configured. At the query only the datapoint group is passed at the FROM-statement.
Best Regards
Leopold Knipp
Senior Support Specialist
- lizhigang
- Posts:2
- Joined: Wed Mar 12, 2014 9:28 am
Re: Is there a limitation in using dpQueryConnectSingle?
I'm using a very old version 2.xx. I'm trying to add a function on it.
The version is stable, enough for the normal operation. It's unnecessary to update to new one. I will try the new method you mentioned.
Thanks for your help.
The version is stable, enough for the normal operation. It's unnecessary to update to new one. I will try the new method you mentioned.
Thanks for your help.