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 December 13th, 2013, 06:40 AM   #1
JGrissom
Member
United States

JGrissom is offline
 
Join Date: Dec 2013
Location: colorado
Posts: 18
SLC500 fun

Can you reset a group of counters using a copy instruction without reseting the preset values? If not how can I reset a group of counters without using an entire page of RES instructions?
  Reply With Quote
Old December 13th, 2013, 07:09 AM   #2
JGrissom
Member
United States

JGrissom is offline
 
Join Date: Dec 2013
Location: colorado
Posts: 18
By the way

This is on a SLC5/05!
  Reply With Quote
Old December 13th, 2013, 07:21 AM   #3
kamenges
Member
United States

kamenges is offline
 
kamenges's Avatar
 
Join Date: Nov 2002
Location: Brillion, WI
Posts: 3,661
You won't be able to do that with a COP. The COP works on continuous blocks of bytes so you would end up resetting everything related to the counter.

Do all the counters need to be reset in the same scan or can this occur over multiple scans?

Keith
  Reply With Quote
Old December 13th, 2013, 07:39 AM   #4
JGrissom
Member
United States

JGrissom is offline
 
Join Date: Dec 2013
Location: colorado
Posts: 18
Would be nice to do in one scan but not a must. I have copied template copy of a counter into all but would have to have two template type counters as there are two preset values needed.

Last edited by JGrissom; December 13th, 2013 at 07:42 AM.
  Reply With Quote
Old December 13th, 2013, 07:45 AM   #5
kamenges
Member
United States

kamenges is offline
 
kamenges's Avatar
 
Join Date: Nov 2002
Location: Brillion, WI
Posts: 3,661
If you do it over multiple scans you can use indirect addressing without looping. If it needs to be done in a single scan you can still use indirect addressing but you would need to use JMP/LBB looping. however, if you do that be EXTREMELY careful you don't get stuck in the loop.

I don't have the SLC instruction set in front of me but there may be a file manipulation instruction (F??) that would let you perform a looped logical operation on a file all contained in one instruction.

Keith
  Reply With Quote
Old December 13th, 2013, 08:03 AM   #6
JGrissom
Member
United States

JGrissom is offline
 
Join Date: Dec 2013
Location: colorado
Posts: 18
I tried to use indirect addressing but got an error saying indirect addressing not allowed when veriying the rung. I also tried to us FLL but would reset the preset values to zero.
  Reply With Quote
Old December 13th, 2013, 09:45 AM   #7
OZEE
Member
United States

OZEE is offline
 
Join Date: Mar 2006
Location: Kansas
Posts: 1,695
It's not difficult to "reset" a group of timers by resetting the ACCU (not the PRE), using either indirects or cop's. But, I believe that if the .dn bit is already set, you'll have to also reset it -- just resetting the accu won't clear it.
__________________
"I wonder how people did this before the days of PLCs?" If people would take the time to learn how a simple relay control circuit works..... [Helliana]
  Reply With Quote
Old December 13th, 2013, 10:14 AM   #8
JGrissom
Member
United States

JGrissom is offline
 
Join Date: Dec 2013
Location: colorado
Posts: 18
It does not seem to be the same with a counter as I can't use indirect addressing because I get an error saying indirect addressing not allowed. The only way I found was to copy in a blank counter with the proper preset value and zero in the ACCUM and I can do as many as I want at one time. Just looking for a cleaner way if possible. This project is gathering OEE information on a machine so I need to get up/down/Operator breaks/scheduled down/corrective time buckets so I can compute the OEE values. Also I don't seem to be able divide two floats in a compute instruction, any ideas??
  Reply With Quote
Old December 13th, 2013, 10:27 AM   #9
Mickey
Lifetime Supporting Member
United States

Mickey is offline
 
Mickey's Avatar
 
Join Date: May 2003
Location: Palmdale,Ca
Posts: 10,132
Quote:
Also I don't seem to be able divide two floats in a compute instruction, any ideas??
Post your code. What error do you get? Remember "/" is not a divide symbol, "|" is.

How many counters do you have? sometimes brute force is the only/best way.
__________________
Mickey

If you want happiness for an hour-take a nap. If you want happiness for a day-go fishing. If you want happiness for a month-getmarried. If you want happiness for a year-inherit a fortune. If you want happiness for a lifetime-help someone else.
----- Chinese Proverb
  Reply With Quote
Old December 13th, 2013, 10:28 AM   #10
James Mcquade
Member
United States

James Mcquade is offline
 
Join Date: Oct 2007
Location: Tennessee
Posts: 2,239
can you have the machine log in a code for when it it down?
when the machine is down, start a 60 second timer that increments a counter.

that way, you only have 3 registers to deal with, machine status code, seconds, minutes.

also, in regards to your floating point math, we do that all the time, are your ( ) in the right place?

regards,
james
  Reply With Quote
Old December 13th, 2013, 11:25 AM   #11
JGrissom
Member
United States

JGrissom is offline
 
Join Date: Dec 2013
Location: colorado
Posts: 18
I found out that the / is not correct and used the | and got it to work finally. Thanks
  Reply With Quote
Old December 13th, 2013, 11:29 AM   #12
JGrissom
Member
United States

JGrissom is offline
 
Join Date: Dec 2013
Location: colorado
Posts: 18
James,
I have it set up to get the current hours/minutes/seconds from the PLC clock. I have 4 counters per time bucket so that would be 24 counters that count only if that category is selected and an additional one for when there is no category selected so it will keep track of the time until a category is selected then is transferred to the correct time bucket. This is why I'm trying to use either indirect or indexed addressing so I can write to these counters without having pages of code repeated over and over again with different counters.
  Reply With Quote
Old December 13th, 2013, 11:58 AM   #13
Lancie1
Lifetime Supporting Member
United States

Lancie1 is offline
 
Lancie1's Avatar
 
Join Date: Jul 2003
Location: Alabama
Posts: 10,002
Quote:
I tried to use indirect addressing but got an error saying indirect addressing not allowed when veriying the rung.
You must have had a mistake. I tried indirect addressing using a MOV and it seems to work fine to move a value into any counter ACCUMULATOR. Also indirect addressing can be used with Unlatch (U) to reset the Counter DN bit. See picture.

You should be able to set up the a MOV and Unlatch in a JMP-LBL loop using a pointer to index through all your counters that need setting.
Attached Images
File Type: jpg Counter Indirect Addressing.jpg (63.6 KB, 30 views)

Last edited by Lancie1; December 13th, 2013 at 12:30 PM.
  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
Help! DeviceNet for SLC500 Allen Bradley Buscom LIVE PLC Questions And Answers 7 October 7th, 2013 08:33 AM
slc500 basic questions flybyguy LIVE PLC Questions And Answers 11 July 14th, 2011 07:48 PM
What version of SLC500 muzikant5 LIVE PLC Questions And Answers 15 April 2nd, 2009 11:23 PM
slc500 verse plc5 porky LIVE PLC Questions And Answers 8 May 21st, 2007 09:06 PM
SLC500, DeltaV and Intellution vtfan LIVE PLC Questions And Answers 0 November 17th, 2003 12:05 PM


All times are GMT -5. The time now is 12:38 PM.


.