Prevention, Dear Watson, prevention!
Brian,
The best cure is not have the fault occur. The DIV instruction will always fault the processor if you attempt a divide by zero. Obviously that is undefined or infinity or what ever you like to refer to it as so stop it before it occurs. Check the value of the divisor in your instruction and make sure it is non-zero. If it is zero then either jump the divide rung or set the value to a harmless number like 1 or something. The other major cause of math errors is number value overrun. The limit in the SLC processors is -32768 to +32767 and if you attempt to go past those values, you will get an overrun error. There are processors with wider ranges but all have limits except these new Control Logix things and they are almost like PCs. Same idea as the DIV, make sure you do not go past the limit and if you do, then reset the overrun bit in the last rung of the program right ahead of the END rung. Now, if you are going to do these things then also be aware of the impact such a thing can have on your calculations and program accordingly. Just remember, the errors are there and to react to them is one way to program but to prevent them is even better.