You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old April 24th, 2009, 07:59 AM   #1
stu
Member
England

stu is offline
 
stu's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 385
hour counter instruction (rslogix 500

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
  Reply With Quote
Old April 24th, 2009, 08:13 AM   #2
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 5,379
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.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old April 24th, 2009, 09:01 AM   #3
stu
Member
England

stu is offline
 
stu's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 385
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
  Reply With Quote
Old April 24th, 2009, 09:10 AM   #4
jimbo3123
Member
United States

jimbo3123 is offline
 
Join Date: Sep 2003
Location: Detroit Area
Posts: 550
Quote:
Originally Posted by stu View Post
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 by jimbo3123; April 24th, 2009 at 09:20 AM.
  Reply With Quote
Old April 24th, 2009, 05:49 PM   #5
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 5,955
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.
__________________
True craftsmanship is only one more power tool away.

That's the beauty of processors, they don't have emotions they just run code - The PLC Kid.
  Reply With Quote
Old April 27th, 2009, 01:07 AM   #6
stu
Member
England

stu is offline
 
stu's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 385
[[/ladder]
Quote:
Originally Posted by Alaric View Post
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
  Reply With Quote
Old April 27th, 2009, 04:38 AM   #7
Kidblue
Lifetime Supporting Member
England

Kidblue is offline
 
Kidblue's Avatar
 
Join Date: May 2003
Location: Worcester
Posts: 618
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
__________________
Rob Howdle

.........For the Boys in Royal Blue !!
  Reply With Quote
Old April 27th, 2009, 10:03 AM   #8
stu
Member
England

stu is offline
 
stu's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 385
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?
  Reply With Quote
Old April 27th, 2009, 10:09 AM   #9
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 5,379
At the same time that your reset the timer also CLR the Long data.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old April 27th, 2009, 10:12 AM   #10
Controls_Engineer79
Member
Canada

Controls_Engineer79 is offline
 
Controls_Engineer79's Avatar
 
Join Date: Mar 2009
Location: oakville, ontario
Posts: 88
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
__________________
Cuda Automation and GC conveyors -for all your material HAN-DLI-NG needs!
  Reply With Quote
Old April 27th, 2009, 10:31 AM   #11
stu
Member
England

stu is offline
 
stu's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 385
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.
  Reply With Quote
Old April 27th, 2009, 10:39 AM   #12
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 5,955
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.
__________________
True craftsmanship is only one more power tool away.

That's the beauty of processors, they don't have emotions they just run code - The PLC Kid.
  Reply With Quote
Old April 27th, 2009, 10:58 AM   #13
stu
Member
England

stu is offline
 
stu's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 385
hi yes i was going to use two displays, but i am trying to put a button on the hmi to zero the displays?
  Reply With Quote
Old April 27th, 2009, 11:04 AM   #14
Roy Matson
Member
Canada

Roy Matson is offline
 
Roy Matson's Avatar
 
Join Date: Apr 2004
Location: Vancouver
Posts: 463
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 by Roy Matson; April 27th, 2009 at 11:12 AM. Reason: Additional Info
  Reply With Quote
Old April 27th, 2009, 11:04 AM   #15
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 5,955
XIC pushbutton BST CLR L9:0 NXB RES T4:0 BND
__________________
True craftsmanship is only one more power tool away.

That's the beauty of processors, they don't have emotions they just run code - The PLC Kid.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
RSLogix 500 & SLC 500 bga6418 LIVE PLC Questions And Answers 9 February 27th, 2012 10:46 AM
RSlinx Lite and RSLogix 500 Starter... FREE geniusintraining LIVE PLC Questions And Answers 21 February 24th, 2012 05:11 PM
RSLogix 500 - How to write to more than one output card with a single instruction? Warren Boswell LIVE PLC Questions And Answers 4 March 26th, 2008 08:03 AM
RSLogix 500 and Standalone Security Server pimpim32 LIVE PLC Questions And Answers 4 August 23rd, 2007 11:03 AM
Instruction manuals for AB RSLogix 500 and Siemens S7 dbonniwell LIVE PLC Questions And Answers 5 May 14th, 2005 03:41 PM


All times are GMT -5. The time now is 12:05 AM.


.