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