Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

IFDEFHresAlm

  • Last UpdatedJul 11, 2025
  • 2 minute read

Based on the IFDEF macro, IFDEFHresAlm allows you to define two possible outcomes based on whether or not a specified time stamped alarm tag exists within a project at the time of compiling. The macro can be implemented anywhere a simple expression is used, including fields within relevant Plant SCADA dialogs.

The macro accepts three arguments: the first specifies the digital alarm tag that requires confirmation, the second defines the outcome if the alarm exists, the third defines the outcome if it does not exist.

Note: As different types of alarms can share the same name, you have to use a variation of IFDEF to check for the existence of alarm tags. See IFDEFAnaAlm for analog alarms or IFDEFAdvAlm for advanced alarms.

Syntax

IFDEFHresAlm(TagName, [<value if defined>], <value if not defined>)

Return Value

If the time stamped alarm tag specified in the first argument exists, the value defined by the second argument is returned. This could be a variable, expression, or constant, or the current tag value if the argument has been left blank. If the specified alarm does not exist, the variable, expression, or constant defined by the third argument is returned.

Example

! Generate tag value if time stamped alarm "TimestampedAlarm_1" is defined
! Generate an empty string if "TimestampedAlarm_1" is not defined
IFDEFHresAlm("TimestampedAlarm_1",,"")
! Generate a zero value (0) in Hidden When field if digital alarm "TimestampedAlarm_1" is defined
! Generate a true value (1) in Hidden When field if "TimestampedAlarm_1"
is not defined
IFDEFHresAlm("TimestampedAlarm_1",0,1)

For more examples of how to use the IFDEF macro, go to the Knowledge Base page on the AVEVA™ Knowledge & Support Center and search for article 000027848 IFDEF() Generic Genie Enhancement.

IFDEF, IFDEFAnaAlm, IFDEFDigAlm, IFDEFAdvAlm

See Also

Macro Arguments

Using Cicode Macros

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in