9/14/2021 7:27 PM | |
Joined: 1/11/2021 Last visit: 9/19/2022 Posts: 5 Rating:
|
Hello all. I am quite new to the programming side of things and have recently bought an s7-1200 kit. I would like to program a few watchdog-functions using the tonr timer. The timers are meant to record total run time in hours of a few motors and pumps with regard to service intervals. As I recall there is a way for the timer to retain its memory even after shutdown. Could anyone help me in this regard? I cannot seem to make it retain memory, it always starts from 0 after plc shutdown. Thank you in advance 🙏🏻 Best regards Alex ------------------------------------------------------------------------------------------ |
Last edited by: Jen_Moderator at: 09/15/2021 08:27:48New subject after splitting |
|
9/15/2021 11:38 PM | |
Joined: 1/11/2021 Last visit: 9/19/2022 Posts: 5 Rating:
|
Thank u @0_Einstein i will give that a try tomorrow.👍🏻 All the best.
|
9/16/2021 9:35 PM | |
Joined: 3/30/2020 Last visit: 8/19/2024 Posts: 4698 Rating:
|
Both RTM and RUNTIME are both possible solutions. The Run TIme Meter aims to give the ability to track the running hours of a device. It is not easy to work with but it built for the task to track over several hours. RUNTIME is the go-to instruction when needing to measure the cycle time between to process calls. It is meant to deliver accurate measurements to precision in us. This can be used to deliver a measurement of the scan cycle. Knowing the scan cycle time can be used to build a custom accumulation timer. That means some coding is required. There is also a design flaw in the RUNTIME instruction to be aware of. There is a discussion that uses the RUNTIME instruction to build a stopwatch. Be on the lookout for version 2. [https://support.industry.siemens.com/tf/ww/en/posts/165149/] A rough option is to have a timer run to a set time.. let us say 1s as example. Then have a retentive counter that counts the amount of 1s increments. This idea is less accurate, but is far easier to maintain. I am not sure setting the retention setting on an IEC_TIMER will be helpful. Better health. |
Activities of this user is voluntary. There is no obligation or liability placed on this user. Though optional, your 'please' and 'thank you' is highly valued. |
|
9/16/2021 10:03 PM | |
Joined: 7/7/2010 Last visit: 8/22/2024 Posts: 15105 Rating:
|
In another life I worked with a scheduling and business logic scheme that monitored many production related items, similar to the maintenance cycle timing you are seeking - in concept. When we tested (tried) using timers, the variation was horrible and nowhere close on any given PLC and across hundreds of them, the variation between PLCs day to day and production line to prod line was unbelievably awful. To make the accumulation work, we used the PLC clock 1s pulse to trigger everything. It was always very close even with PLCs known to have a minor amount of time-of-day clock drift. It was rather involved logic-wise, but it was very simple to understand (and explain). Each thing monitored had a set of retained values (tags) that progressively accumulated running time (as well as scheduled, not scheduled, changeover, idle, and down time). It worked by incrementing a "runtime seconds" counter on leading edge of the 1s PLC clock pulse. Continue with that until you reach whatever time range is needed to monitor for maintenance. On Siemens S7 PLCs, that group of logic would be a single FB, and each instance DB would manage the various monitored times (like a scheduled_iDB, notScheduled_iDB, and so on). As long as the PLC clock pulse is fairly close to 1sec, everything works great. It automatically handles without even trying the 2 annual time changes forward and backward for holiday/normal time. Only thing to consider is if the time drifts a lot and it is not getting time updates via NTP before it drifts more than 0.5s. However, for maintenance intervals, time drift is not an issue.
|
science guy |
|
This contribution was helpful to
1 thankful Users |
Follow us on