D06 - PLC Programming II
D06 - PLC Programming II
New applications are new systems, while modernizations are upgraded existing control systems
that have functioned previously without a PLC (i.e., through electromechanical control or
individual, analog, loop controllers).
Program Organization and Implementation
❑ Creating flowcharts
Flowcharting is a technique
often used when planning a
program after a written
description has been developed.
A flowchart is a pictorial
representation that records,
analyzes, and communicates
information, as well as describes
the operational process in a
sequential manner.
Program Organization and Implementation
❑ Configuring the PLC system
The assignment of inputs and outputs is one of the most important procedures that occurs
during the programming organization and implementation stages.
The I/O assignment table indicates which PLC inputs are connected to which input devices
and which PLC outputs drive which output devices.
The assignment of internals, including timers, counters, and MCRs, also takes place here.
These assignments are the actual contact and coil representations that are used in the
ladder diagram program.
In applications where electromechanical relay diagrams are available (e.g., modernization of
a machine or process), identification of real I/O can be done by circling the devices and then
assigning them I/O addresses
Program Organization and Implementation
❑ Real and internal I/O assignment
Example
For the circuit shown in the fugure,
I/O connection
diagram.
Program Organization and Implementation
❑ Register address assignment
The assignment of addresses to the registers used in the control program is another important
aspect of PLC organization.
The easiest way to assign registers is to list all of the available PLC registers. Then, as they are
used, describe each register’s contents, description, and function in a register assignment
table.
Program Organization and Implementation
❑ Elements to leave hardwired
Decide which devices will not be wired to
the controller.
These elements will remain part of the
electromechanical control logic.
• These elements usually include devices
that are not frequently switched off
after start, such as compressors and
hydraulic pumps.
• Components like emergency stops and
master start push buttons should also
remain hardwired, principally for safety
purposes.
This way, if the controller is faulty and
an emergency occurs, the user can
shut down the system without PLC
intervention.
Program Organization and Implementation
❑ Special input device programming
Normally Closed Devices. An input device that is wired as a normally open input can be
programmed to act as either a normally open or a normally closed device.
If a device is wired as a normally closed input and it must act as a normally closed input, its
reference address is programmed as normally open.
NO NO NO
NO NC NC
NC NO NC
NC NC NO
Program Organization and Implementation
❑ Special input device programming
Master Control Relays. In electromechanical circuit diagrams, an master control relay
(MCR) coil controls several rungs in a circuit by switching ON or OFF the power to those
rungs.
Task: Compare the input signal from a temperature transducer (0°C to 1000°C) with two
alarm set points (a low alarm and a high alarm).
• The PLC receives set point data via two sets of 4-digit switches (BCD).
• The valid range of this set point data is 100 to 850°C.
• The analog input module receives a signal, which is proportional to the temperature,
that ranges between –10 and +10 VDC.
• When the signal is over or under either of the two set points, an indicator light is
illuminated.
Analog I/O control programming
The analog input relationship between counts and degrees Celsuis
Analog I/O control programming
Analog I/O control programming
Subroutine 1100:
Check for valid TWS range and convert to decimal
Reading the low/high limit alarm
TWS (BCD)
An I/O wiring connection diagram shows the actual connections of field input and output
devices to the PLC module. This drawing normally includes power supplies and subsystem
connections to the CPU.
If the field devices are not wired directly to the I/O module, then the diagram should show
terminal block numbers
PLC system documentation
❑ I/O address assignment document
An I/O address assignment document identifies each field device by address (rack, group,
and terminal), the type of input or output module (e.g., 115 VAC, 24 VAC), the type of field
device (e.g., limit switch, solenoid), and the function the device performs in the field.
❑ Internal storage address assignment document
The internal address assignment document indicates the address, type, and function of
each internal in the program.
❑ Storage register assignment
Each available system register, whether a user storage register or an I/O register, should be
properly identified. Most applications use registers to store or hold information for timers,
counters, or comparisons.
❑ Variable declaration
A proper variable declaration, which includes the name of the input, output, or internal,
should be included in each of the assignment documents (e.g., I/O assignment, storage
register assignment).
PLC system documentation
PLC system documentation
❑ Control program printout
The control program printout is a hard
copy of the control logic program stored in
the controller’s memory. Whether stored
in ladder form or some other language, the
hard copy should be an exact replica of the
controller’s memory.
Discrete I/O Control Programming
Example: Wiring diagram for a three-phase motor and its corresponding three-wire control
circuit, where the auxiliary contacts of the starter seal the start push button.
S7-1200
S7-1200
Discrete I/O Control Programming
Example: PLC implementation of the electromechanical circuit.
Discrete I/O Control Programming
Example: PLC implementation of the electromechanical circuit.