then we are well on our way to understanding how PLCs work.
Actually if you look at what a PLC does one instruction at a time a PLC isn't smart or clever.
I get a halt when I place a zero at position 13 on Control Expert. Any ideas where I went wrong?
Attached a pair of screenshots and the program ZEF in a ZIP.
I get a halt when I place a zero at position 13 on Control Expert. Any ideas where I went wrong?.
Halting when it reaches a zero is exactly what it is supposed to do.
I'm not familiar with the platform but in the second screenshot it looks like to output No_Zeros_In_N26 is ON when on that last jump through it should have turned OFF.
The ERR on the input in your first screenshot is why when I make an array I always make it larger than needed by one or 2,
EDIT: Just noticed your array is 19 long and stops at 18, it needs to be at least 20 long and include 19. That's why it ERR's.
... That's why it ERR's.
No, but you are asking the right question, and not "Why does the PLC not act like I expect it to?"
The most I could say is that the model I used for how the PLC executes ladder logic instructions in RSLogix 500 is not consistent with the one that is in Control Expert and that PLC's firmware.
Do you have any information on the cause of the halt? Are there PLC status bits that can be examined?
The only item in the Diagnostic Viewer is Watchdog overflow/System Alarm/%S11.
The PLC screen shows the last execution time was 1010 ms, whereas the watchdog is set to trip at just 250 ms. This program is sufficiently simple that its normal execution (no zeroes) is 8 ms or less.
Taking the green lines after the NE instruction I would say that is where it is faulting because after it should not be green, unless green doesn't mean "Energized because TRUE" like in A-B.