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:
- 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.
- 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.
- 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