Hour:min timer dispaly on panelview micro 300 using micrologix 1200

Salazard

Lifetime Supporting Member
Join Date
Apr 2012
Location
Vancouver
Posts
28
Need help a source code to make timer display into hour:min descending from a time of delay 1 sec base timer.

Thanks
 
There may be a native instruction somewhere to do this easily, but I'm not aware of it. Here's a brute force method.

First:
SUB Timer.PRE Timer.ACC <seconds left>

This gets the time remaining.

If the MicroLogix supported a MOD instruction, you could do:

MOD <seconds left> 3600 <hours left>

It doesn't, though, so you'll have to roll your own.

If you divide <seconds left> by 3600, you'll end up with <hours left>. If you do straight integer math, however, it will round, which is not what you want here. If you don't want to play with the math registers, write the result to a floating point. Subtract 0.5 and then store in another integer location. That way, when it rounds, you'll end up with the number of whole hours left.

Then, multiply <whole hours left> by 3600 and subtract the result from <seconds left>. If you divide that result by 60, you'll have <minutes left>, bearing in mind the rounding issues above.

In the PV300, you can use 2 numeric data displays, one pointing to <whole hours left> and the other pointing to <minutes left>. Put a ":" between them and select "fill with zeros" on the minutes display to make it look right.

Here's a quick-and-dirty RSLogix file.
 
thanks

Awesome, It work on my panelview.

I did not regret to join ths forum. So many people will help.

Many Thanks
 
If the MicroLogix supported a MOD instruction, you could do:

MOD <seconds left> 3600 <hours left>

It doesn't, though, so you'll have to roll your own.

The Micrologix does support Modulus division.

If the destination address of the DIV instruction is the math register S:13 then register S:13 will contain the remainder and
S:14 will contain the unrounded quotient.
 
The Micrologix does support Modulus division.

If the destination address of the DIV instruction is the math register S:13 then register S:13 will contain the remainder and
S:14 will contain the unrounded quotient.

I knew about that, but wasn't sure of the details and didn't want to dig into it. This isn't *quite* the same as a MOD instruction, but if you do it right it gets the same result.
 
Actually using the Math Register on a division giving the 'unrounded quotient' instead of the normal 'rounded' quotient can come in very handy at times. So it kind of does double duty. it's not that bad. You just utilize the contents of the registers before doing some other math operation.
 
I can see that. I've never really used them and didn't feel up to experimenting just then. I will definitely tinker with them a bit when time allows. Thanks for the tip.
 
I have a problem on the minutes after the time setting when it is done. example 1hr:30min on the panelview 300. It become 00:30if my preset value is 30.I cannot change my preset value on the timer to zero because the minimun preset is 30min. On my panelview 300 operator can adjust the and change the preset value of the timer.
 
hi friends,

i have micrologix 1200 plc with AIC converter
when i connect ML1200 PLC to PC
i am configure RSLinx (RS232-DF1) driver through AIC converter then it will display error like Package timeout
anybody help me, what is package timeout and what is the solution
 
Good Samaritan Can Help

I attached the code for the Oven. If anyone can help figuring out using panelview 300 micro.

Rung 12 to 14. Is the Timer I nedd to display on the panelview. Rapid Heat Timer.

Thanks
 

Similar Topics

Hi all starting a small home project. I have a ml1200 that i would like to set up to run my fish tank. I would like to set a ladder to start to...
Replies
4
Views
1,757
Hello, I am trying to setup on plc so If I enter 60 jph (job per hour) it will send the vfd hertz based on what jph is entered by...
Replies
2
Views
157
Hi team, I am setting up my first E200 overload unit. I came across parameter 205 StartsPerHour. The default setting is 2. I presume, the motor...
Replies
2
Views
492
Hello, I have inherited an old machine with a PLC unit that needs to be reset after a batter replacement. I don't know what I'm doing! Here's...
Replies
5
Views
1,029
We have 6 pumps for which we calculated running hours from run feedback. We need to start these pumps based on demand in auto sequence for a day...
Replies
4
Views
1,554
Back
Top Bottom