Hello all,
WinCC OA 3.11-SP1 (inkl. P014, P016)
subject says all I think. that behavior is a bug, right?
br petr
dpElementType() on DPEL_TYPEREF returns DPEL_STRUCT
- peka
- Posts:19
- Joined: Wed May 15, 2013 4:46 pm
dpElementType() on DPEL_TYPEREF returns DPEL_STRUCT
- mpoint
- Posts:49
- Joined: Thu Oct 28, 2010 11:28 am
Re: dpElementType() on DPEL_TYPEREF returns DPEL_STRUCT
Just a guess here, but since a type reference basically inserts one type into another type, could it be that DPEL_STRUCT is the element type of the root element of your referenced type? As far as I can tell, in a DP you cannot see the type reference; instead the referenced type is just a part of the referencing type.
- peka
- Posts:19
- Joined: Wed May 15, 2013 4:46 pm
Re: dpElementType() on DPEL_TYPEREF returns DPEL_STRUCT
Hello Markus,
i don't know how wincc oa is handling those dptreferences. maybe those are internal 'internals', virtuall dps or simply extends the designed dpt and copies the mp conigs (if used). but for sure the "physical" root-elemt of the typreference will be a DPEL_STRUCT due it points to another "dp" (or another 'real' datatype as int, real... if its possible in general).
I already thought about those internal implementations, but this is a dead end. dpt editor can also allocate the dpe's typ and i don't think it checks if each dpt is referenced inside the requested.
I also think i already used this func years ago (maybe it was dpGetDpTypeRefs or dpGetRefsToDpType).
Lucky me, i found another well know func (again) i can use handling my demand - dpTypeRefName(). Not nice cause i have to run multipe request in loop, but it will work.
Nevertheless, why html help offers the return value DPEL_TYPEREF if this never will happen.
br petr
i don't know how wincc oa is handling those dptreferences. maybe those are internal 'internals', virtuall dps or simply extends the designed dpt and copies the mp conigs (if used). but for sure the "physical" root-elemt of the typreference will be a DPEL_STRUCT due it points to another "dp" (or another 'real' datatype as int, real... if its possible in general).
I already thought about those internal implementations, but this is a dead end. dpt editor can also allocate the dpe's typ and i don't think it checks if each dpt is referenced inside the requested.
I also think i already used this func years ago (maybe it was dpGetDpTypeRefs or dpGetRefsToDpType).
Lucky me, i found another well know func (again) i can use handling my demand - dpTypeRefName(). Not nice cause i have to run multipe request in loop, but it will work.
Nevertheless, why html help offers the return value DPEL_TYPEREF if this never will happen.
br petr
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: dpElementType() on DPEL_TYPEREF returns DPEL_STRUCT
Hello,
as Markus Pointner has already described dpElementType() returns the datatype of the referenced element. If a dp-type is referenced which has more than one element you'll get as result DPEL_STRUCT otherwise the datatype of the element.
As we do not know what you want to do exactly we cannot tell you how it can be solved.
With the function dpGetDpTypeRefs() you can get the information which type references are configured at which element in the given datapoint type.
The function dpTypeGet() returns the complete structure of a dp-type. With the optional parameter includeSubTypes you can define if the type-references shall be resolved or if you want to get only the information which types are referenced.
Best Regards
Leopold Knipp
Senior Support Specialist
as Markus Pointner has already described dpElementType() returns the datatype of the referenced element. If a dp-type is referenced which has more than one element you'll get as result DPEL_STRUCT otherwise the datatype of the element.
As we do not know what you want to do exactly we cannot tell you how it can be solved.
With the function dpGetDpTypeRefs() you can get the information which type references are configured at which element in the given datapoint type.
The function dpTypeGet() returns the complete structure of a dp-type. With the optional parameter includeSubTypes you can define if the type-references shall be resolved or if you want to get only the information which types are referenced.
Best Regards
Leopold Knipp
Senior Support Specialist