Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Declaratio Data
type
n
S7-1200
Input
I, Q, M, D, L
BOOL
Memory area
S71500
I, Q, M, D, L, T, C
Description
Operand
whose
signal state is
queried.
Example
The following example shows how the instruction works:
The "TagOut" operand is set when one of the following conditions is fulfilled:
The operands "TagIn_1" and "TagIn_2" have signal state "1".
Declaration
Data type
S7-1200
<Operand>
Input
BOOL
I, Q, M, D, L
Example
The following example shows how the instruction works:
Memory area
S7-1500
I, Q, M, D, L, T, C
Operand
whose signal
state is
queried.
The "TagOut" operand is set when one of the following conditions is fulfilled:
The operands "TagIn_1" and "TagIn_2" have signal state "1".
Declaration
Data type
Memory area
Description
<Operand>
Output
BOOL
I, Q, M, D, L
Operand to which
the RLO is
assigned.
Example
The following example shows how the instruction works:
The "TagOut_1" operand is set when one of the following conditions is fulfilled:
The operands "TagIn_1" and "TagIn_2" have signal state "1".
The signal state of the operand "TagIn_3" is "0".
The "TagOut_2" operand is set when one of the following conditions is fulfilled:
Operands "TagIn_1", "TagIn_2", and "TagIn_4" have signal state "1".
The signal state of the "TagIn_3" operand is "0" and the signal state of the "TagIn_4" operand is "1".
Declaration
Data type
Memory area
Description
<Operand>
Output
BOOL
I, Q, M, D, L
Operand to which
the RLO is
assigned.
Example
The following example shows how the instruction works:
Declaration
Data type
Memory area
S7-1200
<Operand>
M, D, L, T,
Output
BOOL
S7-1500
Description
I, Q, M, D, L
I, Q,
Operand that is
reset when RLO
= "1".
Example
The following example shows how the instruction works:
Declaration
Data type
Memory area
Description
<Operand>
Output
BOOL
I, Q, M, D, L
Operand which is
set
Example
The following example shows how the instruction works:
The "TagOut" operand is set when one of the following conditions is fulfilled:
The operands "TagIn_1" and "TagIn_2" have signal state "1".
Declaration
Output
Data type
BOOL
Memory area
I, Q, M
In the case of a
DB or an IDB, an
element of an
ARRAY[..] of
BOOL
<Operand1>
of bits to be
Input
UINT
Constant
Number
set.
Example
The following example shows how the instruction works:
If the operands "TagIn_1" and "TagIn_2" have the signal state "1", 5 bits are set starting at the address of the
operand
"MyDB".MyBoolArray[4]
Declaration
Output
Data type
BOOL
Memory area
I, Q, M
In the case of a
DB or an IDB, an
element of an
ARRAY[..] of
BOOL
<Operand1>
Input
UINT
Constant
Number of bits to
be reset.
Example
The following example shows how the instruction works:
If the operands "TagIn_1" and "TagIn_2" have the signal state "1", 5 bits are reset starting at the address of
the operand
"MyDB".MyBoolArray[4]
The current signal state of the operand is transferred to output Q and can be queried there.
Parameter
The following table shows the parameters of the "Set/reset flip-flop" instruction:
Parameter
Declaration
Data type
Memory area
Description
S7-1200
S7-1500
I, Q, M, D,
L
I, Q, M, D,
L
I, Q, M, D, L
Enable setting
I, Q, M, D, L,
T, C
Enable
resetting
Input
BOOL
R1
Input
BOOL
<Operand>
InOut
BOOL
I, Q, M, D,
L
I, Q, M, D, L
Operand that
is set or
reset.
Output
BOOL
I, Q, M, D,
L
I, Q, M, D, L
Signal state
of the
operand
Example
The following example shows how the instruction works:
The operands "TagSR" and "TagOut" are set when the following conditions are fulfilled:
The operand "TagIn_1" has the signal state "1".
The operand "TagIn_2" has the signal state "0".
The operands "TagSR" and "TagOut" are reset when one of the following conditions is fulfilled:
The operand "TagIn_1" has signal state "0" and the operand "TagIn_2" has signal state "1".
Parameter
The following table shows the parameters of the "Reset/set flip-flop" instruction:
Parameter
Declaration
Data type
Memory area
S7-1200
S7-1500
I, Q, M, D,
L
I, Q, M, D,
L
I, Q, M, D, L
Description
Input
BOOL
S1
Input
BOOL
<Operand>
InOut
BOOL
I, Q, M, D,
L
I, Q, M, D, L
Operand that
is reset or
set.
Output
BOOL
I, Q, M, D,
L
I, Q, M, D, L
Signal state
of the
operand
I, Q, M, D, L,
T, C
Enable
resetting
Enable setting
Example
The following example shows how the instruction works:
The operands "TagRS" and "TagOut" are reset when the following conditions are fulfilled:
The operand "TagIn_1" has the signal state "1".
The operand "TagIn_2" has the signal state "0".
The operands "TagRS" and "TagOut" are set when one of the following conditions is fulfilled:
The operand "TagIn_1" has signal state "0" and the operand "TagIn_2" has signal state "1".
Note
The address of the edge memory bit must not be used more than once in the program, otherwise the bit
memory is
overwritten. This step influences the edge evaluation and the result is therefore no longer unique. The
memory area of
the edge memory bit must be located in a DB (static area for FB) or in the bit memory area.
Parameter
The following table shows the parameters of the "Scan operand for positive signal edge" instruction:
Parameter
Declaration
Data type
S7-1200
<Operand1>
<Operand2>
Input
InOut
BOOL
BOOL
I, Q, M, D, L
I, Q, M, D, L
Memory area
Description
S7-1500
I, Q, M, D, L, T, C
Signal to
be
scanned
I, Q, M, D, L
Edge
memory bit
in which the signal
state of the
previous query is
saved.
Example
The following example shows how the instruction works:
Note
The address of the edge memory bit must not be used more than once in the program, otherwise the bit
memory is
overwritten. This step influences the edge evaluation and the result is therefore no longer unique. The
memory area of
the edge memory bit must be located in a DB (static area for FB) or in the bit memory area.
Parameter
The following table shows the parameters of the "Scan operand for negative signal edge" instruction:
Parameter
Description
Declaration
Data type
Memory area
S7-1200
S7-1500
<Operand1>
Input
BOOL
I, Q, M, D, L
I, Q, M, D, L, T, C
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 query is
saved.
Example
The following example shows how the instruction works:
There is a negative signal edge at operand "TagIn_4". The signal state of the previous scan is stored in
the edge memory bit "Tag_M".
The signal state of the operand "TagIn_5" is "1".
The address of the edge memory bit must not be used more than once in the program, otherwise the
bit memory is overwritten. This step influences the edge evaluation and the result is therefore no
longer unique. The memory area of the edge memory bit must be located in a DB (static area for FB) or
in the bit memory area.
Parameter
The following table shows the parameters of the "Set operand on positive signal edge" instruction:
Parameter
Declaration
Data type
Memory area
Description
<Operand1>
Output
BOOL
I, Q, M, D, L
Operand which is
set by a positive
edge.
<Operand2>
InOut
BOOL
I, Q, M, D, L
Example
The following example shows how the instruction works:
Operand "TagOut" is set for one program cycle, when the signal state at the input of the coil switches from
"0" to "1" (positive signal edge). In all other cases, the operand "TagOut" has the signal state "0".
Parameter
The following table shows the parameters of the "Set operand on negative signal edge" instruction:
Parameter
Description
Declaration
Data type
Memory area
<Operand1>
Output
BOOL
I, Q, M, D, L
<Operand2>
InOut
BOOL
I, Q, M, D, L
Operand which is
by a negative
set
edge.
Edge memory bit
Example
The following example shows how the instruction works:
Operand "TagOut" is set for one program cycle, when the signal state at the input of the coil switches from
"1" to
"0" (negative signal edge). In all other cases, the operand "TagOut" has the signal state "0".
Parameter
The following table shows the parameters of the "Scan RLO for positive signal edge" instruction:
Parameter
Declaration
CLK
Input
<Operand>
InOut
Output
Example
Data type
Memory area
BOOL
I, Q, M, D,
BOOL
L M, D
BOOL
I, Q, M, D, L
Description
Current RLO
Edge memory bit
in
which the RLO of
the
previous query is
saved.
Result of
edge
evaluation
The RLO of the previous query is saved in the edge memory bit "Tag_M". If a "0" to "1" change is detected in
the signal state of the RLO, the program jumps to jump label CAS1.
Parameter
The following table shows the parameters of the "Scan RLO for negative signal edge" instruction:
Parameter
Declaration
CLK
Input
<Operand>
InOut
Output
Data type
Memory area
BOOL
I, Q, M, D,
BOOL
L M, D
BOOL
I, Q, M, D, L
Example
The following example shows how the instruction works:
Description
Current RLO
Edge memory bit
in
which the RLO of
the
previous query is
saved.
Result of
edge
evaluation
The RLO of the previous query is saved in the edge memory bit "Tag_M". If a "1" to "0" change is detected in
the signal state
of the RLO, the program jumps to jump label CAS1.
Declaration
Data type
Memory area
Description
EN
Input
BOOL
I, Q, M, D, L
Enable input
ENO
Output
BOOL
I, Q, M, D, L
Enable output
CLK
Input
BOOL
I, Q, M, D, L
or constant
Incoming signal
whose edge will
be queried.
Output
BOOL
I, Q, M, D, L
Result of
edge
evaluation
Example
The following example shows how the instruction works:
The RLO of the preceding query is saved in the instance DB "R_TRIG_DB". If a change is the signal state of
the RLO from "0" to "1" is detected in the operands "TagIn_1" and "TagIn_2" or in the operand "TagIn_3",
the output "TagOut_Q" has signal state "1".
Declaration
Data type
Memory area
Description
EN
Input
BOOL
I, Q, M, D, L
Enable input
ENO
Output
BOOL
I, Q, M, D, L
Enable output
CLK
Input
BOOL
I, Q, M, D, L
or constant
Incoming signal
whose edge will
be queried.
Output
BOOL
I, Q, M, D, L
Result of
edge
evaluation
Example
The following example shows how the instruction works:
Page 17 of 17
The RLO of the preceding query is saved in the instance DB "F_TRIG_DB". If a change is the signal state of
the RLO from "1" to "0" is detected in the operands "TagIn_1" and "TagIn_2" or in the operand "TagIn_3",
the output "TagOut_Q" has signal state "1".