Pages

Button Push

Description

Button Push is a momentary-action button:
The value is set to true only while the button is actively pressed.
Once released, the value automatically resets to false.

This behavior makes it ideal for temporary actions or real-time interventions, such as:

  • Manual jog mode (e.g. moving a robot arm)
  • Momentary override of a process
  • Triggering pulses or toggles while pressed

Technical Details

  • Must be linked to a boolean variable
  • Works with Connection String
  • Value = true while pressed → false after release

Example: Button Push in CODESYS

This example shows how to use a Push Button connected to a BOOL variable in CODESYS.
The button sets the variable to TRUE only while it is being pressed.

IF bStartMotor THEN
    MotorOutput := TRUE;
ELSE
    MotorOutput := FALSE;
END_IF;

Explanation
bStartMotor: Controlled by the HMI. It becomes TRUE while the user holds the button.

MotorOutput: Represents the motor control or any other output.

Result: The motor is active only while the button is pressed.

MotorOutput
bStartMotor
IF bStartMotor THEN MotorOutput := TRUE; ELSE MotorOutput := FALSE; END_IF;
TRUE
BOOL
false
true
Connection String
false
true