I have the following:
MAIN PANEL REF - lets call it MPR - which has a layout and within that layout it holds three EMBEDDED PANEL REFs - lets call these EPRs. The MPR was made "expandable", you can have 3-5 EPRs in it - it uses addSymbol to add the extra 1/2 EPRs. These are added to the layout, so the entire object "grows" to accommodate the extra buttons.
The only issue with the above is that those extra EPRs added with addSymbol, are actually added to the main panel, rather than the MPR, even though they reside in the layout within the MPR (which is a bit odd). This causes issues with referencing anything which is inside the EPR from the MPR level. Any shape within the original three EPRs I can easily reference using MPRName.EPRName.shapeName, but for the extra EPRs added via addSymbol I have to skip the MPRName and only use EPRName.shapeName. It's not a massive issue, but creates edge cases which I'd rather not cover, so is there a way to somehow add the extra EPRs so that they are embedded in the MPR and not the main panel? Also it can create some very odd behavior when you create two MPRs on the same panel and configure them both to have extra EPRs. Those extra EPRs will get added to the main panel and if you call them the same (which is easily done as you might assume they are within the MPR, so would be unique right?) and then try to reference them from the MPR level, WinCC OA will get itself in a pickle as it will have a panel with two PANEL REFs with the same name.
Cheers,
Tom
adding a PANEL REF inside a PANEL REF using addSymbol
- tpjctrl
- Posts:145
- Joined: Tue May 08, 2018 10:30 am
adding a PANEL REF inside a PANEL REF using addSymbol
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: adding a PANEL REF inside a PANEL REF using addSymbol
The function addSymbol() always adds references to the main panel. There is no function available to add a reference to a reference.
Best Regards
Leopold Knipp
Senior Support Specialist
Best Regards
Leopold Knipp
Senior Support Specialist
- tpjctrl
- Posts:145
- Joined: Tue May 08, 2018 10:30 am
Re: adding a PANEL REF inside a PANEL REF using addSymbol
Thanks for the confirmation Leo.