الثلاثاء، 9 نوفمبر 2010

Block Transfer Functions


Block Transfer Functions
Simple input and output cards usa a single word. Writing one word to an output
card sets all of the outputs. Reading one word from an input card reads all of the inputs. As
a result the PLC is designed to send and receive one word to input and from output cards.
Later we will discuss more complex input and output cards (such as analog I/O) that
require more than one data word. To communicate multiple words, one word must be sent
at a time over multiple scans. To do this we use special functions called Block Transfer
Write (BTW) and Block Transfer Read (BTR).
Figure 16.21 shows a BTWfunction. The module type is defined from a given list,
in this case it is an Example Output Card. The next three lines indicate the card location as
00, 3 or 003, the module number should normally be zero (except when using two slot
addressing). This instruction is edge triggered, and special control memory BT10:1 is used
in this example to track the function progress (Note: regular control memory could have
also been used, but the function will behave differently). The instruction will send 10
words from N9:0 to N9:9 to the output card when A becomes true. The enabled bit
BT10:1/EN is used to block another start until the instruction is finished. If the instruction
e.g. Check for nuclear reactor overheat I:001/03 overheat sensor
O:010/01 reactor shutdown
IIN I:001
IOT

These added statements can allow the ladder logic to examine a critical
input, and adjust a critical output many times during the execution of
ladder logic that might take too long for safety.

Note:When these instructions are used the normal assumption that all inputs and
outputs are updated before and after the program scan is no longer valid.
plc advanced functions -
is restarted before it is done an error will occur. The length and contents of the memory
N9:0 to N9:9 are specific to the type of input and output card used, and will be discussed
later for specific cards. This instruction is not continuous, meaning that when done it will
stop. If it was continuous then when the previous write was done the next write would
begin.
Figure

Fault Detection and Interrupts


Fault Detection and Interrupts
The PLC can be set up to run programs automatically using interrupts. This is routinely
done for a few reasons;
• to deal with errors that occur (e.g. divide by zero)
• to run a program at a regular timed interval (e.g. SPC calculations)
• to respond when a long instruction is complete (e.g. analog input)
• when a certain input changed (e.g. panic button)
These interrupt driven programs are put in their own program file. The program
file number is then put in a status memory S2 location. Some other values are also put into
status memory to indicate the interrupt conditions.
A fault condition can stop a PLC. If the PLC is controlling a dangerous process
this could lead to significant damage to personnel and equipment. There are two types of
faults that occur; terminal (major) and warnings (minor). A minor fault will normally set
an error bit, but not stop the PLC. A major failure will normally stop the PLC, but an interrupt
can be used to run a program that can reset the fault bit in memory and continue operation
(or shut down safely). Not all major faults are recoverable. A complete list of these
faults is available in PLC processor manuals.
Figure 16.15 shows two programs. The default program (file 2) will set the interrupt
program file to 3 by moving it to S2:29 on the first scan. When A is true a compute
function will interpret the expression, using indirect addressing. If B becomes true then the
value in N7:0 will become negative. If A becomes true after this then the expression will
become N7:-10 +10. The negative value for the address will cause a fault, and program
file 3 will be run. In fault program status memory S2:12 is checked the error code 21,
which indicates a bad indirect address. If this code is found the index value N7:0 is set
back to zero, and S2:11 is cleared. As soon as S2:11 is cleared the fault routine will stop,
and the normal program will resume. If S2:11 is not cleared, the PLC will enter a fault
state and stop (the fault light on the front of the PLC will turn on).

ADVANCED LADDER LOGIC FUNCTIONS


ADVANCED LADDER LOGIC FUNCTIONS
 INTRODUCTION
This chapter covers advanced functions, but this definition is somewhat arbitrary.
The array functions in the last chapter could be classified as advanced functions. The functions
in this section tend to do things that are not oriented to simple data values. The list
functions will allow storage and recovery of bits and words. These functions are useful
when implementing buffered and queued systems. The program control functions will do
things that don’t follow the simple model of ladder logic execution - these functions recognize
the program is executed left-to-right top-to-bottom. Finally, the input output functions
will be discussed, and how they allow us to work around the normal input and output
scans.
16.2 LIST FUNCTIONS
 Shift Registers
Shift registers are oriented to single data bits. A shift register can only hold so
many bits, so when a new bit is put in, one must be removed. An example of a shift regis-
Topics:
Objectives:
• To understand shift registers, stacks and sequencers.
• To understand program control statements.
• To understand the use of interrupts.
• To understand the operation of immediate input and output instructions.
• To be prepared to use the block transfer instruction later.
• Be able to apply the advanced function in ladder logic design.
• Shift registers, stacks and sequencers
• Program control; branching, looping, subroutines, temporary ends and one shots
• Interrupts; timed, fault and input driven
• Immediate inputs and outputs
• Block transfer
• Conversion of State diagrams using program subroutines
• Design examples

ASSIGNMENT PROBLEMS


ASSIGNMENT PROBLEMS
1. Draw a schematic symbol for a solenoid controlled pneumatic valve and explain how the valve
operates.
2. We are to connect a PLC to detect boxes moving down an assembly line and divert larger
boxes. The line is 12 inches wide and slanted so the boxes fall to one side as they travel by.
One sensor will be mounted on the lower side of the conveyor to detect when a box is present.
A second sensor will be mounted on the upper side of the conveyor to determine when a larger
box is present. If the box is present, an output to a pneumatic solenoid will be actuated to divert
the box. Your job is to select a PLC, sensors, and solenoid valve. Details are expected with a
ladder wiring diagram. (Note: take advantage of manufacturers web sites.)
3. A PLC based system has 3 proximity sensors, a start button, and an E-stop as inputs. The system
controls a pneumatic system with a solenoid controlled valve. It also controls a robot with
a TTL output. Develop a complete wiring diagram including all safety elelemnts.
4. A system contains a pneumatic cylinder with two inductive proximity sensors that will detect
when the cylinder is fully advanced or retracted. The cylinder is controlled by a solenoid controlled
valve. Draw electrical and pneumatic schematics for a system.
5. Draw an electrical ladder wiring diagram for a PLC controlled system that contains 2 PNP sensors,
a NO pushbutton, a NC limit switch, a contactor controlled AC motor and an indicator
light. Include all safety circuitry

PNEUMATICS


Pneumatic systems are very common, and have much in common with hydraulic
systems with a few key differences. The reservoir is eliminated as there is no need to collect
and store the air between uses in the system. Also because air is a gas it is compressible
and regulators are not needed to recirculate flow. But, the compressibility also means
that the systems are not as stiff or strong. Pneumatic systems respond very quickly, and are
commonly used for low force applications in many locations on the factory floor.
Some basic characteristics of pneumatic systems are,
- stroke from a few millimeters to meters in length (longer strokes have more
springiness
- the actuators will give a bit - they are springy
- pressures are typically up to 85psi above normal atmosphere
- the weight of cylinders can be quite low
- additional equipment is required for a pressurized air supply- linear and rotatory
actuators are available.
- dampers can be used to cushion impact at ends of cylinder travel.
When designing pneumatic systems care must be taken to verify the operating
location. In particular the elevation above sea level will result in a dramatically different
air pressure. For example, at sea level the air pressure is about 14.7 psi, but at a height of
7,800 ft (Mexico City) the air pressure is 11.1 psi. Other operating environments, such as
in submersibles, the air pressure might be higher than at sea level.
Some symbols for pneumatic systems are shown in Figure 5.7. The flow control
valve is used to restrict the flow, typically to slow motions. The shuttle valve allows flow
in one direction, but blocks it in the other. The receiver tank allows pressurized air to be
accumulated. The dryer and filter help remove dust and moisture from the air, prolonging
the life of the valves and cylinders.

RELAYS


Although relays are rarely used for control logic, they are still essential for switching
large power loads. Some important terminology for relays is given below.
Contactor - Special relays for switching large current loads.
Motor Starter - Basically a contactor in series with an overload relay to cut off
when too much current is drawn.
Arc Suppression - when any relay is opened or closed an arc will jump. This
becomes a major problem with large relays. On relays switching AC this problem
can be overcome by opening the relay when the voltage goes to zero (while
crossing between negative and positive). When switching DC loads this problem
can be minimized by blowing pressurized gas across during opening to suppress
the arc formation.
AC coils - If a normal relay coil is driven by AC power the contacts will vibrate
open and closed at the frequency of the AC power. This problem is overcome
by adding a shading pole to the relay.
The most important consideration when selecting relays, or relay outputs on a
PLC, is the rated current and voltage. If the rated voltage is exceeded, the contacts will
wear out prematurely, or if the voltage is too high fire is possible. The rated current is the
maximum current that should be used. When this is exceeded the device will become too
hot, and it will fail sooner. The rated values are typically given for both AC and DC,
although DC ratings are lower than AC. If the actual loads used are below the rated values
the relays should work well indefinitely. If the values are exceeded a small amount the life
of the relay will be shortened accordingly. Exceeding the values significantly may lead to
immediate failure and permanent damage.
• Rated Voltage - The suggested operation voltage for the coil. Lower levels can
result in failure to operate, voltages above shorten life.
• Rated Current - The maximum current before contact damage occurs (welding or
melting).

Output Modules


As with input modules, output modules rarely supply any power, but instead act as
switches. External power supplies are connected to the output card and the card will
switch the power on or off for each output. Typical output voltages are listed below, and
roughly ordered by popularity.
120 Vac
24 Vdc
12-48 Vac
12-48 Vdc
5Vdc (TTL)
230 Vac
These cards typically have 8 to 16 outputs of the same type and can be purchased
with different current ratings. A common choice when purchasing output cards is relays,
transistors or triacs. Relays are the most flexible output devices. They are capable of
switching both AC and DC outputs. But, they are slower (about 10ms switching is typical),
they are bulkier, they cost more, and they will wear out after millions of cycles. Relay
outputs are often called dry contacts. Transistors are limited to DC outputs, and Triacs are
limited to AC outputs. Transistor and triac outputs are called switched outputs.
- Dry contacts - a separate relay is dedicated to each output. This allows mixed
voltages (AC or DC and voltage levels up to the maximum), as well as isolated
outputs to protect other outputs and the PLC. Response times are often greater
than 10ms. This method is the least sensitive to voltage variations and spikes.
- Switched outputs - a voltage is supplied to the PLC card, and the card switches it
to different outputs using solid state circuitry (transistors, triacs, etc.) Triacs are
well suited to AC devices requiring less than 1A. Transistor outputs use NPN or
PNP transistors up to 1A typically. Their response time is well under 1ms.