CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Fri Oct 18, 2019 7:25 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: OO: Extending FB_Init
PostPosted: Thu Nov 14, 2013 10:25 pm 
Offline

Joined: Mon Aug 05, 2013 1:29 pm
Posts: 12
I have a base class that I'd like to extend such that the subclass has extra parameters in its constructor.

For the sake of brevity, I'll skip the class definitions and jump straight to the object declarations - I think it gets my point across:

Code:
A : BaseClass (parameter := myParameterValueForA);
B : BaseClass_Specialization_1 (parameter := myParameterValueForB, specializedParameter := mySpecializedParameterForB);

However, CODESYS doesn't like the definition of BaseClass_Specialization_1.FB_Init because it doesn't match BaseClass.FB_Init. This is a standard thing to do with other OO languages, and I'm trying to figure out if I'm just missing something or if it's not supported.

Any thoughts / suggestions?


Top
   
PostPosted: Fri Nov 15, 2013 9:39 am 
Offline

Joined: Thu Aug 04, 2011 11:16 am
Posts: 86
Hello,
unfortunately CoDeSys does not support overloading.


Top
   
PostPosted: Mon Nov 18, 2013 11:38 pm 
Offline

Joined: Mon Aug 05, 2013 1:29 pm
Posts: 12
Thanks, I was afraid that might be the case. Pity, that is quite a restriction for working with class hierarchies. I can understand not supporting overloading for regular methods, but for constructors it strikes me as kind of a big deal.

Maybe it will turn up in future versions...


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited