Cicode Programming Reference > Using Cicode Macros > IFDEFAnaAlm

IFDEFAnaAlm

Based on the IFDEF macro, IFDEFAnaAlm allows you to define two possible outcomes based on whether or not a specified analog 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 CitectSCADA dialogs.

The macro accepts three arguments: the first specifies the analog 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 IFDEFDigAlm for digital alarms, or IFDEFAdvAlm for advanced alarms.

Syntax

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

Return Value

If the analog 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.

See Also

IFDEF, IFDEFDigAlm, IFDEFAdvAlm

Example

! Generate tag value if analog alarm "AnaAlarm_1" is defined
! Generate an empty string if "AnaAlarm_1" is not defined
IFDEFAnaAlm("AnaAlarm_1",,"")
! Generate a zero value (0) in Hidden When field if analog alarm "AnaAlarm_1" is defined
! Generate a true value (1) in Hidden When field if "AnaAlarm_1" is not defined
IFDEFAnaAlm("AnaAlarm_1",0,1)

For further examples of how to implement the IFDEF macro, see the CitectSCADA Knowledge Base article Q3461.

See Also

IFDEF, IFDEFDigAlm, IFDEFAdvAlm