DazednConfused
Member
Good day. I have a problem that I am hoping someone will be able to help me with. I am running RsLogix 500 with a Micrologix 1100. I am doing some timing sequences, and I have run into a bit of a snag.
Basically I have a user enter (into Integers) two sets of times, one in minutes and one in hours. These two times are then multiplied by 60 and 3600 respectively, and added together to give me the total time in seconds that my timer will count down from.
EX: If I have 1 hour and 25 mins entered, I will get (1*3600) + (25*60) = 5100 seconds. When the user activates the time, this 5100 will count down to 0 (this is done with some other math functions I have incorperated).
My problem is that I need to be able to display this time (5100 seconds) on my HMI as Hours and Minutes left. Is there anyway I can have something in my code that will check how many hours are in 5100 seconds, take that number, and display it. And also find out how many minutes are left for each hour out of 60, and display it.
So basically, if I have 5100 seconds, I have 1 hour and 25 minutes. After a time of 40 minutes has past, I want it to display 0 hours and 45 mins left.
I hope I am not to confusing in my question. My biggest problem that is stopping me with most things I have tried is converting from decimal to integer.
Thanks in advance for anyone trying this problem. I'm exhausted in my attempts.
Paul
Basically I have a user enter (into Integers) two sets of times, one in minutes and one in hours. These two times are then multiplied by 60 and 3600 respectively, and added together to give me the total time in seconds that my timer will count down from.
EX: If I have 1 hour and 25 mins entered, I will get (1*3600) + (25*60) = 5100 seconds. When the user activates the time, this 5100 will count down to 0 (this is done with some other math functions I have incorperated).
My problem is that I need to be able to display this time (5100 seconds) on my HMI as Hours and Minutes left. Is there anyway I can have something in my code that will check how many hours are in 5100 seconds, take that number, and display it. And also find out how many minutes are left for each hour out of 60, and display it.
So basically, if I have 5100 seconds, I have 1 hour and 25 minutes. After a time of 40 minutes has past, I want it to display 0 hours and 45 mins left.
I hope I am not to confusing in my question. My biggest problem that is stopping me with most things I have tried is converting from decimal to integer.
Thanks in advance for anyone trying this problem. I'm exhausted in my attempts.
Paul