Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Object Oriented extensions for IEC61131 - Bernhard Werner

spfeif
2010-03-16
2017-01-31
  • spfeif - 2010-03-16

    Did anyone read this article from Bernhard Werner posted on the 3S Home web site? Great article.

    It seems there is a mistake in the article in figure 4 code. it was defined :

    Var
    Β MyRoom1 : LightRoom;
    Β MyRoom2 : LightRoom;
    Β MyRoomCtrl : ROOM_CTRL;
    end_var
    

    I believe it should be:

    Var
    Β MyRoom1 : LightRoom;
    Β MyRoom2 : Light2Room;
    Β MyRoomCtrl : ROOM_CTRL;
    end_var
    

    What do you think? In the example in figure 4 the outcome of calling MyRoomCtrl would have been the same with Room1 and Room2. The inheritance and polymorphism was skipped by not declaring Room2 as Light2Room. If have that wrong please explain.

     
  • TimvH

    TimvH - 2010-03-17

    I believe you are right. Both rooms implement the same interface ROOM, but off course the objective was to show that 2 different rooms can be declared and used as input for the ROOM_CTRL Function Block.

     
  • rahulnshinde - 2010-11-29

    Hi,
    Where can I find illustrations/examples on using OOPs extensions of Codesys.
    I need help understanding the usage of Interface, methods, property etc.
    What is IMPLEMENTS?

    And spfeif
    You mentioned
    "Did anyone read this article from Bernhard Werner posted on the 3S Home web site? Great article."

    Can you paste the link to this article. I tried to locate but no luck

    Some help would be really appreciated.

    Regards,
    Rahul.

     

Log in to post a comment.