Description
You can use the "Scan operand for negative signal edge" instruction to determine whether there is a "1" to "0" change in the signal state of a specified operand (<Operand1>). The instruction compares the current signal state of <Operand1> with the signal state of the previous scan, which is saved in an edge memory bit (<Operand2>). If the instruction detects a change in the result of logic operation (RLO) from "1" to "0", there is a negative, falling edge.
The following figure shows the change in the signal state in case of a negative and a positive signal edge:
The negative signal edge is queried each time the instruction executes. When a negative signal edge is detected, <Operand1> is set to signal state "1" for one program cycle. In all other cases, the operand has the signal state "0".
Specify the operand to be queried (<Operand1>) in the operand placeholder above the instruction. Specify the edge memory bit (<Operand2>) in the operand placeholder below the instruction.
|
Note Modification of the address of the edge memory bit The address of the edge memory bit must not be used more than once in the program, otherwise the bit memory is overwritten. This would influence edge evaluation and the result would no longer be unequivocal. The memory area of the edge memory bit has to be located in a DB (static area for FB) or in the bit memory area. |
Parameters
The following table shows the parameters of the "Scan operand for negative signal edge" instruction:
|
Parameters |
Declaration |
Data type |
Memory area |
Description |
|
|---|---|---|---|---|---|
|
S7-1200 |
S7-1500 |
||||
|
<Operand1> |
Input |
BOOL |
I, Q, M, D, L or constant |
I, Q, M, D, L, T, C or constant |
Signal to be scanned |
|
<Operand2> |
InOut |
BOOL |
I, Q, M, D, L |
I, Q, M, D, L |
Edge memory bit in which the signal state of the previous scan is saved. |
Example
The following example shows how the instruction works:
The "TagOut" output is set when the following conditions are fulfilled:
-
There is a falling edge at input "TagIn_1".
-
The signal state of the operand "TagIn_2" is "1".