program fault handler

jude

Member
Join Date
Oct 2010
Location
ontario
Posts
117
I have been reading 1756-PM014D-EN-P, I have been able to create a routine for a Controller fault handler and a power up handler both run ok. I have also created a fault routine for a program which I have been unable to get to run, specifically I have created a math error type 4 code 4, my understanding was that it would go to the fault routine for the program where I had used minor fault time low ,Type and code used a clear for both and an ssv for minor fault time low .I was under the impression that when a fault occurs in the program the fault routine is used for one scan and then returns to the main program.Any information on how this fault routine is supposed to run and an example would be much appreciated.
Jude
 
The fault routine runs when your math error occurs. In order for the scan to go back to the main routine the fault has to be cleared in that routine. If it is not cleared then the Program Fault becomes a Controller Fault and the Controller Fault Handler kicks in.

Include a rung with just an OTE using an internal bool in the Program Fault Routine and you'll see that that routine does run, but if it doesn't clear the fault then when it reaches END it jumps to the fault handler.

OG
 
Ok I just tried that,the ote never energised. I can see the faults in my equal minor code and equal minor type also the gsv FaultLog for minor fault bits shows the faults. I am running this on an emulator should this make a differance and I have an ssv which also shows numbers changing in the fault routine
 
If I put a bit in the main routine (toggle manually)for a jsr in the main routine to the fault routine it causes a fault type 6 code 4 so I change the controller fault handler to clear this fault which allows the fault routine in the main program to clear type 4 code 4.What am I doing wrong
 
Ok, I have written and rewritten this so I apologize as I go a bit off topic below:

You don't write real logic to jump to a fault routine. That should be used only for testing the fault routine. I'm guessing that is exactly what you are doing but I want it to be clear for anyone else that may read this thread in the future. some of what I write here is for your benefit, some for others.

When a program fault occurs, the CPU will automatically jump to the fault routine for that program. If it does not find a program fault routine then it looks for the controller fault handler. If it doesn't find either of those it immediately faults. For your example, I would first inhibit the fault handler so you can test the fault routine.

I don't have these codes memorized but if I recall a fault type 6 has to do with a task watchdog. If a task watchdog fault occurs it can only be cleared once during a single scan otherwise you could be stuck looping through bad logic. I THINK it can only be cleared by the fault handler because it is not technically a "program fault".

Bear in mind that a fault routine is basically used to prevent the system from slamming to a stop when a fault in the program occurs. You usually want to do three things in a fault routine. They are:

  1. Turn on an internal bool tag to indicate that a fault has occurred. this can be used elsewhere in your main logic to alert or take an action. I create a separate bool tag for each program and another for the fault handler.
  2. Write logic to capture the fault information. This is where the GSV is used. This information can be logged or can be displayed on an HMI.
  3. Write logic to clear the fault condition. Without clearing the fault, the controller will shut down upon reaching the end of the fault routine. This is where the SSV instruction is used.
The GSV example on page 21 of that manual is how you want to set it up. Keeping in mind that you must have created a User Defined Data Type specifically for fault information also detailed on page 21.

The SSV is detailed on page 23 although I prefer to use a separate tag for clearing a fault. I create one tag of the fault UDT for storing the fault info and then a second tag for clearing the fault.

OG
 
Hrm... Do Minor Errors even trigger a fault routine? I don't think so.
AFAIK, only a Major error will trigger a fault routine (if configured); In other words, errors that would cause the processor to go into STOP mode (like an out of bounds index).

Minor errors such as math overflows don't cause a stop on the Logix platform.
 
Operaghost you are correct the jsr and bit were therew to test the fault routine as was the ote you suggested earlier on. When the math error was created the fault routine did not run, I toggled the bit for the jsr and this created a type 4 code 6 error which faulted the processor, I corrected this with routine for the controller fault handler with the processor no longer faulting when I toggled the jsr the fault routine in the main program ran and cleared the math error, I just need to figure out why the fault routine in the main program will not run after the math error is generated
 
I did a course in programming last year on 5000 fault handling was only touched on very briefly so I am trying to teach myself now, problem is now I have changed the program so many times in the last day or so I am not sure which one I sent hope fully you can make enough sense to give me some advice as to what I am doing wrong
 
Ok, so in reviewing the logic there are a couple things to point out. First off, when I toggled the bit to trigger the JSR to call the fault routine (to simulate a fault condition) the logic in there does execute and the bit I asked you to add does indeed turn on. So the fault routine is running. However, there is no logic to capture the MAJOR fault or clear the MAJOR fault. You have logic for minor faults instead.

So, since the fault routine does not clear the fault, when the scan reaches the END rung of the fault routine the controller jumps to the Controller Fault Handler. In there, you do indeed have the right logic to capture and clear the fault.

So, the minor fault logic does not need to be in the fault routine or the controller fault handler. It can be out in your normal logic.

The logic to capture and clear the MAJORFAULTRECORD must be in the fault routine and in the individual fault routines.

I will post an example of the logic I typically use. It may take me a little while since I am at home right now.

OG
 
Ok, I should add a couple things.

First off, you can add conditions ahead of the SSV to control when you want to allow faults to be cleared and when you do not. You may not want to clear every fault as my example would.

Secondly, within the Controller Fault Handler the GSV/SSV Class Name is probably going to be FAULTLOG with the MAJORFAULTBITS as the attribute.

OG
 

Similar Topics

Hello, I am currently tasked with updating our EtherNet/IP scanner program to be able to connect to CompactLogix devices to read their tags etc...
Replies
5
Views
2,010
(Allen Bradley PLC)Issue resolved by download the project, But What is the main root cause of this Major Fault Error code 62 “Non-Recoverable...
Replies
3
Views
3,163
Hi all, i have a 1756-L62 processor, it keeps going into fault mode when i put it into run. I went to check major faults and i see the program...
Replies
23
Views
4,492
Need some help guys Looked up the error, and this is what I found.please have a look at the attachment. Monitored the tag, its not being used...
Replies
2
Views
1,919
Back
Top Bottom