Programable Logic controller questions 1-3
MODULE TITLE: PROGRAMMABLE LOGIC CONTROLLERS
TOPIC TITLE: ADDITIONAL FACILITIES
LESSON 2: ANALOGUE TO DIGITAL CONVERSION
AND SPECIAL FACILITIES
PLC - 7 - 2
© Teesside University 2011
Published by Teesside University Open Learning (Engineering)
School of Science & Engineering
Teesside University
Tees Valley, UK
TS1 3BA
+44 (0)1642 342740
All rights reserved. No part of this publication may be reproduced, stored in a
retrieval system, or transmitted, in any form or by any means, electronic, mechanical,
photocopying, recording or otherwise without the prior permission
of the Copyright owner.
This book is sold subject to the condition that it shall not, by way of trade or
otherwise, be lent, re-sold, hired out or otherwise circulated without the publisher's
prior consent in any form of binding or cover other than that in which it is
published and without a similar condition including this
condition being imposed on the subsequent purchaser.
________________________________________________________________________________________
INTRODUCTION ________________________________________________________________________________________
In this lesson we begin by exploring the possibility of a digital machine
accepting signals from an analogue signal source. This is achieved in practice
by producing a digital representation before it is offered to the PLC.
Only one method of converting from analogue to digital signals is examined
although alternative methods are available. The best utilisation of the
conversion circuit is obtained when the same circuit components are used to
serve more than one analogue input channel. How the mechanism for this and
other control signals is realised in practical modules is also explained.
A separate section of the lesson looks at methods of saving programs to make
copies which can be held safely for occasions when the PLC program crashes
(fails) or when the same software needs to be duplicated for use on other
machines.
The lesson continues by taking a brief look at the trend towards improved
communications between PLCs and other computerised equipment.
Finally, a small application is used to show how some of the additional
functions which are found in larger machines are used to effect more versatile
control.
1
Teesside University Open Learning (Engineering)
© Teesside University 2011
________________________________________________________________________________________
YOUR AIMS ________________________________________________________________________________________
On completing this lesson you should be able to:
• understand the relationship between an analogue voltage value and
its digital representation
• understand the requirements of an A/D circuit to make it more
sensitive to small input voltage changes
• explain the operation of one type of A/D circuit
• explain the process of multiplexing analogue signals
• state and explain different methods of saving PLC programs
• understand the need for better communications facilities for PLCs
• explain some of the additional functions of larger PLCs.
2
Teesside University Open Learning (Engineering)
© Teesside University 2011
________________________________________________________________________________________
HANDLING ANALOGUE INPUTS ________________________________________________________________________________________
The topics covered so far have dealt, in the main, with signals and functions
which have a binary digital nature. However, a vast quantity of sensors and
transducers used in modern control and monitoring applications produce
analogue outputs. There is clearly a distinct lack of compatibility between
these signals and the operating characteristics of the microprocessor-based
machine which is required to process them. We therefore need to consider
how the analogue signals can be changed into a binary digital representation so
that the PLC will find them acceptable?
The obvious answer is to have a circuit which will accept an analogue input
and produce from it a digital output. Circuits which fulfil this function are
called analogue to digital converters as opposed to the digital to analogue
converters previously examined. FIGURE 1 shows the basic arrangement.
FIG. 1
Several different methods of A/D conversion are possible. Some methods are
used because the conversion process is very rapid, whereas others may be used
binary digital output
Analogue transducer and signal
conditioning circuit
Analogue input
0 volt common
+V
A/D circuit
3
Teesside University Open Learning (Engineering)
© Teesside University 2011
because they offer the cheapest method despite taking a little longer to carry
out the process. Whatever the method used, the most useful output will be
derived from an A/D if a large number of digital output lines are provided. A
term often used to indicate the number of outputs is called the resolution.
Hence an A/D with an eight bit resolution will have eight output lines (as in
FIGURE 1) which will provide binary patterns ranging from 00000000 up to
11111111,
i.e. 28 = 256 possible patterns exist with an eight bit device.
This means that if the range of the input value is, say, from 0 V to 2.56 V then
1/256 of this would be the voltage range associated with the least significant
bit change in the binary output. FIGURE 2 illustrates this graphically.
FIG. 2
With this arrangement any voltage between the limits 0 V and 0.01 V would be
associated with an output of 00000000 binary (00 Hex). Values above 0.01 V
but not above 0.02 V would be associated with an output of 00000001 binary
(01 Hex). The values would advance in incremental steps of 0.01 V until the
upper limit of 2.56 V was reached, the binary pattern 11111111 (FF Hex)
2.56 V 2.55 V
0.03 V
0.02 V
0.01 V
0.01 V
0.01 V
0.01 V 00H 01H 02H0V
FFH
4
Teesside University Open Learning (Engineering)
© Teesside University 2011
being the biggest number possible as an eight bit output. This is a very
mathematical approach which is being used here to establish the basic idea. In
practice this level of accuracy would not be expected but we will continue
along these lines within this text. Understandably then, the analogue value
would need to change by 0.01 V before we could be certain of a change in the
binary output. However, if the A/D were exchanged for another having a
12 bit resolution with the same analogue range then 212 = 4096 values of
output would be possible and the analogue voltage range associated with a
least significant binary bit change would now be 2.56 V × 1/4096 which is 0.000625 volts*. The increase in the number of output bits makes the A/D
more sensitive to a small change at the input.
You should be aware that if a PLC manufacturer offers two different A/D
modules, one having a specification of 0 to 5 V with a 12 bit resolution and the
other having a specification of 0 to 10 V with a 12 bit resolution then both will
produce a 12 bit binary output but the first will produce a binary bit change
due to a 5/4096 volt change at the input and the second, despite having a larger
input range, will need a 10/4096 volt change at the input to produce the same
one bit change at the output.
Hence, a larger analogue voltage range does not mean better sensitivity to
change, it means that a greater analogue voltage change will be necessary to
cause a one bit change at the output. FIGURE 3 highlights this.
________________________________________________________________________________________
*Strictly, it will be slightly greater than this as has been previously stated, the number of level changes is one
less than the total binary levels. In practical terms the error is insignificant.
5
Teesside University Open Learning (Engineering)
© Teesside University 2011
FIG. 3
This also illustrates that a binary digital value can never be said to equal an
analogue value. The relationship between the analogue input and the digital
output will differ with changes in the analogue range, the bit resolution and the
electronic circuitry employed to effect the conversion.
The best statement we can make is the following.
For a given system, a binary digital value at the output of an A/D
converter is representative of an analogue input value lying somewhere
between two specified values within a range.
This statement probably sounds complicated but in practice the majority of
PLC systems would probably not be so finely tuned as to make the statement a
problem. Having 4096 possible values at your disposal does not necessarily
mean that you will use all of them!
10 4096
5 4096
V
1 bit change
1 bit change
1 bit change
1 bit change
1 bit change
1 bit change
V
6
Teesside University Open Learning (Engineering)
© Teesside University 2011
________________________________________________________________________________________
A/D CONVERSION PROCESS ________________________________________________________________________________________
As already mentioned, several methods of A/D conversion are available to the
hardware engineer. This lesson is not intended describe all of the different
methods which may be employed but it is considered important that at least
one process is examined. Hopefully, by understanding one method you will be
able to work your way through others should this become necessary.
The method which we shall examine is popular, cheap to implement and
relatively straightforward to understand.
The diagram of FIGURE 4 shows a collection of components which are
interconnected to form an A/D circuit. Study the diagrams for a few moments
so that you can pick out any components which you recognise (at least two
should be familiar).
FIG. 4
D/A Circuit
Binary Up-
Counter Circuit
&
• •
• •
• •
• •
• •
• •
Analogue Output
Clock
Astable
NAND Gate
Comparator Analogue
Input + –
5
1
4Reset
Begin Conversion
Signal
3
2
Binary Digital Output to PLC
Conversion Complete
Signal
7
Teesside University Open Learning (Engineering)
© Teesside University 2011
Components 1 (two input NAND gate) and 2 (digital to analogue converter)
should be immediately recognisable. Depending upon your background you
may also have identified other devices or even the whole circuit.
Component 3 is a free running astable multivibrator circuit which is being used
as a clock signal generator. When the supply is switched on, this circuit
produces a continual output of a square, or rectangular, waveform. Its
operation is not affected by any of the other components shown in the diagram.
Component 4 is a binary up-counter. We have mentioned hardware counters in
Lesson 2 of Topic 6. The symbol is shown with two inputs and twelve outputs.
The reset input, when enabled, causes the counter to reset all of the output bits
to a logic 0 state, i.e. 000000000000 (or 000 Hex). When the reset signal is
disabled the counter becomes free to start to count up. Each pulse applied to
the count-up input will increment the counter in a true binary fashion. The
count is immediately available on the twelve output lines.
Component 5 is called an analogue comparator. It has two inputs, marked as +
and – on the symbol, and one output. This circuit accepts at its input terminals
values of analogue voltage but supplies at its output a digital voltage level.
The output level will be a logic 1 (+5 volts) if the voltage applied to the
– input is less than the voltage applied to the + input, and the output level will
be a logic 0 if the two analogue voltages are reversed. (See FIGURES 5(a) and
5(b)).
FIG. 5(a) FIG. 5(b)
Having briefly described the components of the converter we can now analyse
how they behave collectively.
–
+
Say +2.5V
Say +2V
Logic 0
Output
–
+
Say +2V
Say +2.5V
Logic 1
Output
8
Teesside University Open Learning (Engineering)
© Teesside University 2011
Assume that an analogue value of, say, 1 volt is applied to the analogue input
of the circuit. (This is an arbitrary value but it gives us a number to work
with.)
This input causes the converter to begin the conversion process. This is
achieved by the reset input being enabled and then disabled. On the
application of the reset pulse the counter output goes to 000 Hex. The counter
output is fed, as an input, to the D/A circuit. A zero input on all bits of the
R/2R D/A circuit produces a 0 volt analogue output. In the diagram the output
of the D/A is fed into the – input of the comparator.
The comparator now has 0 V on its – input and 1 V on its + input. What logic level
will the comparator have at its output?
....................................................................................................................................................
....................................................................................................................................................
________________________________________________________________________________________
A logic 1 should be present at the output. In turn, this output is applied, as one
of the inputs, to the two input NAND gate. When the first logic 1 arrives from
the clock, the two 1's produce a 1 to 0 change from the gate which is
recognised by the counter causing it to increment. Hence the counter output
changes to 001 Hex.
The same cycle of operations continues with each clock pulse. As the counter
output grows so does the value of analogue voltage at the D/A output until
such time as its value is just above the 1 volt applied to the comparator + input.
At this point the comparator output rapidly changes from logic 1 to logic 0.
The logic 0, now being applied to the NAND gate input, prevents any further
9
Teesside University Open Learning (Engineering)
© Teesside University 2011
clock pulses from getting through the gate to the counter. The counter output,
therefore, freezes at a binary digital value which may be taken to represent the
1 volt being applied at the circuit input. The logic level change from the
comparator is also used as a signal to the microprocessor within the PLC that
the conversion process is finished and that the digital value is available for use.
For the circuit being considered the maximum analogue voltage which can be
fed to the – input of the comparator will occur when all twelve inputs to the
D/A are logic 1. If the analogue voltage at the input is greater than this the
process will never end because the comparator output will always be a logic 1.
The analogue input value is therefore derived, or scaled down from, the upper
limit of the range stated for the A/D module.
We can summarise the use of the A/D as follows.
When the PLC is instructed to use the A/D circuit by commands within the
ladder diagram it must:
• initiate the A/D conversion (by sending a reset signal to the counter)
and
• wait until it receives the signal back from the comparator to indicate
that conversion is complete and that the binary value presently at the
counter output represents the analogue value at the input. (If the PLC
reads this value before conversion is complete then an incorrect
representation will be obtained.)
10
Teesside University Open Learning (Engineering)
© Teesside University 2011
________________________________________________________________________________________
MULTIPLEXING ________________________________________________________________________________________
As is the case with D/As the provision of the A/D facility should not be
expected within "small" machines. Users may, on the other hand, realistically
expect expandable or larger machines to support A/Ds, the most common form
being separate expansion or rack mounted modules. Each module may boast
two or four analogue channels but this is not likely to mean that each module
will have this number of physical A/D circuits. This would be wasteful of A/D
circuitry and would make each module bulky and expensive.
Remember, the circuit is only being used when directed by the ladder diagram.
In theory only one A/D circuit is in use at any one time. There is no reason to
have more than is needed.
How then can several analogue channels be provided by the use of only one
A/D circuit?
The answer to this interesting question is a technique known as multiplexing.
To make the multiplexing process easier to understand consider how the
voltage on three different lines could be measured by the use of only one
voltmeter. The diagram of FIGURE 6 shows a voltmeter connected to one of
three lines by the use of a manual selector switch. An operator would take,
and note down, a reading from the meter before switching from position 1 to
position 2.
11
Teesside University Open Learning (Engineering)
© Teesside University 2011
FIG. 6
A second reading (for line 2) would be taken and noted. Finally the switch
position would be changed to position 3 to allow the third reading to be taken.
This switching (or multiplexing) process allows all three readings to be taken
but not all at the same time.
The difficulty of not having access at all times to all readings would not be a
problem for a microprocessor system because it itself is a sequential device i.e.
it does one task at a time. So, if we now remove the voltmeter and put an A/D
circuit in its place, and change the 3 way selector switch for a 4 way type, then
we have the means of handling four analogue voltage channels.
Obviously the manual selection part of the process is not going to be
acceptable because the CPU within the PLC must be in charge of the
proceedings. Multiplexed analogue switch integrated circuits are
manufactured for just this purpose. The channel selection is obtained by the
application of a binary digital selection code which must be provided by the
microprocessor from information derived from the channel number specified
within the ladder diagram or program listing provided. The diagram of
FIGURE 7 gives a slightly more complete picture of the circuit together with
the control lines necessary to effect total control of the A/D process.
Line 1
Line 2
Line 3
Manual Selector Switch
Neutral/Common
V
1
2
3
12
Teesside University Open Learning (Engineering)
© Teesside University 2011
FIG. 7
Consider now the format of a typical conversion instruction and the anticipated
action which will take place. Examine FIGURE 8 which shows a rung of a
ladder diagram.
FIG. 8
When the processor is executing the program and arrives at this point in the
diagram contacts 0703 and 0705 are ANDed. If both contacts are closed then
FUN **
03
DM015
0703 0705
1 of 4 Selector
A/D Circuit
Tristate Buffer
Enable
Begin Conversion
Conversion Complete
Analogue Channel Selection Code
Control Signals
1 2 3 4
Analogue Input
Channels
Common S1 S2
Data Bus
Common
13
Teesside University Open Learning (Engineering)
© Teesside University 2011
the processor executes the function box, otherwise it passes on to the next
rung. The function of analogue to digital conversion would be specified by a
FUNction number placed in the ** position of the diagram. The data in the
next box down specifies the number of the channel which is presently being
used as an analogue input. The next box holds the data specifying where the
binary digital representation of the analogue channel is to be stored within the
memory of the system, after conversion has taken place.
If the function is executed the action will follow the steps listed below.
(a) Set the 03 channel code to select the correct analogue input through the
multiplexor.
(b) Issue the 'begin conversion' command by resetting the counter.
(c) Wait for the 'conversion complete' signal from the comparator.
(d) When the conversion complete signal arrives enable the tristate buffer to
pass the counter value through to the data bus of the system.
(e) Accept the digital data and store it in the specified locations i.e. a group of
memory locations (probably 16) which are specified by the DM015 value
(data memory channel 15).
(f) Go to the next rung in the program.
This step-by-step approach may be a simplification of the action but it should
serve our purposes for this text.
At some later point in the program the data previously brought in and stored
will be addressed to check if the analogue value is related to an output
switching or other corrective action. For example, if input channel three is
from a temperature sensor then perhaps an output will switch off or on a
heating element, on the basis of the converted value.
14
Teesside University Open Learning (Engineering)
© Teesside University 2011
________________________________________________________________________________________
SAVING AND PROTECTING PROGRAMS ________________________________________________________________________________________
In a previous lesson the means of protecting the user program from accidental
corruption or complete loss, in the event of a power failure, was discussed.
The use of battery-backed RAM was put forward as one method which can be
employed as a possible solution. However, there are instances when this
protection is not wholly adequate. Consider, for example, when there is a need
to replace the battery-backing battery due to its age or it becoming damaged in
some way. Would this mean that the program, which may be very long, will be
lost when the battery is removed? (Which must, incidentally, be done with the
power off.) Well, in some well designed machines the battery may not be the
only backing provided. A super capacitor may also be incorporated with the
specific purpose of maintaining an adequate supply of voltage across the
memory circuits for a short duration, so that the program is not lost. After the
battery is removed the capacitor takes over its job, but only for a matter of
minutes instead of the years which the battery itself would provide. Changing
of the battery must, therefore, be carried out quickly and the supply returned
with the minimum of delay. On paper it may seem that every possibility has
been catered for, but no one within the computer control field should ever rely
upon only one copy of a valuable piece of software which is installed within a
user machine. From the beginning of training the rule has always been:
• make a master copy and keep it safe!
The same rule must apply to PLCs but how is it achieved?
If the programming has been developed on a personal computer, then it could
simply be a matter of saving the program to a CD-ROM or to a universal serial
bus (USB) flash memory card or memory stick.
If, on the other hand, the programming has been done on a stand alone
controller then other methods may be possible.
15
Teesside University Open Learning (Engineering)
© Teesside University 2011
One method is to use an EPROM emulator. This requires the PLC to be fitted
with an additional I.C. socket into which is plugged a RAM chip which carries
its own small battery fitted to its back. The program is copied from the system
into this additional RAM chip which is later removed and carefully put into
storage. A RAM chip would normally lose its program immediately it was
removed from its socket but because it carries its own battery the program
remains safely stored. This use of a RAM chip effectively produces a device
which emulates an EPROM, i.e. a memory chip which can be programmed but
when it is removed does not lose its program.
This chip can be inserted into another system where the program is again
copied, this time going into the system RAM. By this method the chip can be
carried from machine to machine to have the same program loaded into each
system.
Another possibility is to have the program copied from the system and 'burnt'
into an EPROM. The EPROM can then, like the emulator, be carried from
machine to machine. The EPROM may also be plugged into a PROM reader
to which can be connected a printer in order that a hard copy printout of the
program can be obtained.
Very often, PLCs support the use of EPROMs, even allowing each EPROM to
carry more than one program so that rapid changeovers can be made, but the
PLC itself will not always have the ability to program them. In such cases extra
hardware, in the form of a PROM programmer, must be purchased before the
benefit of the EPROM facility can be fully realised.
16
Teesside University Open Learning (Engineering)
© Teesside University 2011
________________________________________________________________________________________
SPECIAL FACILITIES ________________________________________________________________________________________
As PLCs have developed they have become more powerful. The general need
for upward compatibility dictates that any program which will run on a small
machine should also run on a more powerful version from the same range.
This is quite understandable because if a user wishes to expand an application
necessitating a more powerful PLC then, if this also means incurring expensive
downtime while a new program is being developed, some reluctance to change
may be experienced. Downtime due to hardware changes may be an
unavoidable necessity but the system, once installed, should be up and running
as quickly as possible. This is true even if it means temporarily using the old
software from the smaller system while the new program is being developed.
Downward compatibility of software cannot be assured because programs
which run on a larger machine may utilise ladder functions and large quantities
of memory which are just not available on the smaller machine.
Just what additional functions will be provided depends upon the manufacturer
as no overall standard exists as yet, though many harmonising protocols have
been agreed as we shall see in the next lesson. The trend has been, however,
towards providing mathematical and logical functions as well as increasing
communication possibilities between PLCs and other microprocessor-based
devices. The provision of additional mathematical and logical functions makes
the programming of these PLCs similar to the programming of
microprocessor-based equipment in assembly language. The functions are
approaching those expected at this level but the use of utility type routines
keeps the programmer separated from the normal problems associated with
assembly programming.
17
Teesside University Open Learning (Engineering)
© Teesside University 2011
MATHEMATICAL AND DATA MANIPULATION FUNCTIONS
The simplest of microprocessors are expected to be able to perform tasks such
as addition and subtraction, whilst others may have the ability to multiply and
divide. Processors which don't have multiplication or division within their
instruction set can still be made to perform these functions and others, by the
use of small subroutine programs. It is not surprising, therefore, that such
functions may be included within PLCs even though they are not truly logic
functions as would be used in Boolean algebra. When PLCs are executing
arithmetic functions the data is likely to be assumed to be in binary coded
decimal form (BCD) so that the process conforms to decimal and not to binary
arithmetic. Using modern processors, sixteen bit (i.e. 4 four-bit) BCD
characters would be handled together, the data being obtained from specified
data channels comprising sixteen memory cells.
Consider, then, carrying out an arithmetic operation on the result of an A/D
conversion from a twelve bit converter. 12 binary digits give bit patterns
ranging from 000000000000 to 111111111111, i.e. 212 = 4096 possible values.
Assume that the data bit pattern from the conversion was 001101111111 from
which the decimal value 512 is to be subtracted. The PLC would have some
difficulty in subtracting a decimal number from a binary number and coming
up with the correct answer. The two numbers would need to have the same
number base so that the correct result can be obtained. For this reason the
function set should possess the ability to conduct binary to BCD and BCD to
binary conversions. Hence twelve-bit binary data taken from the A/D
conversion and stored in a data memory channel would be taken out of that
channel to be converted from binary to BCD before being placed back into
data memory as a 16 bit BCD number. The next rung in the ladder diagram
would be the subtraction of the decimal 512. After the subtraction the sixteen
bit BCD result would be stored back into another specified data memory
channel.
18
Teesside University Open Learning (Engineering)
© Teesside University 2011
Another typical operation is carried out by the COMPARE function. The
diagram of FIGURE 9 shows a simple oven arrangement. The operator would
set the value of the required temperature by placing a value on the thumbwheel
switches.
FIG. 9
The ladder diagram controlling the process reads-in the set point value from
the thumbwheel switches and stores it in memory. The analogue signal is then
read-in, converted into a binary value and stored. Some scaling of this value
may be required otherwise it could be immediately converted into a sixteen bit
BCD value before being placed back into a memory channel. The two BCD
values can now be handled by the compare function included as the next rung
in the diagram (see FIGURE 10).
• • PLC LESS
EQUAL
MORE
0 2 2 4
Temperature Sensing Transducer
Heating Element
Digital Output Module
Analogue Input Module
19
Teesside University Open Learning (Engineering)
© Teesside University 2011
FIG. 10
The rung is checked to see if it is complete. If it is, the compare function will
go ahead. The first data value is obtained from its specified location and it is
compared bit by bit with the data value found in the second specified location.
Flags, single bit memory cells, are set to 1 or reset to 0 on the result of the
compare operation. Three flags are normally employed. One flag is set if the
first number is greater than the second, otherwise it is reset. A second flag is
set if the two numbers are equal to each other, otherwise it is reset. The third
flag is set if the second number is greater than the first, otherwise it also is
reset. Therefore, immediately after the compare operation one of the three
flags must be set. If one, or more, of the flags are to be checked then this must
be the next operation to be carried out by the ladder diagram. If the compare
function shows the temperature to be less than the desired value then the
relevant flag is used to activate a physical relay which supplies the heating
elements. All three flags could be used to supply indicator outputs to show the
operator the present state of the oven.
CMP FUN ** DM010 DM025
'Greater Than' Flag Contacts
'Equal To' Flag Contacts
'Less Than' Flag Contacts
'Less Than' Flag Contacts
'Too Large' Output
'Equal' Output
'Too Low' Output
'Too Low' Output } Heater Control
Panel Indicator
Lamps
Enabling contacts
20
Teesside University Open Learning (Engineering)
© Teesside University 2011
An analogue output module could also be used to supply an analogue
voltmeter which has been calibrated to indicate the oven temperature.
It should be clear by now that the more special functions that exist the easier it
becomes to execute the programming of control tasks for a wide variety of
applications. Engineers who are used to programming microprocessor-based
equipment in machine code or assembly language take very readily to the full
range of special functions available because the function operations are very
similar to those that they already use. People new to these types of functions
often find great difficulty at first, partly because machine manuals don't seem
to be written with the "beginner" in mind. Manufacturers mistakenly assume
that prospective users are already acquainted with the intricacies of the special
functions which, of course, they frequently are not. This often deters users
from experimenting, which does not yield the full potential of the machine.
Now attempt the following Self-Assessment Questions.
21
Teesside University Open Learning (Engineering)
© Teesside University 2011
________________________________________________________________________________________
SELF-ASSESSMENT QUESTIONS ________________________________________________________________________________________
1. An A/D module with 12 bit resolution has an input voltage range of 0 V
to 5 V.
Estimate the value of analogue input voltage which would produce the
following output values:
(a) 005 Hex
(b) 0AA Hex
(c) 100000100111 binary
(d) 001101011010 binary.
2. Two 10 bit A/D circuits have the following input voltage ranges:
(a) 0 V to 5 V
(b) 0 V to 10 V.
Which one would be more sensitive to an input voltage change and why?
3. In the A/D circuit of FIGURE 4 reproduced below, explain the purpose
and operation of the component identified as (5).
22
Teesside University Open Learning (Engineering)
© Teesside University 2011
FIG.4 (Reproduced)
4. Why do some larger machines need to have a binary to BCD and a BCD
to binary conversion function?
5. State two different methods of saving a back-up copy of a PLC program.
D/A Circuit
Binary Up-
Counter Circuit
& •
• •
• •
• •
• •
• •
•
Analogue Output
Clock
Astable
NAND Gate
Comparator Analogue
Input + –
5
1
4Reset
Begin Conversion
Signal
3
2
Binary Digital Output to PLC
Conversion Complete
Signal
23
Teesside University Open Learning (Engineering)
© Teesside University 2011
________________________________________________________________________________________
ANSWERS TO SELF-ASSESSMENT QUESTIONS ________________________________________________________________________________________
1. 12 bit resolution gives 4096 possible values.
The bit value range, in theory, will be 1/4096 of 5 V i.e. 0.00122 volts.
(a) 005 Hex should be representative of an analogue value between
5 × 0.00122 V and 6 × 0.0122 V i.e. 0.0061 V and 0.00732 V
(b) OAA Hex is (0 × 256) + (10 × 16) + (10 × 1) = 170 decimal. The analogue value should be between
170 × 0.00122 and 171 × 0.00122 i.e. 0.2074 V and 0.2086 V
(c) 1000 0010 0111 binary is 827 Hex.
827 Hex is (8 × 256) + (2 × 16) + (7 × 1) = 2087 decimal. The analogue value should be between
2087 × 0.00122 and 2088 × 0.00122 i.e. 2.546 V and 2.547 V
(d) 0011 0101 1010 binary is 35A Hex.
35A Hex is (3 × 256) + (5 × 16) + (10 × 1) = 858 decimal. The analogue value should be between
858 × 0.00122 and 859 × 0.00122 i.e. 1.047 V and 1.048 V
2. Both A/D circuits have 10 bit resolution which means 1024 possible
values. Hence:
(a) would have a bit sensitivity of 1/1024 × 5 V = 5/1024 V (b) would have a bit sensitivity of 1/1024 × 10 V = 10/1024 V.
24
Teesside University Open Learning (Engineering)
© Teesside University 2011
Therefore (a) would be more sensitive to a small change requiring
only 5/1024 V to produce a one bit change at the output whereas (b)
requires a 10/1024 V change.
3. Component (5) in FIGURE 4 is the analogue comparator device.
This component accepts values of analogue voltage at each of its two
inputs, compares these values with each other and produces an output
dependent upon their relationship. As a means of identification each
input terminal is identified by either a + or a – symbol. If the voltage at
the – terminal is less than that at the + terminal then the output will be a
logic 1. If the voltage at the – terminal is greater than that at the +
terminal the output will be a logic 0.
4. In some machines certain functions, typically mathematical operations,
are executed with the expectation that the data being handled will be in
BCD form. However, the data may not be in this form but may instead be
in binary. So a conversion from binary to BCD may be needed
immediately before the mathematical operation.
A second example of the need for conversion between these two can be
seen from a typical application.
If you imagine an operative setting a value on a set of thumbwheel
switches (it could be a temperature, a number of turns on the coil winding
machine etc.), then the value would be set up in a BCD form on these
switches. When the PLC reads the switches then BCD data will be taken
in. If the operation requires this data to be compared with the value of an
internal counter, for example, then a direct comparison cannot be made
unless a conversion is first carried out.
25
Teesside University Open Learning (Engineering)
© Teesside University 2011
5. Any two from:
(a) CD-ROM
(b) EPROM emulator
(c) EPROM.
26
Teesside University Open Learning (Engineering)
© Teesside University 2011
________________________________________________________________________________________
SUMMARY ________________________________________________________________________________________
This lesson has covered aspects of analogue to digital conversion from the
point of view of digital representations, methods of effecting the conversion,
the need for multiplexing and the ladder functions which set up the control
signals to produce the action expected. Methods of saving programs to
different mediums and a brief look at some of the additional functions
available were also considered in this lesson.
27
Teesside University Open Learning (Engineering)
© Teesside University 2011
<< /ASCII85EncodePages false /AllowTransparency false /AutoPositionEPSFiles true /AutoRotatePages /None /Binding /Left /CalGrayProfile (Dot Gain 20%) /CalRGBProfile (sRGB IEC61966-2.1) /CalCMYKProfile (U.S. Web Coated \050SWOP\051 v2) /sRGBProfile (sRGB IEC61966-2.1) /CannotEmbedFontPolicy /Error /CompatibilityLevel 1.4 /CompressObjects /Tags /CompressPages true /ConvertImagesToIndexed true /PassThroughJPEGImages true /CreateJDFFile false /CreateJobTicket false /DefaultRenderingIntent /Default /DetectBlends true /ColorConversionStrategy /LeaveColorUnchanged /DoThumbnails false /EmbedAllFonts true /EmbedJobOptions true /DSCReportingLevel 0 /SyntheticBoldness 1.00 /EmitDSCWarnings false /EndPage -1 /ImageMemory 1048576 /LockDistillerParams false /MaxSubsetPct 100 /Optimize true /OPM 1 /ParseDSCComments true /ParseDSCCommentsForDocInfo true /PreserveCopyPage true /PreserveEPSInfo true /PreserveHalftoneInfo false /PreserveOPIComments false /PreserveOverprintSettings true /StartPage 1 /SubsetFonts true /TransferFunctionInfo /Apply /UCRandBGInfo /Preserve /UsePrologue false /ColorSettingsFile () /AlwaysEmbed [ true ] /NeverEmbed [ true ] /AntiAliasColorImages false /DownsampleColorImages true /ColorImageDownsampleType /Bicubic /ColorImageResolution 300 /ColorImageDepth -1 /ColorImageDownsampleThreshold 1.50000 /EncodeColorImages true /ColorImageFilter /DCTEncode /AutoFilterColorImages true /ColorImageAutoFilterStrategy /JPEG /ColorACSImageDict << /QFactor 0.15 /HSamples [1 1 1 1] /VSamples [1 1 1 1] >> /ColorImageDict << /QFactor 0.15 /HSamples [1 1 1 1] /VSamples [1 1 1 1] >> /JPEG2000ColorACSImageDict << /TileWidth 256 /TileHeight 256 /Quality 30 >> /JPEG2000ColorImageDict << /TileWidth 256 /TileHeight 256 /Quality 30 >> /AntiAliasGrayImages false /DownsampleGrayImages true /GrayImageDownsampleType /Bicubic /GrayImageResolution 300 /GrayImageDepth -1 /GrayImageDownsampleThreshold 1.50000 /EncodeGrayImages true /GrayImageFilter /DCTEncode /AutoFilterGrayImages true /GrayImageAutoFilterStrategy /JPEG /GrayACSImageDict << /QFactor 0.15 /HSamples [1 1 1 1] /VSamples [1 1 1 1] >> /GrayImageDict << /QFactor 0.15 /HSamples [1 1 1 1] /VSamples [1 1 1 1] >> /JPEG2000GrayACSImageDict << /TileWidth 256 /TileHeight 256 /Quality 30 >> /JPEG2000GrayImageDict << /TileWidth 256 /TileHeight 256 /Quality 30 >> /AntiAliasMonoImages false /DownsampleMonoImages true /MonoImageDownsampleType /Bicubic /MonoImageResolution 1200 /MonoImageDepth -1 /MonoImageDownsampleThreshold 1.50000 /EncodeMonoImages true /MonoImageFilter /CCITTFaxEncode /MonoImageDict << /K -1 >> /AllowPSXObjects false /PDFX1aCheck false /PDFX3Check false /PDFXCompliantPDFOnly false /PDFXNoTrimBoxError true /PDFXTrimBoxToMediaBoxOffset [ 0.00000 0.00000 0.00000 0.00000 ] /PDFXSetBleedBoxToMediaBox true /PDFXBleedBoxToTrimBoxOffset [ 0.00000 0.00000 0.00000 0.00000 ] /PDFXOutputIntentProfile () /PDFXOutputCondition () /PDFXRegistryName (http://www.color.org) /PDFXTrapped /Unknown /Description << /ENU (Use these settings to create PDF documents with higher image resolution for high quality pre-press printing. The PDF documents can be opened with Acrobat and Reader 5.0 and later. These settings require font embedding.) /JPN <FEFF3053306e8a2d5b9a306f30019ad889e350cf5ea6753b50cf3092542b308030d730ea30d730ec30b9537052377528306e00200050004400460020658766f830924f5c62103059308b3068304d306b4f7f75283057307e305930023053306e8a2d5b9a30674f5c62103057305f00200050004400460020658766f8306f0020004100630072006f0062006100740020304a30883073002000520065006100640065007200200035002e003000204ee5964d30678868793a3067304d307e305930023053306e8a2d5b9a306b306f30d530a930f330c8306e57cb30818fbc307f304c5fc59808306730593002> /FRA <FEFF004f007000740069006f006e007300200070006f0075007200200063007200e900650072002000640065007300200064006f00630075006d0065006e00740073002000500044004600200064006f007400e900730020006400270075006e00650020007200e90073006f006c007500740069006f006e002000e9006c0065007600e9006500200070006f0075007200200075006e00650020007100750061006c0069007400e90020006400270069006d007000720065007300730069006f006e00200070007200e9007000720065007300730065002e0020005500740069006c006900730065007a0020004100630072006f0062006100740020006f00750020005200650061006400650072002c002000760065007200730069006f006e00200035002e00300020006f007500200075006c007400e9007200690065007500720065002c00200070006f007500720020006c006500730020006f00750076007200690072002e0020004c00270069006e0063006f00720070006f0072006100740069006f006e002000640065007300200070006f006c0069006300650073002000650073007400200072006500710075006900730065002e> /DEU <FEFF00560065007200770065006e00640065006e0020005300690065002000640069006500730065002000450069006e007300740065006c006c0075006e00670065006e0020007a0075006d002000450072007300740065006c006c0065006e00200076006f006e0020005000440046002d0044006f006b0075006d0065006e00740065006e0020006d00690074002000650069006e006500720020006800f60068006500720065006e002000420069006c0064006100750066006c00f600730075006e0067002c00200075006d002000650069006e00650020007100750061006c00690074006100740069007600200068006f006300680077006500720074006900670065002000410075007300670061006200650020006600fc0072002000640069006500200044007200750063006b0076006f0072007300740075006600650020007a0075002000650072007a00690065006c0065006e002e00200044006900650020005000440046002d0044006f006b0075006d0065006e007400650020006b00f6006e006e0065006e0020006d006900740020004100630072006f0062006100740020006f0064006500720020006d00690074002000640065006d002000520065006100640065007200200035002e003000200075006e00640020006800f600680065007200200067006500f600660066006e00650074002000770065007200640065006e002e00200042006500690020006400690065007300650072002000450069006e007300740065006c006c0075006e00670020006900730074002000650069006e00650020005300630068007200690066007400650069006e00620065007400740075006e00670020006500720066006f0072006400650072006c006900630068002e> /PTB <FEFF005500740069006c0069007a006500200065007300740061007300200063006f006e00660069006700750072006100e700f5006500730020007000610072006100200063007200690061007200200064006f00630075006d0065006e0074006f0073002000500044004600200063006f006d00200075006d00610020007200650073006f006c007500e700e3006f00200064006500200069006d006100670065006d0020007300750070006500720069006f0072002000700061007200610020006f006200740065007200200075006d00610020007100750061006c0069006400610064006500200064006500200069006d0070007200650073007300e3006f0020006d0065006c0068006f0072002e0020004f007300200064006f00630075006d0065006e0074006f0073002000500044004600200070006f00640065006d0020007300650072002000610062006500720074006f007300200063006f006d0020006f0020004100630072006f006200610074002c002000520065006100640065007200200035002e00300020006500200070006f00730074006500720069006f0072002e00200045007300740061007300200063006f006e00660069006700750072006100e700f50065007300200072006500710075006500720065006d00200069006e0063006f00720070006f0072006100e700e3006f00200064006500200066006f006e00740065002e> /DAN <FEFF004200720075006700200064006900730073006500200069006e0064007300740069006c006c0069006e006700650072002000740069006c0020006100740020006f0070007200650074007400650020005000440046002d0064006f006b0075006d0065006e0074006500720020006d006500640020006800f8006a006500720065002000620069006c006c00650064006f0070006c00f80073006e0069006e0067002000740069006c0020007000720065002d00700072006500730073002d007500640073006b007200690076006e0069006e0067002000690020006800f8006a0020006b00760061006c0069007400650074002e0020005000440046002d0064006f006b0075006d0065006e007400650072006e00650020006b0061006e002000e50062006e006500730020006d006500640020004100630072006f0062006100740020006f0067002000520065006100640065007200200035002e00300020006f00670020006e0079006500720065002e00200044006900730073006500200069006e0064007300740069006c006c0069006e0067006500720020006b007200e600760065007200200069006e0074006500670072006500720069006e006700200061006600200073006b007200690066007400740079007000650072002e> /NLD <FEFF004700650062007200750069006b002000640065007a006500200069006e007300740065006c006c0069006e00670065006e0020006f006d0020005000440046002d0064006f00630075006d0065006e00740065006e0020007400650020006d0061006b0065006e0020006d00650074002000650065006e00200068006f00670065002000610066006200650065006c00640069006e00670073007200650073006f006c007500740069006500200076006f006f0072002000610066006400720075006b006b0065006e0020006d0065007400200068006f006700650020006b00770061006c0069007400650069007400200069006e002000650065006e002000700072006500700072006500730073002d006f006d0067006500760069006e0067002e0020004400650020005000440046002d0064006f00630075006d0065006e00740065006e0020006b0075006e006e0065006e00200077006f007200640065006e002000670065006f00700065006e00640020006d006500740020004100630072006f00620061007400200065006e002000520065006100640065007200200035002e003000200065006e00200068006f006700650072002e002000420069006a002000640065007a006500200069006e007300740065006c006c0069006e00670020006d006f006500740065006e00200066006f006e007400730020007a0069006a006e00200069006e006700650073006c006f00740065006e002e> /ESP <FEFF0055007300650020006500730074006100730020006f007000630069006f006e006500730020007000610072006100200063007200650061007200200064006f00630075006d0065006e0074006f0073002000500044004600200063006f006e0020006d00610079006f00720020007200650073006f006c00750063006900f3006e00200064006500200069006d006100670065006e00200071007500650020007000650072006d006900740061006e0020006f006200740065006e0065007200200063006f007000690061007300200064006500200070007200650069006d0070007200650073006900f3006e0020006400650020006d00610079006f0072002000630061006c0069006400610064002e0020004c006f007300200064006f00630075006d0065006e0074006f00730020005000440046002000730065002000700075006500640065006e00200061006200720069007200200063006f006e0020004100630072006f00620061007400200079002000520065006100640065007200200035002e003000200079002000760065007200730069006f006e0065007300200070006f00730074006500720069006f007200650073002e0020004500730074006100200063006f006e0066006900670075007200610063006900f3006e0020007200650071007500690065007200650020006c006100200069006e0063007200750073007400610063006900f3006e0020006400650020006600750065006e007400650073002e> /SUO <FEFF004e00e4006900640065006e002000610073006500740075007300740065006e0020006100760075006c006c006100200076006f0069006400610061006e0020006c0075006f006400610020005000440046002d0061007300690061006b00690072006a006f006a0061002c0020006a006f006900640065006e002000740075006c006f0073007400750073006c00610061007400750020006f006e0020006b006f0072006b006500610020006a00610020006b007500760061006e0020007400610072006b006b007500750073002000730075007500720069002e0020005000440046002d0061007300690061006b00690072006a0061007400200076006f0069006400610061006e0020006100760061007400610020004100630072006f006200610074002d0020006a0061002000520065006100640065007200200035002e00300020002d006f0068006a0065006c006d0061006c006c0061002000740061006900200075007500640065006d006d0061006c006c0061002000760065007200730069006f006c006c0061002e0020004e00e4006d00e4002000610073006500740075006b0073006500740020006500640065006c006c00790074007400e4007600e4007400200066006f006e0074007400690065006e002000750070006f00740075007300740061002e> /ITA <FEFF00550073006100720065002000710075006500730074006500200069006d0070006f007300740061007a0069006f006e00690020007000650072002000630072006500610072006500200064006f00630075006d0065006e00740069002000500044004600200063006f006e00200075006e00610020007200690073006f006c0075007a0069006f006e00650020006d0061006700670069006f00720065002000700065007200200075006e00610020007100750061006c0069007400e00020006400690020007000720065007300740061006d007000610020006d00690067006c0069006f00720065002e0020004900200064006f00630075006d0065006e00740069002000500044004600200070006f00730073006f006e006f0020006500730073006500720065002000610070006500720074006900200063006f006e0020004100630072006f00620061007400200065002000520065006100640065007200200035002e003000200065002000760065007200730069006f006e006900200073007500630063006500730073006900760065002e002000510075006500730074006500200069006d0070006f007300740061007a0069006f006e006900200072006900630068006900650064006f006e006f0020006c002700750073006f00200064006900200066006f006e007400200069006e0063006f00720070006f0072006100740069002e> /NOR <FEFF004200720075006b00200064006900730073006500200069006e006e007300740069006c006c0069006e00670065006e0065002000740069006c002000e50020006f00700070007200650074007400650020005000440046002d0064006f006b0075006d0065006e0074006500720020006d006500640020006800f80079006500720065002000620069006c00640065006f00700070006c00f80073006e0069006e006700200066006f00720020006800f800790020007500740073006b00720069006600740073006b00760061006c00690074006500740020006600f800720020007400720079006b006b002e0020005000440046002d0064006f006b0075006d0065006e0074006500720020006b0061006e002000e50070006e006500730020006d006500640020004100630072006f0062006100740020006f0067002000520065006100640065007200200035002e00300020006f0067002000730065006e006500720065002e00200044006900730073006500200069006e006e007300740069006c006c0069006e00670065006e00650020006b0072006500760065007200200073006b00720069006600740069006e006e00620079006700670069006e0067002e> /SVE <FEFF0041006e007600e4006e00640020006400650020006800e4007200200069006e0073007400e4006c006c006e0069006e006700610072006e00610020006e00e40072002000640075002000760069006c006c00200073006b0061007000610020005000440046002d0064006f006b0075006d0065006e00740020006d006500640020006800f6006700720065002000620069006c0064007500700070006c00f60073006e0069006e00670020006600f60072002000700072006500700072006500730073007500740073006b0072006900660074006500720020006100760020006800f600670020006b00760061006c0069007400650074002e0020005000440046002d0064006f006b0075006d0065006e00740065006e0020006b0061006e002000f600700070006e006100730020006d006500640020004100630072006f0062006100740020006f00630068002000520065006100640065007200200035002e003000200065006c006c00650072002000730065006e006100720065002e00200044006500730073006100200069006e0073007400e4006c006c006e0069006e0067006100720020006b007200e400760065007200200069006e006b006c00750064006500720069006e00670020006100760020007400650063006b0065006e0073006e006900740074002e> >> >> setdistillerparams << /HWResolution [2400 2400] /PageSize [612.000 792.000] >> setpagedevice