Edge
(Engine-Level Function)
Description: | Performs a test for a rising or falling edge. |
Returns: | Boolean |
Usage: | Steady State only. |
Function Groups: | Generic Math, Variable |
Related to: | Change |
Format: | Edge(Value, Mode) |
Parameters: |
Value |
Required. Any expression giving a numeric status value to be tested. It is interpreted as true if it is non-zero, and false if it is zero. |
Mode |
Required. Dictates whether the change from false to true or true to false is tested. If it is 0, a true to false (a falling edge) is tested. If it is 1, a false to true (a rising edge) is tested. |
Comments: | Edge is one of the Latching and Resetting functions. Use accordingly. |
Example 1:
If Edge(Var1 > 2, 1) NextState;
Example 2:
Latch(AbsTime(1, 10, 0), AbsTime(1, 10, 5))
When the current time reaches a multiple of 10 seconds, the value of the expression will change to 1.
When the current time reaches a multiple of 10 seconds plus 5 (that is, five seconds later) the value of the expression will change to 0.