How can i get all datapoints with an achive config

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
7 posts • Page 1 of 1
pke-smx
Posts:3
Joined: Fri Jan 20, 2017 10:57 am

How can i get all datapoints with an achive config

Post by pke-smx »

Is it possible to get all datapoints with an archive config?

It tried following code:

Code: Select all

main()
{
  dyn_dyn_anytype dda;
  
  dpQuery("SELECT '_archive.._type' FROM '*' WHERE '_archive.._type' != "+DPCONFIG_NONE, dda);
  
  DebugN("Dps",dynlen(dda));
}
The result is not the expectet one.

I get all datapoints and not the datapoints with an archive config.

Is there a other possibility? Maybe in API?
And is it possiple to connet to the _archive.._type

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

Re: How can i get all datapoints with an achive config

Post by leoknipp »

Getting the information for the _archive config with a dpQuery() is not possible. A dpQuery() is answered by the event manager and the information for the _archive configs is only known in the data manager.
Therefore doing a dpConnect() for the _archive config is also not possible.

If you are using the value archives (HDB) you can get the information for the archived dp elements using the Statistics function for the archives.
Another possibility would be to make an ASCII export for the _archive config and to parse the file.

Why do you want to know which elements have an _archive config?
Why shall a connect be made for this config?

Best Regards
Leopold Knipp
Senior Support Specialist

pke-smx
Posts:3
Joined: Fri Jan 20, 2017 10:57 am

Re: How can i get all datapoints with an achive config

Post by pke-smx »

Ahhh ok

We do not use the common wincc oa archives.
We have our own archiving. And therefore we just want to use the _archive.._type Attribute.
If the _archive.._type is not null write the datapoint value into our mysql database.

So we need a new plan
thanks for the fast reply

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

Re: How can i get all datapoints with an achive config

Post by leoknipp »

In this case you could use another config, e.g. the _general config to store the information which elements need to archived.
The _general config can be used at queries.

Best Regards
Leopold Knipp
Senior Support Specialist

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

Re: How can i get all datapoints with an achive config

Post by RudiKreiner »

This may be a bit primitive but could be of help to you:

Make a list of all datapoints to test with a suitable wild card pattern, something like this:
dyn_string dps = dpNames("**");

Add the extension that says if an archive config is configured:
for (int i = 1; i

pke-smx
Posts:3
Joined: Fri Jan 20, 2017 10:57 am

Re: How can i get all datapoints with an achive config

Post by pke-smx »

I understand what you mean but dpConnect does also not work.

I think we will use the general config for our project.

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

Re: How can i get all datapoints with an achive config

Post by RudiKreiner »

I guess you are right on that. I just checked the description of dpConnect() in WinCC OA help, and it says that it is only possible to connect to configs that are managed by the event manager, which excludes the following: _archive, _address, _cmd_conv, _msg_conv, _smooth

It should work for the general config though, so I think you are on the right track. Good luck with that.

7 posts • Page 1 of 1