Controller States and Output Behavior

Introduction

The Modicon M241 Logic Controller defines output behavior in response to commands and system events in a way that allows for greater flexibility. An understanding of this behavior is necessary before discussing the commands and events that affect controller states. For example, typical controllers define only two options for output behavior in stop: fallback to default value or keep current value.

The possible output behaviors and the controller states to which they apply are:

oManaged by Application Program

oKeep current values

oSet all outputs to default

oHardware Initialization Values

oSoftware Initialization Values

oOutput Forcing

Managed by Application Program

Your application program manages outputs normally. This applies in the RUNNING and RUNNING with External Error Detected states.

NOTE: An exception to this is if the RUNNING with External Error Detected state has been provoked by a I/O expansion bus error. For more information, refer to I/O Configuration General Description.

Keep Current Values

Select this option by choosing Controller Editor > PLC settings > Behavior for outputs in Stop > Keep current values. To access the Controller Editor, right-click on the controller in the device tree and select Edit Object.

This output behavior applies in the STOPPED controller state. It also applies to CAN bus in the HALT controller state. Outputs are set to and maintained in their current state, although the details of the output behavior vary greatly depending on the setting of the Update I/O while in stop option and the actions commanded via configured fieldbusses. Refer to Controller States Description for more details on these variations.

NOTE: The Keep current values setting does not apply to PTO, PWM, FreqGen (frequency generator), and HSC reflex outputs. These outputs are always set to 0 when the controller passes to the STOPPED state, irrespective of the Keep current values setting.

Set All Outputs to Default

Select this option by choosing Controller Editor > PLC settings > Behavior for outputs in Stop > Set all outputs to default. To access the Controller Editor, right-click on the controller in the device tree and select Edit Object.

This output behavior applies:

owhen the controller is going from RUN state to STOPPED state.

oif the controller is going from RUN state to HALT state.

oafter application download.

oafter reset warm/cold command.

oafter a reboot.

It also applies to CAN bus in the HALT controller state. Outputs are set to and maintained in their current state, although the details of the output behavior vary greatly depending on the setting of the Update I/O while in stop option and the actions commanded via configured fieldbusses.Refer to Controller States Description for more details on these variations.

The outputs driven by a PTO, PWM, FreqGen, and HSC expert functions will not apply the default value.

Hardware Initialization Values

This output state applies in the BOOTING, EMPTY (following power cycle with no boot application or after the detection of a system error), and INVALID_OS states.

In the initialization state, analog, transistor, and relay outputs assume the following values:

oFor an analog output: Z (high impedance)

oFor a fast transistor output: Z (high impedance)

oFor a regular transistor output: 0 Vdc

oFor a relay output: Open

Software Initialization Values

This output state applies when downloading or when resetting the application. It applies at the end of the download or at the end of a reset warm or cold.

The software Initialization Values are the initialization values of outputs images (%I, %Q, or variables mapped on %I or %Q).

By default, they are set to 0 but it is possible to map the I/O in a GVL and assign to the outputs a value different than 0.

Output Forcing

The controller allows you to force the state of selected outputs to a defined value for the purposes of system testing, commissioning, and maintenance.

You are only able to force the value of an output while your controller is connected to EcoStruxure Machine Expert.

To do so, use the Force values command in the Debug menu.

Output forcing overrides all other commands (except write immediate) to an output irrespective of the task programming that is being executed.

When you logout of EcoStruxure Machine Expert when output forcing has been defined, you are presented with the option to retain output forcing settings. If you select this option, the output forcing continues to control the state of the selected outputs until you download an application or use one of the Reset commands.

When the option Update I/O while in stop, if supported by your controller, is checked (default state), the forced outputs keep the forcing value even when the logic controller is in STOP.

Output Forcing Considerations

The output you wish to force must be contained in a task that is currently being executed by the controller. Forcing outputs in unexecuted tasks, or in tasks whose execution is delayed either by priorities or events has no effect on the output. However, once the task that had been delayed is executed, the forcing takes effect at that time.

Depending on task execution, the forcing could impact your application in ways that may not be obvious to you. For example, an event task could turn on an output. Later, you may attempt to turn off that output but the event is not being triggered at the time. This would have the effect of the forcing being apparently ignored. Further, at a later time, the event could trigger the task at which point the forcing would take effect.

 

The outputs driven by a PTO, PWM, FreqGen, and HSC expert functions cannot be forced.

Warning_Color.gifWARNING

UNINTENDED EQUIPMENT OPERATION

oYou must have a thorough understanding of how forcing will affect the outputs relative to the tasks being executed.

oDo not attempt to force I/O that is contained in tasks that you are not certain will be executed in a timely manner, unless your intent is for the forcing to take affect at the next execution of the task whenever that may be.

oIf you force an output and there is no apparent affect on the physical output, do not exit EcoStruxure Machine Expert without removing the forcing.

Failure to follow these instructions can result in death, serious injury, or equipment damage.