hour counter instruction (rslogix 500

stu

Member
Join Date
Aug 2005
Location
England
Posts
772
hi guys, i would like to put an running hour counter in the program of a ml1200 plc to be viewed on a hmi, but i am not to sure what instruction to use has anyone done this before?all
the best stu
 
Have a contact representing the ON condition that you wish to time enable the input of an RTO timer. Timebase 1 second, Preset of 3600.

When it's done (DN) increment a Long type word and reset the timer. Then display the Long.
 
hi bernie
thanks for that, what do you mean by increment a Long type word ? i am to to sure about this bit.
thank for you help
stu
 
hi bernie
thanks for that, what do you mean by increment a Long type word ? i am to to sure about this bit.
thank for you help
stu

The micrologix doesn't have a long (or dint) data type.
You can probably get away with using an integer for your hour accumulator. I typically add logic to roll-over the accumulator when it gets near its maximum value of 32767.

With a maximum of 32767 hours, your meter will roll-over with 3.7 years of continuous usage.

If you need a longer elapsed time record, you will need to use more than one integer.
For example, your timer would count up to 3600 seconds (1 hour), then increment an integer N7:10 (hours). When that integer reached 10,000, you would increment a second integer N7:11 (hours x 10,000) and set the N7:10 to 0.
 
Last edited:
The op is using an ML1200, which does support a Long data type. Use an L file.

//timer
XIC Running RTO T4:0 1 3600 0

//hour counter
XIC T4:0/dn bst Add L9:0 1 L9:0 nxt RES T4:0 bnd

You could also use a preset of 36 seconds and count hudredths of hours instead.

A long will count to 2,147,483,547.
 
[[/LADDER]
The op is using an ML1200, which does support a Long data type. Use an L file.

//timer
XIC Running RTO T4:0 1 3600 0

//hour counter
XIC T4:0/dn bst Add L9:0 1 L9:0 nxt RES T4:0 bnd

You could also use a preset of 36 seconds and count hudredths of hours instead.

A long will count to 2,147,483,547.

Hi Alaric
thanks for that, i am still trying to get to grips with programming can you put in idiots terms please? what does the nxt mean? and do i use the L9:0 as the display tag? if i would like minutes to i do the same formula. all the best stu
 
Hi Stu,

You can copy the syntax that a lot of the guys post here straight into the ladder editor of Logix500 (and others)

[Rung 0000] XIC B3:0/0 RTO T4:0 1.0 3600 0

[Rung 0001] XIC T4:0/DN BST ADD 1 L9:0 L9:0 NXB RES T4:0 BND


Just double-click the left of the rung until the cursor appears and paste the above into it (without the words in square brackets)...

Just replace B3/0 with your relevant input contact as the 'Motor Run' signal.

Hope this helps!

Rob
 
hi what if i wanted to reset the counter on the hmi (display)how would i go about that, if i put a -(res)- that only resets the timer /counter?
 
well do you want it to reset automaticly once it reaches a set value?? if so then i would use a compairson instruction and a move instruction to move a value of Zero into your display address once it reaches the value you want to reset at, if you want it to be manualy reset then have the move triggered by a Bit from a pushbutton on your HMI
 
what i want to do is a manual reset, if i used a = instruction and moved it to the screen ( XIC EQU N7:0 3600 MOV 0 N7:1 ) would that work?
thanks for your help.
 
Stu,

If you are doing minutes then still use the L word to count hours using a 3600 second retentive timer and compute the elapsed minutes for display. Minutes = T4:0.ACC/60 Use two separate adjacent display fields on the HMI screen, one displays hours, the other minutes, with a static : between them. Right justify the hours display, make sure you include enough digits, and configure the minute display for two digits with a leading 0 so that you have a HHHHHH:MM format.
 
hi yes i was going to use two displays, but i am trying to put a button on the hmi to zero the displays?
 
I have a related question for RSLogix5000 with Structured Text add on.
I tried making hour counters, they worked fine but would reset to zero if I downloaded a configuration change.
Is there somewhere in the PLC memory that is not over-written and how do I address that?
My PLC is 1756L61
Thanks
Roy
 
Last edited:

Similar Topics

HELLO i am working on a logic in which i have to record number of hours a DI bit is enabled and record it to vijeo citect 7.4. in simple words i...
Replies
3
Views
2,239
Hi, I am developing a HMI Screen using FTVIEW SE and collecting Data from GE PLC using Kepware. Now, I want to add a total hours Counter that...
Replies
2
Views
1,315
Hi! Even in the simple Siemens LOGO there was a hour counter, counting the time an, for example, input has been set. Where is this in S7-1200...
Replies
1
Views
2,752
Hey guys. I need an eksampel on how to make an minutes/hour counter in rslogix 500. I have 30 motors that runs on for 5min and 0ff for 1...
Replies
8
Views
2,834
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
469
Back
Top Bottom