Page 1 of 1
Is it possible to dpQuery datapoint descriptions?
Posted: Mon Aug 06, 2018 10:34 am
by Lbortolozzo
Hi All,
Is it possible to do a dpQuery to return the description, comment, or to just return the datapoint name of the queried datapoints?
I would like to monitor the number of datapoints that match a certain query using a dpQueryConnectAll and then trigger some action when the total number changes. Is this possible? The query would ideally connect to something that rarely changes?
Using 3.15 P013.
Thanks.
Re: Is it possible to dpQuery datapoint descriptions?
Posted: Mon Aug 06, 2018 11:41 am
by adaneau
Hi,
I think you cannot. Query is only for attributes saved in RAIMA and description is not, it is inside the dpidentification...
Maybe you can use :
int dpGetAllDescriptions(dyn_string &dps, dyn_string &descriptions [, string descriptionFilter [, string dpeFilter [, int mode]]]);
And make a dpConnect on the result.
BR
Alex
Re: Is it possible to dpQuery datapoint descriptions?
Posted: Mon Aug 06, 2018 1:20 pm
by leoknipp
In the result of a dpQuery/dpQueryConnect you always get the name of the datapoint element in the first column of the result table.
Filtering for the comment in the query is not possible.
If you just want to know if the number of results changes you probably can do the query in a defined interval (e.g. once a day) and compare the number of results.
Then you do not have to make a queryConnect.
Best Regards
Leopold Knipp
Senior Support Specialist
Re: Is it possible to dpQuery datapoint descriptions?
Posted: Tue Aug 07, 2018 11:38 am
by Gertjan van Schijndel
Perhaps you should consider upgrading to 3.16. It has a new function 'sysConnect', which allows you to connect to dpDescription changes. The callback function could be used to update the total number.
Re: Is it possible to dpQuery datapoint descriptions?
Posted: Tue Aug 07, 2018 12:10 pm
by Lbortolozzo
Thank you for your replies.
I cannot upgrade to 3.16 on my current project, but sysConnect sounds like a useful function to use in the future.
As it's for a table on a graphic, I don't think it's worth doing an interval check since it's unlikely to be open for a large amount of time. Though I will try that method for other problems.
Best Regards,
Louis