DISCLAIMER: I haven't been following this thread closely – basically I have just skimmed over it now and then ...
even so, it appears that some of the folks posting here are suffering from some common misconceptions on how the ONS instruction works in RSLogix5000 ... maybe I can help clear some of these up ... (NOTE: the example I'm posting here is being run on the Version 16 Emulator which is the only thing I have available for testing right now ...)
the MainRoutine shown in the screen shot below is chugging right along – as proven by the rapidly increasing value stored in COUNT_MAIN_ROUTINE_SCANS ...
Rung 1 in the MainRoutine is being executed as TRUE – and is thus activating ("calling") Routine_A once for each time that the processor scans the MainRoutine ...
many programmers would expect the value stored in COUNT_ROUTINE_A_SCANS to increase – as the ADD instruction is expected to increment that value for each scan of the rung ...
but note that the value stored in COUNT_ROUTINE_A_SCANS does NOT change – as shown in the circled Destination of the ADD instruction ...
POINT OF THE POST: here's where some common misconceptions come into play ...
(1) the ONS instruction is highlighted "GREEN ON THE SCREEN" – that should mean that the ONS is currently TRUE – doesn't it? ... NO ... that is a common misconception ...
in simplest terms, the "GREEN ON THE SCREEN" highlight does NOT always signify that an instruction/condition is TRUE - or that it is "ACTIVE" ...
(2) as shown in the circled Value of the ToolTip, the ONS instruction's tag (ONS_FOR_ROUTINE_A) contains the value of 1 – the value of 1 means the same thing as TRUE - doesn't it? ... NO ... that is another common misconception ...
SUMMING UP FOR NOW: the ONS instruction in Rockwell products does NOT always do what we THINK it should do – nor does it always do what we EXPECT it to do ... and just for completeness let me say that the ONS and OSR instructions in other Rockwell platforms (RSLogix500/SLC/MicroLogix, etc.) have some DIFFERENT quirks when compared to the ControlLogix/CompactLogix platform being discussed here ...
FINALLY (and IMPORTANTLY): this post isn't intended to help "solve the Original Poster's problem ... I'm just trying to get everyone on the same "apples to apples" or "oranges to oranges" page ... hopefully that would help move the discussion along ... even more helpful would be posting the actual programming code ...
peace to all ...
.