About getting _address of DP config

Find and share HowTos to various installations / configurations!
9 posts • Page 1 of 1
kiducduc
Posts:7
Joined: Tue Nov 28, 2017 3:18 am

About getting _address of DP config

Post by kiducduc »

Hello

I'm making WinCC OA API Manager with C++ and I have some problem.

When I get the _address.._reference and _address.._active, _address.._drv_ident by function that is, dpQuery or dpQueryConnectSingle or dpGet,

The Manager which is compiled in Visual Studio 2013 (I use WinCC OA 3.14) is not function collectly (The manager status turns to abnormal(number 3)).

The query used in function is "SELECT '_original.._value', '_address.._reference' FROM '*.PVRAW' WHERE _DPT = \\"AI\\"".

So, I tested that other configs like "SELECT '_original.._value', '_distrib.._driver' FROM '*.PVRAW' WHERE _DPT = \\"AI\\"", and It work's well.

I think the configs of _address have some problem. (I havn't used another WinCC OA Version, only 3.14)

Because, even though dpQuery in WinCC OA Ctrl function don't return _address configs value. (It returns Null)

Thank you.

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

Re: About getting _address of DP config

Post by leoknipp »

With a query function (dpQuery, dpQueryConnectSingle, dpQueryConnectAll) you cannot read the attributes for the _address config.
The _address config is only known by the driver and the query is handled by the Event Manager.

Best Regards
Leopold Knipp
Senior Support Specialist

kiducduc
Posts:7
Joined: Tue Nov 28, 2017 3:18 am

Re: About getting _address of DP config

Post by kiducduc »

Thank you for your reply.

As you mentioned, I got it that dpQuery can't return _address config.

And I checked that dpGet can return _address config in API manager.

However, when I try to get _address by dpGet of datapoint without _address config, the API manager goes to die.

So, my question is

1. How can I know which datapoint don't have _address config in API Manager.

2. Is there datapoint related to address finder function like _DriverCommon.AD.HWMast/DPMatch in API Manager.

Thank you.

Gertjan van Schijndel
Posts:634
Joined: Mon Aug 02, 2010 10:37 am

Re: About getting _address of DP config

Post by Gertjan van Schijndel »

JONGYUN KIM wrote:
1. How can I know which datapoint don't have _address config in API Manager.
2. Is there datapoint related to address finder function like _DriverCommon.AD.HWMast/DPMatch in API Manager.
1. Each config has a 'type' attribute if this does not have the value 'DpConfigNrType::DPCONFIGNR_NOCONFIGNR', then this config exists. But an address config cannot exist without distrib config, so normally datapoint element with a distrib config also have an address config.
2. No idea what you mean with 'address finder', but you could also use these datapoints in an API manager.

kiducduc
Posts:7
Joined: Tue Nov 28, 2017 3:18 am

Re: About getting _address of DP config

Post by kiducduc »

Gertjan van Schijndel wrote:
1. Each config has a 'type' attribute if this does not have the value 'DpConfigNrType::DPCONFIGNR_NOCONFIGNR', then this config exists. But an address config cannot exist without distrib config, so normally datapoint element with a distrib config also have an address config.

I tested by below code, but whatever there is config or not, getConfig() don't return 'DpConfigNrType::DPCONFIGNR_NOCONFIGNR'. (_address, _distrib config)

CharString dp = "SVR-L5-ELEC-M:HVCB_MAIN_POWER.PVRAW" // example dp
CharString str = dp + ":_address";
DpIdentifier dpid;
Manager::getId(str, dpid);
cout

siemens_dva
Posts:11
Joined: Tue May 03, 2016 10:23 am

Re: About getting _address of DP config

Post by siemens_dva »

In my project, we read the name of the connection from a datapoint element.
I'm running the following query which so far seems to work fine.

Code: Select all

  dyn_dyn_anytype tab;
  dpQuery("SELECT ALL '_address.._reference' FROM '" + dpSubStr(dpe, DPSUB_SYS_DP_EL) + "'", tab);
If I understand Leopold correctly this is not supported? What is the correct way to read the address reference from a datapoint element.

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

Re: About getting _address of DP config

Post by leoknipp »

Gertjan van Schijndel wrote:
But an address config cannot exist without distrib config, so normally datapoint element with a distrib config also have an address config.
This information is not correct.
If the _address config is related to driver number 1 there is no need to configure a _distrib config.
When configuring an _address config with the PARA module the _distrib config is also created for addresses related to driver number 1.

Best Regards
Leopold Knipp
Senior Support Specialist

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

Re: About getting _address of DP config

Post by leoknipp »

Don von Allwörden wrote:
In my project, we read the name of the connection from a datapoint element.
I'm running the following query which so far seems to work fine.

Code: Select all

  dyn_dyn_anytype tab;
  dpQuery("SELECT ALL '_address.._reference' FROM '" + dpSubStr(dpe, DPSUB_SYS_DP_EL) + "'", tab);
If I understand Leopold correctly this is not supported? What is the correct way to read the address reference from a datapoint element.
With a dpGet() you can get the _address.._reference for a datapoint element. Before you read the _reference attribute you should check if an _address config exists by reading the _type attribute.

Best Regards
Leopold Knipp
Senior Support Specialist

kiducduc
Posts:7
Joined: Tue Nov 28, 2017 3:18 am

Re: About getting _address of DP config

Post by kiducduc »

Leopold Knipp wrote:
With a dpGet() you can get the _address.._reference for a datapoint element. Before you read the _reference attribute you should check if an _address config exists by reading the _type attribute.
In API Manager,
with dpGet(...:_address.._type), I can know that whether _address exists or not.

9 posts • Page 1 of 1