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

An En TON Function block in ladder diagram...

hcchin
2009-01-23
2009-01-24
  • hcchin - 2009-01-23

    I am quite new in codesys, Recently I have some problem with the TON function block which has the (EN input) in ladder diagram. After the timer t2 on, it trun off the K4 coil, this is normal but why the t2 Q output is still remained on??

    then I have to RST it. I have attached a screen shot for your reference.

    please advice, and is that any document to read about the "EN" function?

    IMG: TON with EN input.JPG

     
  • Ralph Holz - 2009-01-23

    The EN input of a FunctionBlock switches the execution of the code inside the FunctionBlock on or if it is FALSE off. That means if EN is FALSE the FunctionBlocks outputs behave like frozen. No executet code means no change at the output and no registriation of changing inputs.

    Regards

    Ralph

     
  • hcchin - 2009-01-23

    Dear Ralph Holz,

    Thanks for your explanation, now I understand. but what type of the application need to apply this EN function? for an example: using a timer with EN input. for what i know, after a timer is executed, it doesn't need to keep the output on if the K4 coil is Off.

     
  • ndzied1 - 2009-01-24

    Note each ladder rung is inherently two instructions:

    When the logic is true, it turns an output on
    When the logic is false, it turns an output off

    Our experience has been that when you put a TON block in ladder, you should use Insert /Function Block instead of Box with Enable. If you must use Box with Enable because of your version of the software, then do not put any logic before the enable.

    I believe the attached code will do exactly what you want. Note that in your example K4 is directly connected to t2.IN so you can use t2.IN anywhere you would have used K4 in your program.

    You can make a simple visualization for the rung I show below to test it for yourself.

    IMG: TON_Example.jpg

     
  • hcchin - 2009-01-24

    Thanks you, you have given me a really good example... Great!

     

Log in to post a comment.