Industry Online Support
Technical Forum
12/27/2012 5:27 PM | |
Joined: 1/28/2009 Last visit: 10/26/2024 Posts: 6852 Rating: (1365)
|
Hello, If you have problem with using timers in a function block to have it reusable, I can suggest 2 options: 1- Using IEC timers with multiple instance capability of Function blocks How do you create and update multiple instances? 2-Use timers as parameters of FB See my solution here as a very simple implementatuion here: [code] FUNCTION_BLOCK FB 1 TITLE = VERSION : 0.1 VAR_INPUT zeit1 : TIMER ; tr1 : BOOL ; END_VAR VAR_OUTPUT aus1 : BOOL ; aus2 : BOOL ; END_VAR VAR zeit2 : "TON"; END_VAR BEGIN NETWORK TITLE = CALL #zeit2 ( IN := #tr1, PT := T#10S, Q := #aus1); A #tr1; L S5T#10S; SF #zeit1; NOP 0; A #zeit1; = #aus2; END_FUNCTION_BLOCK[/code] Best regards Hamid Hosseini |
Follow us on