drbitboy, I have highlighted in red above some statements that are inaccurate, and could be misleading.
The output bits in the output data-table do NOT get turned off while you are in program mode, they stay at their last value.
Data transfer to the output module(s) is halted, and it is the output modules themselves that turn the physical outputs off when the controller is not in a [RUN] mode. This is true for all PLC and SLC/Micrologix controllers.
However, Logix5000 series output modules are capable of being configured so that the outputs go off, hold last state, or come on when the controller is not in a [RUN] mode. Similarly if the output module loses communication with the controller. All of that configuration is per bit, not the whole module.
EDIT : You appear to be confused between Pre-Scan, and First-Scan.
Pre-Scan is NOT a routine you can program code for. It is an entirely automatic scan of the user code, prior to going into [RUN] mode, during which all Non-Retentive data is reset to default states. Bits referenced by OTE's are rest to zero, Timers (TON and TOF) are reset, File handling Instructions are reset, One-Shot storage bits are turned ON. Pre-Scan is triggered by the controller attempting to go into [RUN] mode, whether that is by a mode-change [PROG] to [RUN], or the controller re-starting after a power-down. During the Pre-Scan, no code is actually executed, it is just "scanned", and the resetting of non-retentive data takes place.
First-Scan is simply a status bit you can look at, and do anything you want with it. You could call a subroutine to "initialise" things. You could set an alarm bit so you know the controller has been re-started. Or you could use that bit to place all running sequences into a "Hold" state, nothing should re-start automatically, unless it is imperative to do so, an example may be forced ventilation fans for instance.
Yes, Thanks.