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, 2006, 01:17 PM   #1
BigJohnT
Member
United States

BigJohnT is offline
 
Join Date: Apr 2006
Location: Poplar Bluff
Posts: 18
Change Counter Acc in Code RsLogix

Can you change the value of a counter Acc in code with RsLogix on a 1500 micro?

I have some sequence logic that uses a counter to control the sequence. In some cases I need to back up the counter.

Thanks
John

Last edited by BigJohnT; April 24th, 2006 at 01:19 PM.
  Reply With Quote
Old April 24th, 2006, 01:34 PM   #2
jstolaruk
Member
United States

jstolaruk is offline
 
Join Date: Dec 2004
Location: SE Michigan
Posts: 2,150
Quote:
Originally Posted by BigJohnT
Can you change the value of a counter Acc in code with RsLogix on a 1500 micro?

I have some sequence logic that uses a counter to control the sequence. In some cases I need to back up the counter.

Thanks
John
yes, a move instruction will work. MOV n7:0 c5:0.acc

Also SUB, ADD, DIV, or MUL.
__________________
"You can live to be a hundred if you give up all the things that make you want to live to be a hundred." Woody Allen
  Reply With Quote
Old April 24th, 2006, 01:38 PM   #3
BigJohnT
Member
United States

BigJohnT is offline
 
Join Date: Apr 2006
Location: Poplar Bluff
Posts: 18
Quote:
Originally Posted by jstolaruk
yes, a move instruction will work. MOV n7:0 c5:0.acc

Also SUB, ADD, DIV, or MUL.
Thanks, I did not even think about the math instructions (slapping forhead)

John
  Reply With Quote
Old April 24th, 2006, 01:45 PM   #4
jstolaruk
Member
United States

jstolaruk is offline
 
Join Date: Dec 2004
Location: SE Michigan
Posts: 2,150
Quote:
Originally Posted by BigJohnT
Thanks, I did not even think about the math instructions (slapping forhead)

John
I belive the CPU will fault if the counter/timer accumulator gets a negative number in it though. Some range checking would not be a bad idea.
__________________
"You can live to be a hundred if you give up all the things that make you want to live to be a hundred." Woody Allen
  Reply With Quote
Old April 24th, 2006, 01:48 PM   #5
BigJohnT
Member
United States

BigJohnT is offline
 
Join Date: Apr 2006
Location: Poplar Bluff
Posts: 18
Quote:
Originally Posted by jstolaruk
I belive the CPU will fault if the counter/timer accumulator gets a negative number in it though. Some range checking would not be a bad idea.
That's for sure something like -32647 to 32648 or some number like that will fault the cpu.

THanks
John
  Reply With Quote
Old April 24th, 2006, 02:22 PM   #6
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 5,955
The PLC will fault on negative numbers for timers. However counters do just fine with negative numbers in the PRE and ACC.
  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 PLC sample code for 4-Loop PID blend controller welday007 LIVE PLC Questions And Answers 2 December 22nd, 2008 01:22 PM
RSLogix 5000 V15 Features Samneggs LIVE PLC Questions And Answers 18 April 20th, 2006 05:45 PM
RSLogix 5000 Footage Counter Program Scotnet LIVE PLC Questions And Answers 0 March 1st, 2005 06:59 PM
Simulator, Simulation, Shadow Code Terry Woods LIVE PLC Questions And Answers 1 January 2nd, 2005 01:40 PM
Mapping RSLogix Code Aaron LIVE PLC Questions And Answers 3 March 19th, 2003 12:04 PM


All times are GMT -5. The time now is 11:26 PM.


.