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 February 4th, 2018, 08:53 PM   #1
Aabeck
Member
United States

Aabeck is offline
 
Aabeck's Avatar
 
Join Date: Feb 2013
Location: Detroit
Posts: 1,008
SLC5/03 Counter Anomoly

I have a SLC5/03 that suddenly started faulting. It has been running for 2 years without issue, and I tracked the problem to a math error (underflow?)

just for me I put in a subroutine to count how many scans per second the PLC is doing, and calculate it every minute. I count every other scan, at :01 seconds I move the counter.ACC, at :02 I move the counter.ACC, subtract for the number of counts, multiply by 2 for the scans value and reset the counter.

The odd part is even though the counter is reset every minute it somehow got to the negative count of -28465 and tried to SUB -28554, faulting the CPU.

I have watched this before and the count never went over 3000 until it was reset, the JSR to this is unconditional and processed every scan, so it's not getting bypassed, the OSR's are unique and not used elsewhere in the program.

What concerns me is I have this subroutine in almost every SLC, and a few other brands of PLC, I put in to see how the PLC performs, and is still in many machines.

For this one I added a latch bit on the first MOV, and perform a RES on the counter if the seconds are over :03 or the counter.ACC is over 12000 - see the second picture
Attached Images
File Type: jpg Scans.jpg (29.4 KB, 32 views)
File Type: jpg Scans2.jpg (24.6 KB, 27 views)
__________________
Never underestimate the quality of idiots that will be running your machines
http://aabeck.com

Last edited by Aabeck; February 4th, 2018 at 09:05 PM.
  Reply With Quote
Old February 5th, 2018, 07:27 AM   #2
Logix_Stef
Member
United Kingdom

Logix_Stef is offline
 
Logix_Stef's Avatar
 
Join Date: Oct 2014
Location: Havant
Posts: 83
Maybe a problem with the scan time of the SLC CPU?
  Reply With Quote
Old February 5th, 2018, 07:47 AM   #3
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,380
Very nearly every Logix500 program I have ever seen has an unconditional OTU S:5/0 as the last rung.

This will stop the faulting on overflow and underflow.

I don't know why they built this "feature" into the 500 series, it's pretty useless, as you don't know where the overflow/underflow occurred for you ti fix it.
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old February 5th, 2018, 08:16 AM   #4
Logix_Stef
Member
United Kingdom

Logix_Stef is offline
 
Logix_Stef's Avatar
 
Join Date: Oct 2014
Location: Havant
Posts: 83
What is puzzling is the machine was running without problems for two years without issues. Something must have changed to cause the underflow. Weird problem.
  Reply With Quote
Old February 5th, 2018, 08:36 AM   #5
James Mcquade
Member
United States

James Mcquade is offline
 
Join Date: Oct 2007
Location: Tennessee
Posts: 2,208
Code doesn't change by itself!
someone has to have cone into the program and changed something.
I would do a file comparison of the program (new versus older copy) to see where the change is.
other thought,
was there a cpu change?
I/o change?

regards,
james
  Reply With Quote
Old February 5th, 2018, 03:06 PM   #6
Aabeck
Member
United States

Aabeck is offline
 
Aabeck's Avatar
 
Join Date: Feb 2013
Location: Detroit
Posts: 1,008
I went online with the copy of the program I had - it didn't make me upload a usage file as if there had been a change in the program since I commissioned it. The CPU & I/O are still original.

If it was a scan time issue with the CPU I don't see how it could let the counter loop like that, and the CPU would have faulted.

The OneShot bits, counter and integers are only used once in the entire program, so it couldn't be written to somewhere else, and the counter and integers are not written to by the HMI - it only reads the one final value on a PLC status screen.

It just strikes me odd that a counter that is reset every minute counted for what had to be minutes until it came around to almost -28000

I did add the OTU S:5/0 on the last line of ladder 2 as a precaution. Maybe I will have to start putting this in every SLC.

I also added a GRT compare and am logging the highest value the counter reaches and added that in the corner of the HMI's main screen, and asked the customer to call me if the number ever went over 10000.
__________________
Never underestimate the quality of idiots that will be running your machines
http://aabeck.com
  Reply With Quote
Old February 5th, 2018, 03:24 PM   #7
Mispeld
Member
United States

Mispeld is offline
 
Mispeld's Avatar
 
Join Date: Feb 2017
Location: VA
Posts: 345
Since the code looks reasonable and data usage within the program was checked, it seems like time to think about "fringe" explanations. I've got two: (1) there is something externally manipulating the clock such that it can go minutes without the seconds transitioning to the value 2. For example, some network time service correcting drift in this unusual way, or (2) some network connection that is manipulating the counter values.

I know, these are really a stretch, short of blaming it on a hardware failure.
  Reply With Quote
Old February 5th, 2018, 03:25 PM   #8
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,380
Can you post your RSS file (Zip it first, forum rule...)

It looks to me like all the code is doing is calculating a "scans per second" value ?

Can I ask why you need that figure, is it any relevance to the process it is controlling ?

You can get this scans per second easily from the status file S:23, which is average scan time in either 1mS or 10mS units (you choose the timebase). Either divide 1000 or 100 by this value, and you have your scans per second.
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old February 5th, 2018, 03:27 PM   #9
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,380
I've just thought of something I came across years ago.... some variants of SLC didn't increment the "Seconds" in the RTC every second, but jumped 2 seconds, so it counted 0, 2, 4, 6 [EDIT : every 2 seconds]

Can you put a trap bit in to see if seconds/0 is ever on ??
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem



Last edited by daba; February 5th, 2018 at 03:32 PM. Reason: Clarification
  Reply With Quote
Old February 5th, 2018, 03:51 PM   #10
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,380
Quote:
Originally Posted by Aabeck View Post
I have a SLC5/03 that suddenly started faulting. It has been running for 2 years without issue, and I tracked the problem to a math error (underflow?)

just for me I put in a subroutine to count how many scans per second the PLC is doing, and calculate it every minute.....
Confusion here, was the SLC faulting BEFORE you put the subroutine in, or after.

If the former, take it out, and investigate the cause of the original fault, it can't be your subroutine.

If the latter, then it is your subroutine that is causing the faulting, so take it out.
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old February 5th, 2018, 03:52 PM   #11
Aabeck
Member
United States

Aabeck is offline
 
Aabeck's Avatar
 
Join Date: Feb 2013
Location: Detroit
Posts: 1,008
Daba,

While watching this online the seconds incremented 1 every second, and it has been accurately calculating about 190 scans per second since I started it. All this subroutine does is calculate the scans per second, and it is only for my information to see how fast it was scanning - it's not used in the process, so if it is a problem again I will delete it - but I am wondering how this happened, and if it could be a problem in any other operation of any SLC operation.

Mispeld,

This PLC has no network connection, just a 5/03 with AdvancedHMI on a serial DF1 driver, and the PC does not send the time to the PLC.
__________________
Never underestimate the quality of idiots that will be running your machines
http://aabeck.com
  Reply With Quote
Old February 5th, 2018, 03:54 PM   #12
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is online now
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 6,562
Are you sure the rungs you posted are the source of the underflow? I've only worked with a few SLCs, so I'm nowhere close to being proficient with it, but the screen shot shows the correct answer. -28465 - (-28554) = 89
Could anything else be writing to S:42 to prevent its value from incrementing?
  Reply With Quote
Old February 5th, 2018, 03:55 PM   #13
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,380
Quote:
Originally Posted by Aabeck View Post
.....just for me I put in a subroutine to count how many scans per second the PLC is doing
if it is "just for you", then use the average scan time from S:23 and calculate like I said - you can't do any damage that way....
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old February 5th, 2018, 03:56 PM   #14
Aabeck
Member
United States

Aabeck is offline
 
Aabeck's Avatar
 
Join Date: Feb 2013
Location: Detroit
Posts: 1,008
Daba,

This routine has been in since I started testing the program years ago, not something I just added. It has been in the running machine for over 2 years without any problem, so suddenly the counter stopped resetting or something changed a value in the counter or an integer.
__________________
Never underestimate the quality of idiots that will be running your machines
http://aabeck.com
  Reply With Quote
Old February 5th, 2018, 03:59 PM   #15
Aabeck
Member
United States

Aabeck is offline
 
Aabeck's Avatar
 
Join Date: Feb 2013
Location: Detroit
Posts: 1,008
Steve,

I think the 89 is the value from the last good subtraction, and somehow when it hit these specific values the SUB resulted in a value out of the integers range and that caused the fault.
__________________
Never underestimate the quality of idiots that will be running your machines
http://aabeck.com
  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
8 boiler lead lag system HELPPP plz !! HeroControlsInc LIVE PLC Questions And Answers 9 April 7th, 2016 11:34 AM
Micro850 Counter Driver lolproe LIVE PLC Questions And Answers 2 October 16th, 2013 03:50 PM
Digital Counter "jumping" rguimond LIVE PLC Questions And Answers 4 March 3rd, 2010 03:17 PM
Absolute encoder or SSI counter Fault ason LIVE PLC Questions And Answers 0 December 20th, 2006 02:44 PM
AB Micro High Speed Counter Trouble Rocky Cortis LIVE PLC Questions And Answers 2 September 19th, 2004 01:09 PM


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


.