The leader in industrial automation and control solutions

Overview & Concepts

Macros in EasyBuilder Pro provide a way to implement custom logic directly within an HMI project. A macro is a script written using a C-like programming syntax that allows the HMI to perform operations such as calculations, conditional evaluations, and data manipulation. Macros are typically used when built-in objects or system functions cannot perform the required task on their own.

Macros interact with the same data used by the HMI project, including PLC registers and Local HMI memory. This allows macros to read values from connected devices, process or evaluate those values, and then write results back to registers that are used by other objects or system functions. Because of this, macros are often used to create intermediate logic that supports more complex interface behavior.

Within a macro, developers can use programming constructs such as:

  • Variables and memory registers
  • Mathematical calculations
  • Conditional statements (for example, IF / ELSE logic)
  • Data comparisons and value manipulation

Macros can be executed in several ways depending on how they are configured within the project. Common execution methods include:

  • Periodic execution – The macro runs repeatedly at a defined time interval.
  • Trigger-based execution – The macro runs when a specific register or condition changes.
  • Object-triggered execution – The macro runs when a particular object or system event occurs.

Typical applications of macros include:

  • Performing calculations or data conversions within the HMI
  • Implementing logic that evaluates multiple register values
  • Preparing or formatting data before it is displayed, logged, or transmitted
  • Coordinating interactions between different system registers or objects

By providing programmable control within the HMI environment, macros allow developers to implement customized behavior and extend the functionality of the interface beyond what can be achieved with standard configuration tools alone.