Edge detection instructions
888
Part III FP Instructions
ALT
Alternative out
When the mode is changed from PROG to RUN or the power is turned on in RUN mode while the
input signal is TRUE, a rising edge will not be detected for the first scan.
PLC types
Availability of ALT (see page 1318)
Be careful when programming with commands that effect the order in which a
program is carried out, e.g. jump or loop instructions within a sequential function
chart or a function block. The order of the instructions might change depending on
the time when the instruction is carried out or the input value. (Specific basic JUMP
and LOOP instructions are: MC to MCE instruction, JP to LBL instruction, F19_SJP
to LBL instruction, LOOP to LBL instruction.
Variable Data type
input BOOL
output BOOL
For Relay T/C Register Constant
i X Y R L T C - - - -
o - Y R L - - - - - -
Description
The function inverts the output condition (output o) each time the rising edge of the input signal
(input i) is detected.
Time chart
X0
Y10
Invert
Invert
Invert
ON
OFF
ON
OFF
Data types
Operands
Example
In this example, the same POU header is used for all programming languages. For an example
using IL (instruction list), please refer to the online help.
POU header
In the POU header, all input and output variables are declared that are used for programming this
function.
LD
ST
When programming with structured text, enter the following:
output_value:=(ALT(input_value));