4/1/2025 2:50 PM | |
Joined: 7/11/2024 Last visit: 8/4/2025 Posts: 200 Rating:
|
Hello frogree I believe it is possible to configure the TON with a global DB inside the Main OB. You should check this video: TIA Portal: How to declare Timer Tag for IEC timer? Can you upload a screenshot of the timer declaration? Good luck! 🐸 |
Last edited by: JimHalpert at: 04/02/2025 07:02:58If this post has been useful, don't forget to rate it!😊 |
|
4/2/2025 6:58 AM | |
Joined: 2/24/2025 Last visit: 9/4/2025 Posts: 5 Rating:
|
Hi JimHalpert, Thanks for getting back to me. I have two questions: firstly, could you explain why it's bad practice? Secondly, I attached my timer declaration in STL for you as requested. I did what the video describes for my LAD implementation, nice to know I did it correctly. 🐸 Unfortunately I'm not sure where to go from here - I think I need a temp variable that points to the global DB somehow, but you can't have static tags in the main OB, or In/Out ones.
Hi 0_Einstein, I did read the programming guide, and "Using IEC timers and counters" in the help guide accessed via Tia Portal but to no luck. I've read all the documentation I can find too, which seems to imply I can do it. The problem is that the example in "Using IEC timers and counters" uses a static variable, declared as an IEC_TIMER within a FB (I assume you could pass a timer as an In/Out too). Mine is just an IEC_TIMER within a global data block which is passed directly as an input to the CALL of TON in the MAIN OB. The main OB doesn't have static variables, so I'm out of ideas! Attachmentscreenshots.zip (144 Downloads) |
Last edited by: frogree at: 04/02/2025 07:20:34 |
|
Follow us on