Page 102 - Programmable Logic Controllers, Fifth Edition
P. 102
Sensor 1 Sensor 2 SOL 1 Symbol Examine if closed (XIC)
Examine-on
Bit 15 14 13 12 11 10 98 76 54 32 10
Sensor 3 Sensor 4 Sensor 5 number
1 Status
I:1/4
Ladder diagram (LD) program
Instruction interpreted
IF Sensor_1 AND Sensor_2 THEN as true
SOL_1 := 1; I:1/4
ELSEIF Sensor_3 AND Sensor_4 AND NOT Sensor_5 THEN
SOL_1 := 1;
END_IF;
15 14 13 12 11 10 98 76 54 32 10
Structured text (ST) program 0
Figure 5-19 PLC ladder and equivalent structured text I:1/4
program.
Instruction interpreted
Structured text is a high-level text language primarily I:1/4 as false
used to implement complex procedures that cannot be
easily expressed with graphical languages. Structured text Figure 5-20 Examine If Closed (XIC) instruction.
uses statements to define what to execute. Figure 5-19 il-
lustrates how structured text and ladder diagram program-
ming could be used to produce the same logical output.
For this application, the objective is to energize SOL 1 relay contacts. Instead, they operate as commands that
whenever either one of the two following circuit condi- examine the value (0 or 1) of a bit of data to determine
tions exists: its true or false logical condition.
The symbol for the Examine If Closed (XIC) instruc-
• Sensor 1 and Sensor 2 switches are both closed. tion is shown in Figure 5-20. The XIC instruction is also
• Sensor 3 and Sensor 4 switches are both closed and called the Examine-on instruction. Associated with each
Sensor 5 switch is open. XIC instruction is a memory bit linked to the status of
an input device or an internal logical condition in a rung.
This instruction asks the PLC’s processor to examine if
5.4 Bit-Level Logic Instructions the contact is closed. It does this by examining the bit at
The ladder diagram language is basically a symbolic set the memory location specified by the address in the fol-
of instructions used to create the controller program. Bit- lowing manner:
level symbolic instructions fall into two separate catego- • The memory bit is set to 1 or 0 depending on the
ries: instructions that examine data and instructions that status of the input (physical) device or internal
control data. Each symbolic instruction is a command ( logical) relay address associated with that bit.
to perform a specific operation. These ladder instruction
symbols are arranged to obtain the desired control logic • A 1 corresponds to a true status or on condition.
that is to be entered into the memory of the PLC. • A 0 corresponds to a false status or off condition.
Representations of contacts and coils are the basic • When the Examine-on instruction is associated
symbols of the logic ladder diagram instruction set. The with a physical input, the instruction will be set to
three fundamental symbols that are used to translate 1 when a physical input is present (voltage is ap-
relay control logic to contact symbolic logic are Exam- plied to the input terminal), and 0 when there is no
ine If Closed (XIC), Examine If Open (XIO), and Out- physical input present (no voltage applied to the
put Energize (OTE). Each of these instructions relates input terminal).
to a single bit of PLC memory that is specified by the • When the Examine-on instruction is associated by
instruction’s address. While the XIO and XIC are rep- address with an internal relay, then the status of the
resented by symbols that resemble a normally-open and bit is dependent on the logical status of the internal
normally-closed relay contact, they do not operate like bit with the same address as the instruction.
Basics of PLC Programming Chapter 5 83
pet73842_ch05_074-097.indd 83 05/11/15 4:17 PM