HMI Engineering · Technical Blog

HMI Buttons, Status Lamps and Auto/Manual Mode in TIA Portal

Operator controls are where the PLC program meets the person running the machine. This lesson covers momentary and toggle buttons, indicator lamps driven by real feedback, and an auto/manual mode selection that cannot be abused.

2,500+ engineers trained 4.9/5 Google rating 21+ years, Chinchwad, Pune Next batch: contact for dates
Quick answer

Use SetBitWhileKeyPressed for momentary commands, SetBit and ResetBit for latched commands, and always send the command to a PLC interface data block rather than writing directly to an output. Drive lamps from device feedback, not from the command bit, and gate manual commands with the current mode so an operator cannot fight the automatic sequence.

  • Commands go from the panel into an HMI interface DB; the PLC decides what to do with them.
  • A lamp that follows the command bit lies to the operator; drive it from feedback or a status word.
  • Mode selection must be a single source of truth in the PLC, echoed back to the panel, not stored only on the HMI.

The HMI to PLC Command Interface

A panel should never write directly to a physical output. If a button writes to Q0.0, the machine loses every interlock the PLC program provides, and a communication fault can leave an output in an unknown state.

Instead, build a small interface data block in the PLC and let the panel write only into that structure. A typical layout uses three groups:

  • Commands from HMI: Start, Stop, Reset, ModeRequest, JogForward, JogReverse.
  • Status to HMI: Running, Stopped, Faulted, ModeActive, StepNumber.
  • Values: setpoints, counters and timers exchanged as REAL or DINT.

Give the block a UDT so the same structure can be reused for every device on the machine. If you are new to structured tags, review Siemens PLC addressing and data types first.

Because the PLC evaluates commands rather than acting on them blindly, an operator pressing Start while a permissive is missing produces a message instead of an unexpected movement. The interlock logic in PLC interlocks and permissives stays in control.

Configuring Buttons and Command Events

Add a button from the toolbox, then open its Events properties. TIA Portal offers several system functions and each behaves differently.

System functionBehaviourUse for
SetBitWhileKeyPressedBit is true only while the button is heldJog, inch, hold-to-run functions
SetBitSets the bit to true and leaves itStart command reset by the PLC
ResetBitSets the bit to falseClearing a latched request
InvertBitToggles the bit each pressLamp test, screen options, never machine start
SetValueWrites a fixed number to a tagMode request, speed preset selection

For a Start command, the cleanest pattern is SetBit on the HMI and a one-shot in the PLC that acts on the rising edge and then clears the bit. The command cannot stick on if communication drops mid-press, and the panel does not need to know anything about the machine sequence.

Making buttons readable

  • Label with a verb the operator recognises: Start Conveyor, not CMD_01.
  • Keep the same button in the same screen position across all screens by placing it on the template.
  • Size touch targets for gloved hands; small buttons cause mispresses on a factory floor.
  • Use colour consistently across the whole project, and never rely on colour alone to signal state.

Status Lamps and Animation from Feedback

A status lamp answers one question: what is the machine actually doing? If the lamp is animated from the command bit, it turns green the moment the operator presses Start, even when the motor never ran. Drive it from the contactor feedback or from a status bit the PLC sets only when running is confirmed.

In TIA Portal, add a circle or a symbolic object and use Animations → Display → Appearance with the status tag. Define one range per state so the object cannot fall between definitions.

StateSource tagTypical appearance
Stopped and readyStatus.ReadyGrey or dark outline
RunningStatus.Running from feedbackGreen fill
FaultedStatus.Faulted from the fault wordRed fill with flashing enabled
Not availableStatus.Ready false and no faultDimmed with the object made non-operable

Use the Visibility and Enable animations as well. Hiding a button an operator must not press is safer than letting them press it and generating an alarm. For screen-level layout rules, see HMI screen design best practices.

Practise on a real Siemens panel

Softwell HMI sessions run on KTP Comfort panels with a live PLC, online or in the Pune classroom.

Book a Free Demo Class

Auto and Manual Mode Selection

Mode is a machine state, so it belongs in the PLC. The panel sends a mode request; the PLC decides whether the change is allowed and writes back the mode that is actually active. A conveyor running an automatic cycle should not drop into manual halfway through a transfer.

A workable pattern looks like this:

  1. The operator presses Auto or Manual; the button uses SetValue to write 1 or 2 into ModeRequest.
  2. The PLC checks that the machine is idle and no cycle is active, then sets ModeActive to the requested value.
  3. The panel displays ModeActive, not ModeRequest, so the operator sees the truth.
  4. Manual jog buttons are enabled only when ModeActive equals manual, using the Enable animation.
  5. The automatic start command is accepted by the PLC only when ModeActive equals auto.

Add a text field or text list that spells the mode out in words. A single indicator that reads Auto, Manual or Changeover Blocked removes most of the phone calls maintenance receives about a machine that will not start.

Finally, protect manual controls with a user authorisation so that only trained staff can jog a machine. The details are covered in HMI user administration and runtime settings.

Hands-On Lab: Build a Start/Stop Screen with Mode Selection

Hands-on
Before you start
  • TIA Portal with WinCC Comfort and a KTP panel or panel simulation
  • An S7-1200 or S7-1500 CPU, real or in PLCSIM, with an HMI interface DB
  • Use internal bits or lamps only; do not command a real motor for this exercise
  • Estimated time: 35 minutes
1

Create the interface DB

Add a data block with Commands, Status and Values structures and connect the panel to the PLC in Devices and Networks.

The HMI tag table shows the PLC tags with correct data types and no red connection errors.
2

Add Start and Stop buttons

Use SetBit on Start and Stop, and clear both bits in the PLC after a one-shot evaluation.

Pressing Start sets the bit for one scan and the PLC clears it automatically.
3

Add a jog button

Configure a second button with SetBitWhileKeyPressed for a jog command.

The jog bit is true only while the button is held down.
4

Animate the status lamp

Add a circle animated from Status.Running, which the PLC sets only from feedback.

The lamp stays grey when the command is present but feedback is missing.
5

Add mode selection

Add Auto and Manual buttons using SetValue on ModeRequest, display ModeActive as text, and enable the jog button only in manual.

The jog button is greyed out in auto mode and a mode change is refused while a cycle is running.
Checkpoint—how to know you did it right

Every command reaches the PLC through the interface DB, lamps follow feedback rather than commands, mode is decided by the PLC, and manual controls are disabled in automatic mode.

Frequently asked questions

Should an HMI button write directly to a PLC output?

No. Write to a command bit in an interface data block and let the PLC program apply interlocks and mode conditions before it drives any output.

What is the difference between SetBit and SetBitWhileKeyPressed?

SetBit sets the bit and leaves it set until something resets it. SetBitWhileKeyPressed holds the bit true only while the operator keeps the button pressed, which suits jog and hold-to-run functions.

Why does my lamp turn on even though the motor did not start?

The animation is almost certainly linked to the command bit. Link it to the running feedback or to a status bit the PLC sets after confirming the contactor auxiliary contact.

Where should the auto and manual mode be stored?

In the PLC. The panel sends a request and displays the active mode returned by the controller, so a communication loss or a panel restart cannot leave the machine in an unclear state.

Reviewed by Bhawesh Kumar SinghIndustrial Automation Trainer and Industry 4.0 Consultant · Softwell Automation · 21+ years industry experience

Get the full syllabus + free demo class

Share your details—a Softwell training advisor will contact you with batch dates, fees and hardware-practice options.

No spam. Used only to share course details for this enquiry.

Learn with practical industrial examples

Join live online, Pune classroom or corporate in-plant automation training.

Request Course Details
Verified learning pathway

Discuss HMI Buttons, Lamps and Mode Selection

Explore practical curriculum, software, hardware and batch options for this technology.

Content reviewed: 09 September 2026

Siemens PLC & TIA Portal Learning Path

Continue with the related Siemens PLC tutorials in this practical learning series.

  1. SCL vs Ladder Logic
  2. Upload PLC Program
  3. TIA Selection Tool
  4. Analog Input Scaling
  5. PLC Counters
  6. PLC Timers
  7. Addressing & Data Types
  8. Hardware & PLC Tags
  9. OB, FB, FC & DB
☎ Call WhatsApp ✉ Email Enquire Now