When I extend for example the ETrig block I have to manually add the method _Execute(); in my implementation.
This isnt explained good enough in the help documentation..
Hi,
I think it's because it's not mandatory to create an _Execute() method..it's just a pratice to encapsulate the body of the base FB.
You can get the same result by calling SUPER^() in the FB that extends the base FB.
Actually is what you find in the "template FB" if you create a library!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That was nice when creating a library.. But if you just want to take benefit of the CBML in your regular program I still think it should be explained more clearly in the docs so that a PLC programmer lacking basic OO skills still can take benefit of these blocks as they are really useful.
All that is really needed is to make the code snippet in the example larger so one could se the call of the SUPER^() and a short text explaining why.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I couldn't agree more.
As a suggestion; maybe it would be possible to automatically add the SUPER^() call with a short comment when extending a CBML block? This would even save dredging through the documentation.
Best regards from Emden
Fil
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When I extend for example the ETrig block I have to manually add the method _Execute(); in my implementation.
This isnt explained good enough in the help documentation..
In the online help for example:
https://help.codesys.com/webapp/yZZoqaS ... n=3.5.15.0
Under the bold text: Using inheritance for creating a new function block MC_MoveAbsolute extending CBML.ETrig
As many PLC programmers is lacking OO skills I think its important that this documentation is updated with a clearer example.
Hi,
I think it's because it's not mandatory to create an _Execute() method..it's just a pratice to encapsulate the body of the base FB.
You can get the same result by calling SUPER^() in the FB that extends the base FB.
Actually is what you find in the "template FB" if you create a library!
That was nice when creating a library.. But if you just want to take benefit of the CBML in your regular program I still think it should be explained more clearly in the docs so that a PLC programmer lacking basic OO skills still can take benefit of these blocks as they are really useful.
All that is really needed is to make the code snippet in the example larger so one could se the call of the SUPER^() and a short text explaining why.
I couldn't agree more.
As a suggestion; maybe it would be possible to automatically add the SUPER^() call with a short comment when extending a CBML block? This would even save dredging through the documentation.
Best regards from Emden
Fil