Mastering PLC Logic: The Single-Button (Toggle) Start/Stop Challenge
- Mehmet Kucur
- 6 Ara
- 2 dakikada okunur
This comprehensive guide explains the solution to a common PLC programming interview question: implementing a Single-Button (Toggle) Start/Stop System using only one momentary input button. The logic is based on the four-stage memory bit chain method shown in your Siemens TIA Portal Ladder Logic screenshots.
⚙️ System Operation Principle
This solution uses one physical momentary input (I0.0 "start") to sequentially switch the state of an output (e.g., a motor or lamp) between ON and OFF. To achieve this, a chain of internal Auxiliary Memory Bits (Memory Bits) is used to track the system's current state.
The system cycles through four distinct states upon consecutive button presses:
State 1 (OFF): Button is pressed $\rightarrow$ Motor starts (Switches ON).
State 2 (ON): Button is pressed again $\rightarrow$ Motor continues running (Intermediate state).
State 3 (ON): Button is pressed again $\rightarrow$ Motor continues running (Intermediate state).
State 4 (ON): Button is pressed again $\rightarrow$ Motor stops (Switches OFF, resetting the cycle).
These four states are managed by four different auxiliary memory bits: M0.0 through M0.3.
💻 Ladder Logic Implementation (Based on TIA Portal Screenshots)
The solution consists of four Networks for the logic control and a final Network for the output control.
Network 1: Auxiliary Memory 1 (M0.0 "m1")
Function: This is the initial memory bit that latches the output ON upon the first press.
Logic: M0.0 is SET when the I0.0 "start" button is pressed AND the cycle is not near its end (NC contacts of M0.3 "m4" and M0.1 "m2" are closed). M0.0 also uses its own NO contact to seal itself in (latching), provided M0.1 is not active.
Network 2: Auxiliary Memory 2 (M0.1 "m2")
Function: Latching this bit triggers the RESET of M0.0.
Logic: M0.1 is SET when I0.0 "start" is pressed AND M0.0 "m1" is already SET. M0.1 then latches itself in. The normally closed (NC) contact of M0.1 in Network 1 breaks the seal-in of M0.0, resetting it.
Network 3: Auxiliary Memory 3 (M0.2 "m3")
Function: Latching this bit triggers the RESET of M0.1.
Logic: M0.2 is SET when I0.0 "start" is pressed AND M0.1 "m2" is SET. M0.2 then latches itself in. The NC contact of M0.2 in Network 2 resets M0.1.
Network 4: Auxiliary Memory 4 (M0.3 "m4")
Function: This is the final stage that performs the system RESET.
Logic: M0.3 is momentarily SET when I0.0 "start" is pressed AND M0.2 "m3" is SET. This bit's activation (via the NC contact of M0.3 in Network 1 and 2) resets all active memory bits, returning the system to State 1 (OFF). This bit does not use a seal-in and is immediately reset in the next scan cycle.
Network 5: Output Control (Q0.0 Motor)
Function: Controls the final output (e.g., motor).
Logic: The output Q0.0 "motor" is energized when M0.0 "m1" is SET AND the system is not in the final reset stage (NC contact of M0.3 "m4"). This ensures the motor runs during the 1st, 2nd, and 3rd states and is turned OFF on the 4th press.
This chain logic effectively creates a state machine using simple latches and resets to cycle through four states with a single momentary input, successfully implementing the single-button toggle function.



Yorumlar