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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
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
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.
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.
Thanks you, you have given me a really good example... Great!