How to fault a ControlLogix processor

R_C

Member
Join Date
Apr 2005
Posts
93
How do you make a ControlLogix processor fault? This is part of a SAT (Site acceptance test).
 
Last edited:
Put in a compute statement and make the divisor a tag with a vaule of 0 in it. If you use a tag instead of a static value, it should compile and download.
 
Lots of ways. Take a look at the major fault list in RSLogix5000, that should give you some ideas. It's probably best to use one that checks something important to your SAT.

A real simple one:
Stuff a negative number into a timer accumulator.
 
mgvol said:
Put in a compute statement and make the divisor a tag with a vaule of 0 in it. If you use a tag instead of a static value, it should compile and download.
With ver15 firmware you can divide by zero and it will not fault the processor. That was the first thing I tried.
mellis said:
Lots of ways. Take a look at the major fault list in RSLogix5000, that should give you some ideas. It's probably best to use one that checks something important to your SAT.

A real simple one:
Stuff a negative number into a timer accumulator.
This worked great! Thanks for the speedy response.
 
I did this just the other day for a test.

I did a software fault by moving a negative number into a timer preset, and a hardware fault by configuring an I/O module for "Major Fault Controller on I/O Connection Failure" and removing the module.
 
R_C said:
With ver15 firmware you can divide by zero and it will not fault the processor. That was the first thing I tried.

That's a worry! If you divide by zero on a processor that doesn't fault then the results could be unpredictable (and dependent on how the division library is coded). I would much prefer the processor to stop when that sort of fault is detected.
 
Binaural said:
That's a worry! If you divide by zero on a processor that doesn't fault then the results could be unpredictable (and dependent on how the division library is coded). I would much prefer the processor to stop when that sort of fault is detected.

The CLX processor already supports the IEEE designation for infinity in a floating point number. If you run a totalizer long enough, the value will become "1.$". I'm told that this is an official notation.

I imagine the divide by zero will give a similar result. But, now how do I deal with the result in my programs? Do I do a GRT comparision to catch the error? It's nice that the processor won't fault, but I'll bet the result of the calculation will be equally useless to me from a control standpoint. It's easier for me to control the calculation, rather than handle the bogus result. I think you can see the difference between programming computers and programming PLCs here.


By the way, if you want to fault a CLX:

Write a subroutine. Give it a few input parameters and use a JSR call. In the JSR, input the wrong number of inputs, or place them out of order. Sooner or later, the processor will barf (this is a good thing).

You can also write a really gigantic UDT, pass it into a subroutine, then within that subroutine pass the data structure to another subroutine. Sooner or later you'll overflow the memory. A recursive subroutine or pair of subroutines that call each other should also have a similar effect.

How about running out the watchdog timer? Write an endless loop in your program. That's pretty easy to do.

Access an array element outside the array boundaries.

AK
 
akreel said:
The CLX processor already supports the IEEE designation for infinity in a floating point number. If you run a totalizer long enough, the value will become "1.$". I'm told that this is an official notation.

I imagine the divide by zero will give a similar result. But, now how do I deal with the result in my programs? Do I do a GRT comparision to catch the error? It's nice that the processor won't fault, but I'll bet the result of the calculation will be equally useless to me from a control standpoint. It's easier for me to control the calculation, rather than handle the bogus result. I think you can see the difference between programming computers and programming PLCs here.

AK

I see your point, and the wise man never performs a divide in an embedded processor without checking the denominator is not zero.

However, I frequently use and commission code written by others (most large projects would) and if code tries to do something impossible I prefer the processor to fault rather than "fudge" the results. The danger of having an overflow error floating to a high number is that it can happen AFTER the usual input sanity check. So while your code might spot an out-of-range pressure value, it might not check that the scaled-down value is infinity. Nautrally, the results could be exciting!

That said, I also often see an instruction to unlatch an overflow fault in AB SLC processsors, so perhaps I am being a sissy :)
 
There are predefined status flags in the ControlLogix controllers to handle minor faults (such as those caused by overflows and divide-by-zero).

S:FS First Scan
S:N negative flag
S:Z Zero flag
S:V Overflow flag
S:C Carry flag
S:MINOR minor fault flag

The processor doesn't Major Fault on divide-by-zero, for example, instead it sets the S:MINOR flag. Look up the HELP file entry for the DIV instruction for the specifics.
 
Ken Roach said:
I did this just the other day for a test.

I did a software fault by moving a negative number into a timer preset, and a hardware fault by configuring an I/O module for "Major Fault Controller on I/O Connection Failure" and removing the module.
We had to test our Alarm tags in RSView for the SAT. We had put code in the PLC to divide by zero but we had not tested it until the SAT. We found out the hard way that it doesnt fault the processor.
I like the idea of showing a software and hardware fault.
 
Ken Roach said:
S:FS First Scan
S:N negative flag
S:Z Zero flag
S:V Overflow flag
S:C Carry flag
S:MINOR minor fault flag

By the way, is there any way to set a tag description on these guys? I've used S:FS in a few of my programs, with no explanations as to what that means.

AK
 
Divide by zero in a ControlLogix PLC:
div_by_zero2.JPG



Expression is 100/Zero, the result is 100.
 
Last edited:
Getting fault code from Processor Fault

Hi,
After you make a simulation about controller fault (i.e negative value on the preset timer),next step is how to get information (i,e what error code) when controller is in fault condition?
I have try to get this information using GSV instruction, but not successed!
If controller is fault condition, controller not execute logic, so GSV not will be executed.
Somebody know how to solve this?

mypict.jpg
 
place the code into a fault routine. Store the information into some controller registers that you set up just for that purpose.
 
I faulted out a machine using ControlLogix on accident once.

I set an array to 10 words long. And I used it in a FFL and told the FFL it was 11 Words long. When the FFL went to load the 11th value, the processor faulted out, and the machine stopped (Mid production too.) Around 10 angry operators turned to me, all I could say was "Sorry!"

Edit: btw, it was using RSlogix5000 ver 10

Oh, wow, sorry. I was using the search function and forgot I had my search results window open. I opened this thread and didn't look at the date. Really sorry about the needless bump.
 
Last edited:

Similar Topics

Hi there! I posted few days ago about a fault i had with my motion. I did some cable check and replacement and it didnt solve my problem yet but...
Replies
0
Views
364
Hello, We have a customer with a 1756-L72 ControlLogix PLC. They have recently got a T01:C62 Fault Code. I am trying to figure out how to...
Replies
6
Views
1,017
An issue occurred at an organization here in whereby the ControlNet card developed a fault. Card Details: Catalog/Series; 1756-CN2RXT B Part No...
Replies
0
Views
433
Does anyone have any real world examples of using the ControlLogix fault routines? I can’t seem to find anything on the Rockwell website.
Replies
6
Views
1,397
:scratch: I have a strange behavior, sometimes Major Fault Type 4 Code 20 occur, I know the reason, I used an array with a word index which can...
Replies
23
Views
8,890
Back
Top Bottom