Introduction
Start-stop motor control lets you turn a motor on and off safely using simple buttons. It helps control machines easily and prevents accidents.
Start Button (I0.0) --| |-- + Motor Output (Q0.0) Stop Button (I0.1) --|/|-- Motor Output (Q0.0) --| |-- (Seal-in contact)
LD I0.0 AND NOT I0.1 OR Q0.0 = Q0.0
(* Start-Stop Motor Control in Structured Text *)
IF StartButton AND NOT StopButton THEN
Motor := TRUE;
ELSIF StopButton THEN
Motor := FALSE;
END_IF;(* Simple Start-Stop Motor Control in Structured Text *) VAR StartButton : BOOL; (* Input: Start button *) StopButton : BOOL; (* Input: Stop button *) Motor : BOOL; (* Output: Motor control *) END_VAR (* Logic: Motor starts when StartButton pressed and StopButton not pressed. Motor stays on until StopButton pressed. *) IF StartButton AND NOT StopButton THEN Motor := TRUE; ELSIF StopButton THEN Motor := FALSE; END_IF; (* Simulate pressing StartButton and StopButton *) StartButton := TRUE; StopButton := FALSE; (* Run logic *) IF StartButton AND NOT StopButton THEN Motor := TRUE; ELSIF StopButton THEN Motor := FALSE; END_IF; (* Output motor state *) (* Print result *) (* In real PLC, Motor output controls the motor coil *) (* Here we just show the Motor variable value *)
Start NO ---[ ]---+---( ) Motor
Stop NC ----[ ]---|
Motor ---[ ]-------+
Pass the test and this pattern moves unknown