Back to examples

Program notes

Auto / Manual Mode

Select a command source, block mode conflicts, and form one equipment control output.

1. What the Program Does

This example selects automatic or manual control. Auto_Mode and Manual_Mode choose the command source; logic blocks prevent a conflict when both modes are active.

Drive_Command turns on only when exactly one mode is selected and that mode's command is active.

Auto_Command or Manual_Command → mode check → Drive_Command

2. Example Signals

SignalTypePurpose
Auto_ModeInputAutomatic mode selected
Manual_ModeInputManual mode selected
Auto_CommandInputCommand from automatic logic
Manual_CommandInputOperator command
Mode_ConflictOutputBoth modes selected
Drive_CommandOutputFinal control command

3. Main Logic

First detect the conflict, then invert it to form a common permissive. Each command passes only through its selected mode and only when there is no conflict:

Mode_Conflict = Auto_Mode AND Manual_Mode
No_Conflict = NOT Mode_Conflict
Auto_Allowed = Auto_Mode AND Auto_Command AND No_Conflict
Manual_Allowed = Manual_Mode AND Manual_Command AND No_Conflict
Drive_Command = Auto_Allowed OR Manual_Allowed

4. Testing in the Simulator

  • Activate Auto_Mode and Auto_Command: Drive_Command becomes TRUE.
  • Clear Auto_Mode, then activate Manual_Mode and Manual_Command: control moves to manual mode.
  • Activate both modes: Mode_Conflict becomes TRUE and Drive_Command must be FALSE.
  • Change commands without selecting a mode: the output must remain off.
  • Verify that a conflict blocks both command sources.

5. What to Watch For

Simply combining the commands with OR is insufficient. Explicitly verify that only one source is selected; otherwise both sources could influence the output simultaneously.

On real equipment, mode selection often comes from a key switch, HMI, or operator panel. Conflict detection exposes an invalid input configuration.

Check in editor

Open the ready-made FBD diagram, toggle inputs, and compare the simulation behavior with the program notes. The JSON is also available as a direct download.