100BBasic instructions
7.1 Bit logic
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
169
LAD
FBD
SCL
Description
Not available LAD: The assigned bit "OUT" is TRUE when a positive transition (OFF-to-
ON) is detected on the power flow entering the coil. The power flow in
state always passes through the coil as the power flow out state. The P
coil can be located anywhere in the network.
FBD: The assigned bit "OUT" is TRUE when a positive transition (OFF-to-
ON) is detected on the logic state at the box input connection or on the
input bit assignment if the box is located at the start of a branch. The input
logic state always passes through the box as the output logic state. The
P= box can be located anywhere in the branch.
Not available LAD: The assigned bit "OUT" is TRUE when a negative transition (ON-to-
OFF) is detected on the power flow entering the coil. The power flow in
state always passes through the coil as the power flow out state. The N
coil can be located anywhere in the network.
FBD: The assigned bit "OUT" is TRUE when a negative transition (ON-to-
OFF) is detected on the logic state at the box input connection or on the
input bit assignment if the box is located at the start of a branch. The input
logic state always passes through the box as the output logic state. The
N= box can be located anywhere in the branch.
1
For SCL: You must write code to replicate this function within your application.
Table 7- 15 P_TRIG and N_TRIG instructions
LAD / FBD
SCL
Description
Not available
The Q output power flow or logic state is TRUE when a positive transition
(OFF-to-ON) is detected on the CLK input state (FBD) or CLK power flow
in (LAD).
In LAD, the P_TRIG instruction cannot be located at the beginning or end
of a network. In FBD, the P_TRIG instruction can be located anywhere
except the end of a branch.
Not available
The Q output power flow or logic state is TRUE when a negative transition
(ON-to-OFF) is detected on the CLK input state (FBD) or CLK power flow
in (LAD).
In LAD, the N_TRIG instruction cannot be located at the beginning or end
of a network. In FBD, the N_TRIG instruction can be located anywhere
except the end of a branch.
1
For SCL: You must write code to replicate this function within your application.
Table 7- 16 Data types for the parameters (P and N contacts/coils, P=, N=, P_TRIG and N_TRIG)
Parameter
Data type
Description
M_BIT
Bool
Memory bit in which the previous state of the input is saved
IN
Bool
Input bit whose transition edge is to be detected
OUT
Bool
Output bit which indicates a transition edge was detected
CLK
Bool
Power flow or input bit whose transition edge is to be detected
Q
Bool
Output which indicates an edge was detected