Global Defines

Global Defines are user-generated constants to be used in a program. Global Defines let you write code and add an ifdef statement to call the Define only if it is used for a particular machine. They are created and edited from the Project Explorer toolbox under PLCClosed"Programmable Logic Controller" A Programmable Logic Controller, PLC, or Programmable Controller is a digital computer used for automation of industrial processes, such as control of machinery on factory assembly lines. Used to synchronize the flow of inputs from (physical) sensors and events with the flow of outputs to actuators and events.

Global Definitions

Figure 5-99: Global Defines

Double-click the Defines item to open your global definitions file (named: appli.eqv) in a text editor as follows:

Edit the Global Definitions

Figure 5-100: Edit the Global Definitions

Each definition must be entered on one line of text according to the following syntax:

#define   Identifier   Equivalence   (* comments *)

You may use a definition within the contents of another definition. The definition used in the second must be declared first. See example below:

#define PI      3.14

#define TWOPI (PI * 2.0)

Local definitions

Local definitions are user-created defines that are being used within the corresponding program through an ifdef statement.


  • Using definitions disturbs the program monitoring and makes error reports more complex. It is recommended to restrict the use of definitions to simple expressions to avoid misunderstandings when reading or debugging a program.