scotty134 Posted June 28, 2022 Report Posted June 28, 2022 Hello, I need to cound uptime on servo motors. I though to use AccumulationTimer and have ET as retain. Unfortunately, AccumulationTimer resets ET after each power loss. Is it a simple way to count uptime on servo motors without making extra logic? Regards, Scotty
pturmel Posted June 28, 2022 Report Posted June 28, 2022 50 minutes ago, scotty134 said: without making extra logic I don't know what you expect, but if the built-in feature doesn't do what you need, how would you avoid extra logic? What precision you need dictates how complex the alternate logic is. Consider monitoring the RTC's seconds. Whenever it changes, and the servo is on, increment a DINT register. Make sure that DINT register is set to retain its value.
photovoltaic Posted June 28, 2022 Report Posted June 28, 2022 ET is constantly overwritten. Your value is indeed being retained but upon the first scan it is overwritten. Like pturmel said just use the RTC. The logic is quite small and simple: 2
scotty134 Posted June 28, 2022 Author Report Posted June 28, 2022 Initially I started with logic below #picture#1. But my idea was crashed after fist power reboot. photovaltaic, based on your example. I modified a bit the node to get rid off the bit using embedded tools - picture#2. I will test it and let you know soon.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now