Object Oriented ctrl scripting

Discussion about recent product features & solutions!

Post Reply
3 posts • Page 1 of 1
Posts: 13
Joined: Tue Aug 04, 2015 6:17 am

Object Oriented ctrl scripting

Post by ivan141 » Wed Oct 07, 2020 3:21 pm

This subject does not concern a real bug or problem, more of a couple of wishes that I would like to relay to the dev. team.
Since I the O.O.P. features became available in WinCCOA's control scripting I find myself using then increasingly more often due to the
better structured code they allow.
With every new release I keep hoping for one or two features to pop up, but seeing as they haven't I though I might try dropping some
hints through this forum. [Dear Santa]

The following 2 features would be really nice to have:

-Access to built-in member functions of dyn/vector/string types when nested:
If I build a class that contains a vector<sometype>, and I make this vector public, there is no easy way to iterate the vector without copying it to an outside variable first, or adding some wrapper function around it's "count()" member function. This is because vectors do not have a dynlen equivalent function, and when you try to call instance.vector.count() to get the length, winccoa will throw an error : "Expression is not an array".
I dont quite understand why nested member functions I write myself are not a problem, but winccoa's very own member functions dont work for nested variables. This would allow for much cleaner code IMO.

-Some type of eventing for user built classes:
If I want to build user interfaces based on OOP ctrl classes, I have to resort to ugly workarounds to get any event-driven interactions going between my instances and my panels. It would be awesome if classes had an event that could be triggered by the class that can simply be connected to with uiConnect().
Another example would be scripts with lots of objects, the objects themselves can do a dpConnect() within their own context, but I still have to resort to polling the objects to check if something has changed within them.. Example: an item class connects to a datapoint with a regular dpConnect which updates the object. If I have a container class that wraps around the item classes I would like to notify this class whenever something changes.. what do I use (apart from polling)? Some callback mechanism that does not require datapoints (or panels) could be very useful.

TLDR: OOP control scripting is awesome, here are 2 suggestions to make it even more so.

User avatar
Posts: 2388
Joined: Tue Aug 24, 2010 5:28 pm

Re: Object Oriented ctrl scripting

Post by leoknipp » Tue Oct 13, 2020 1:10 pm

If you want to submit a feature request or if you have comments how to improve WinCC OA please get in contact with your common WinCC OA support.
The WinCC OA Portal can be used to share information and to discuss topics with other WinCC OA users.

Best Regards
Leopold Knipp
Senior Support Specialist

User avatar
Posts: 106
Joined: Wed Nov 12, 2014 7:04 am

Re: Object Oriented ctrl scripting

Post by Andorhal » Fri Oct 23, 2020 8:13 am

Hello Ivan.

Thank you for your suggestions and feedback on OOP.
We have put them in the backlog but as Leo said please use the official communication channel for Feature requests.

Kind regards

Post Reply
3 posts • Page 1 of 1