S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
163
Basic instructions
7
7.1
Bit logic
7.1.1
Bit logic contacts and coils
LAD and FBD are very effective for handling Boolean logic. While SCL is especially effective
for complex mathematical computation and for project control structures, you can use SCL
for Boolean logic.
LAD contacts
Table 7- 1
Normally open and normally closed contacts
LAD
SCL
Description
IF in THEN
Statement;
ELSE
Statement;
END_IF;
IF NOT (in) THEN
Statement;
ELSE
Statement;
END_IF;
Normally open and normally closed contacts: You can connect contacts
to other contacts and create your own combination logic. If the input bit
you specify uses memory identifier I (input) or Q (output), then the bit
value is read from the process-image register. The physical contact
signals in your control process are wired to I terminals on the PLC. The
CPU scans the wired input signals and continuously updates the
corresponding state values in the process-image input register.
You can specify an immediate read of a physical input using ":P"
following the I offset (example: "%I3.4:P"). For an immediate read, the bit
data values are read directly from the physical input instead of the
process image. An immediate read does not update the process image.
Table 7- 2
Data types for the parameters
Parameter
Data type
Description
IN
Bool
Assigned bit
●
The Normally Open contact is closed (ON) when the assigned bit value is equal to 1.
●
The Normally Closed contact is closed (ON) when the assigned bit value is equal to 0.
●
Contacts connected in series create AND logic networks.
●
Contacts connected in parallel create OR logic networks.