Q. Explain The ONE SHOT (ONS) Function With An Application.: Advanced PLC Programming
Q. Explain The ONE SHOT (ONS) Function With An Application.: Advanced PLC Programming
An optical proximity sensor detects the boxes and provides input signal to
PLC. The counter instruction counts the number of boxes passing along
conveyor.
A schematic ladder diagram of PLC program is shown in figure. When there is
true condition of proximity switch, a count takes place and it is stored in
designated register HR037.
This ladder diagram will not function as intended. In fact, with this ladder
diagram, when one box goes past proximity sensor the counter instead of
showing one count, will show hundreds of count. Let’s see what is wrong
with this ladder diagram.
While the box is being detected, the PLC scans the rungs. These scans are
extremely fast and occur many times before the box passes the sensor.
Therefore, instead of counting once when a box is detected, the counting
occurs every time there is scan.
Therefore, for correct working, we need the PLC counter to operate (i.e.
count) only during first scan. The counter must not count during subsequent
scans. The next count should be counted when that box goes past sensor
and next box is being detected.
This is accomplished by introducing ONE SHOT instruction between proximity
sensor contact and the counter as shown in figure.
The modified ladder diagram is shown in figure. The ONE SHOT instruction
sends a signal to counter whenever there is off to on transition of the
proximity contact.
The CLEAR (CLR) instruction of function sets all the bits in a register or word
to zero.
This is useful when we wish to zero out a system before starting or restarting
a process.
Most PLCs are capable of working with digital bits. Instead of controlling
output devices from individual contacts, these PLCs use register bits in
groups. For example, if the on-off status of 16 machines is to be controlled,
just one of the 16 bits of the 16-bit register could control each of the 16
machines.
If there are 157 machines to be turn on and off, only 10 of these 16-bit
registers are needed for on-off control (157/16=9.815, or 9 registers plus part
of a 10th one). By contrast, in contact-coil ladder control would need 157
ladder lines in the program.
Following PLC functions are available for changing register bit status:
BIT SET:
When the BS function is enabled as shown in figure, bit 4 of HR0207 is set to 1 (if it
was not already a 1). Turning the function off would have no further effect on the
bit – it would remain a 1.
BIT CLEAR:
The bit clear function, shown in figure, has the opposite effect of BIT SET. The
example in figure operates on big 5 of HR0207. When enabled, the BC function
would change bit 5 from 1 to 0. If we had applied BC to bit 6, nothing would have
happened, because bit 6 is already a 0. When BC is turned off, nothing further
happens.
BIT FOLLOW:
Figure shows the BF function applied to bit 4 of HR 0207. When enabled, the
function sets the bit to 1. When disabled, or off, the function sets the bit to 0. Notice
that BF differs from BS and BC: on and off are both active and significant in the BIT
FOLLOW function.
Thus for the arrangement shown in figure, as the drum rotates, in the first
step the peg for output 1 is activated, in step 2 the peg for the third output,
in step 3 the peg for the second output, and so on. Different outputs could be
controlled by pegs located at different distances along the drum. Another
form consisted of a series of cams on the same shaft, the profile of the cam
being used to switch contacts on and off.
The PLC SEQUENCER is based on mechanical drum controller, but it more
powerful and flexible programming tool.
Suppose we want output 1 to be switched on 5 s after the start and remain
on until the time reaches 10 s, output 2 to be switched on at 10 s and remain
on until 20 s, output 3 to be switched on at 15 s and remain on until 25 s,
and so on. We can represent these requirements by a time sequence
diagram, shown in figure, demonstrating the required time sequence.
0 0 0 0 0 0
1 5 1 0 0 0
2 10 0 1 0 0
3 15 0 1 1 0
4 20 0 0 1 0
5 25 0 0 1 1
6 30 0 0 0 0
Figure shows a basic ladder program using such a sequencer. The timer is
started by an input to I:012/1 and has a preset time of 30 s. It is reset by its
DN bit. The DN bit also increments the SQO instruction to the next output
word. Thus the sequencer is incremented every 30 s.
The location of the data for the words is given by FILE, which gives the
starting address for the registers in which the binary data for each step is
stored.
Sometimes the sequencer is not required to operate on the entire word, so
MASK gives the bit pattern that masks off certain bits so they are not
controlled by the sequencer. Thus we could have a MASK word of
0000000000001111 because only last 4 bits are used in this example.
SOURCE is the address of the input word or file for an SQC, and
DESTINATION is the address of the output word or file. CONTROL is the
address that contains parameters with control information. LENGTH is the
number of steps of the sequencer file. POSITION is the step in the sequencer
file from/to which the instruction moves data.
Q. Explain how PLC matrix functions help to reduce the program length.
Suppose that we have 207 pilot lights, each of which is to go on only if both
of two contacts are closed. This means that we have to program 207 lines
with two contacts and a coil for a pilot light for each line.
An alternative to the 207 lines of programming is one line of matrix function.
In this case we would program an AND matrix.
Energizing the matrix function effectively scans all 207 lines and turns the
pilot lights on or off.
In this way the PLC matrix functions help to reduce the program length.
Four coils, each of which can be energized by two inputs in series, result in
four AND situations. The coils are programmed on the PLC in the usual
manner as shown in figure 5.1.
The upper section of figure 5.2 shows the original four coils and eight inputs
arranged in a 2 x 2 matrix. A 1 represents on and a is 0, off, in the
conventional manner. Each bit of matrix A is used with corresponding bit of
matrix B. These bits are ANDed together and the result is put in the
corresponding bit location of matrix C.
We have used a 2 x 2 matrix for four AND functions. Next, suppose we have
53 coils, each with two series inputs for actuation. It would take a long time
and a lot of PLC memory to program the 106 contacts and the 53 coils. Using
the AND matrix system makes programming in lot more straightforward.
A typical PLC has 16-bit registers. Therefore, in this case, we use three full
registers for the first 3 x 16 = 48 bits. The last 5 bits go in the first part of the
next (fourth) register. The on-off statuses of 106 contacts are stored in two
register groups. Results of the matrix AND operation appear in another matrix
as shown in figure 5.4.
How is the PLC programmed to do the PLC AND operation? Figure 5.5 shows
a typical PLC AND function. The coil is assigned a number in the usual
manner. We specify the matrix size i.e. the number of registers. We tell the
PLC which registers to use by specifying the last register of each group of
inputs and outputs.
OR
1. BUS Topology:
3. STAR Topology:
In this topology, all the nodes are connected in a tree type structure,
which is consists of smaller bus network.
To extend or increase the network repeaters are used to boost the
signal strength.
The tree is divided into sub-units so it is easier to add new units or
disconnect a sub-unit.
The BUS topology is popular in industrial sector because other topologies are
expensive to configure and confusing.
MONITER
FORCE
PRINT
The monitor mode for ladder diagram operation is indicated on the screen in
various ways. It may be indicated by a brightening of the pattern where
voltage is passed through.
The above figure shows how the status of holding registers would be shown
on the screen.
We may call up individual coils, contacts or both on the screen. For example,
if we are looking at or in the vicinity of line 32, we may wish to see what is
happening to an input contact on line 6, which is off the screen. Contacts and
coils from line 6 can be inserted in a blank space by themselves and observed
for on-off status as shown in following figure.
Ladder diagrams on a screen cover from one to four or five rungs, depending
upon the PLC model. If the entire operational circuit has 20 or more rungs,
we may wish to see the entire circuit at once. Using PRINT command, the
whole ladder diagram can be printed out continuously on a conventional
computer printer.
There are, of course, other reasons we might want a ladder printout. We
might need a permanent written record, for instance.
Also, in education and training, a printout is a written record of laboratory
achievement.
Other typical PRINT mode capabilities include register status and values, time
vs. status diagrams, FORCE status, etc.