Actions

Difference between revisions of "%chg"

From Zenitel Wiki

(Examples)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{AI}}  
 
{{AI}}  
The '''%udd''' macro is used in the [[Event Handler]] to read the value of an [[UDD]] (User Defined Data variable). [[Event_Handler#Formating|Text formatting parameters]] can be added at the end. <br>
+
The '''%chg''' macro is used in the [[Event Handler]], and will return one value when the event goes ON, and another value when the event goes OFF. <br>
From AMC 11.02 also alphanumeric labeling can be used. Alphanumeric labeling will be cleared after reset.
+
 
 
===Syntax===
 
===Syntax===
 
'''%chg(ON_txt,OFF_txt)'''  
 
'''%chg(ON_txt,OFF_txt)'''  
Line 8: Line 8:
  
 
===Examples===
 
===Examples===
'''LOG “Door %1.dir is %chg(OPEN ,CLOSED)“'''
+
Example 1:
Result, event ON: - “Door 123 is OPEN
+
LOG "Door %1.dir is %chg(OPEN ,CLOSED)"
Result, event OFF: - “Door 123 is CLOSED”
+
*Result in System Log when event goes ON: - "Door 123 is OPEN"
 +
*Result in System Log when event goes OFF: - "Door 123 is CLOSED"
  
=== See also ===
 
  
'''Applications were UDD are used:'''
+
Example 2:
* [[CCTV control by relays (RCO) when using Call Request]]
+
IF %chg(1,0)
 +
LOG "Event goes ON"
 +
stop
 +
ENDIF
 +
LOG "Event goes OFF"
  
'''Related articles:'''
 
* Built-in command to write to UDD: [[WUDD]]
 
*Data message to write to UDD: [[WRITE_USER_DEF_DATA|$WUDD]]
 
*Variable for text string: [[tmp statement|tmp]]
 
  
  

Latest revision as of 14:28, 16 December 2020

AI.png

The %chg macro is used in the Event Handler, and will return one value when the event goes ON, and another value when the event goes OFF.

Syntax

%chg(ON_txt,OFF_txt)

Returns "ON_txt" when the event goes ON, "OFF_txt" when the event goes OFF

Examples

Example 1:

LOG "Door %1.dir is %chg(OPEN ,CLOSED)"
  • Result in System Log when event goes ON: - "Door 123 is OPEN"
  • Result in System Log when event goes OFF: - "Door 123 is CLOSED"


Example 2:

IF %chg(1,0)
LOG "Event goes ON"
stop
ENDIF
LOG "Event goes OFF"


Back to Event_Handler#List_of_macros.