- •16. ADVANCED LADDER LOGIC FUNCTIONS
- •16.1 INTRODUCTION
- •16.2 LIST FUNCTIONS
- •16.2.1 Shift Registers
- •16.2.2 Stacks
- •16.2.3 Sequencers
- •16.3 PROGRAM CONTROL
- •16.3.1 Branching and Looping
- •16.3.2 Fault Detection and Interrupts
- •16.4 INPUT AND OUTPUT FUNCTIONS
- •16.4.1 Immediate I/O Instructions
- •16.4.2 Block Transfer Functions
- •16.5 DESIGN TECHNIQUES
- •16.5.1 State Diagrams
- •16.6 DESIGN CASES
- •16.6.1 If-Then
- •16.6.2 Traffic Light
- •16.7 SUMMARY
- •16.8 PRACTICE PROBLEMS
- •16.9 PRACTICE PROBLEM SOLUTIONS
- •16.10 ASSIGNMENT PROBLEMS
- •17. OPEN CONTROLLERS
- •17.1 INTRODUCTION
- •17.3 OPEN ARCHITECTURE CONTROLLERS
- •17.4 SUMMARY
- •17.5 PRACTICE PROBLEMS
- •17.6 PRACTICE PROBLEM SOLUTIONS
- •17.7 ASSIGNMENT PROBLEMS
- •18. INSTRUCTION LIST PROGRAMMING
- •18.1 INTRODUCTION
- •18.2 THE IEC 61131 VERSION
- •18.3 THE ALLEN-BRADLEY VERSION
- •18.4 SUMMARY
- •18.5 PRACTICE PROBLEMS
- •18.6 PRACTICE PROBLEM SOLUTIONS
- •18.7 ASSIGNMENT PROBLEMS
- •19. STRUCTURED TEXT PROGRAMMING
- •19.1 INTRODUCTION
- •19.2 THE LANGUAGE
- •19.3 SUMMARY
- •19.4 PRACTICE PROBLEMS
- •19.5 PRACTICE PROBLEM SOLUTIONS
- •19.6 ASSIGNMENT PROBLEMS
- •20. SEQUENTIAL FUNCTION CHARTS
- •20.1 INTRODUCTION
- •20.2 A COMPARISON OF METHODS
- •20.3 SUMMARY
- •20.4 PRACTICE PROBLEMS
- •20.5 PRACTICE PROBLEM SOLUTIONS
- •20.6 ASSIGNMENT PROBLEMS
- •21. FUNCTION BLOCK PROGRAMMING
- •21.1 INTRODUCTION
- •21.2 CREATING FUNCTION BLOCKS
- •21.3 DESIGN CASE
- •21.4 SUMMARY
- •21.5 PRACTICE PROBLEMS
- •21.6 PRACTICE PROBLEM SOLUTIONS
- •21.7 ASSIGNMENT PROBLEMS
- •22. ANALOG INPUTS AND OUTPUTS
- •22.1 INTRODUCTION
- •22.2 ANALOG INPUTS
- •22.2.1 Analog Inputs With a PLC
- •22.3 ANALOG OUTPUTS
- •22.3.1 Analog Outputs With A PLC
- •22.3.2 Pulse Width Modulation (PWM) Outputs
- •22.3.3 Shielding
- •22.4 DESIGN CASES
- •22.4.1 Process Monitor
- •22.5 SUMMARY
- •22.6 PRACTICE PROBLEMS
- •22.7 PRACTICE PROBLEM SOLUTIONS
- •22.8 ASSIGNMENT PROBLEMS
- •23. CONTINUOUS SENSORS
- •23.1 INTRODUCTION
- •23.2 INDUSTRIAL SENSORS
- •23.2.1 Angular Displacement
- •23.2.1.1 - Potentiometers
- •23.2.2 Encoders
- •23.2.2.1 - Tachometers
- •23.2.3 Linear Position
- •23.2.3.1 - Potentiometers
- •23.2.3.2 - Linear Variable Differential Transformers (LVDT)
- •23.2.3.3 - Moire Fringes
- •23.2.3.4 - Accelerometers
- •23.2.4 Forces and Moments
- •23.2.4.1 - Strain Gages
- •23.2.4.2 - Piezoelectric
- •23.2.5 Liquids and Gases
- •23.2.5.1 - Pressure
- •23.2.5.2 - Venturi Valves
- •23.2.5.3 - Coriolis Flow Meter
- •23.2.5.4 - Magnetic Flow Meter
- •23.2.5.5 - Ultrasonic Flow Meter
- •23.2.5.6 - Vortex Flow Meter
- •23.2.5.7 - Positive Displacement Meters
- •23.2.5.8 - Pitot Tubes
- •23.2.6 Temperature
- •23.2.6.1 - Resistive Temperature Detectors (RTDs)
- •23.2.6.2 - Thermocouples
- •23.2.6.3 - Thermistors
- •23.2.6.4 - Other Sensors
- •23.2.7 Light
- •23.2.7.1 - Light Dependant Resistors (LDR)
- •23.2.8 Chemical
- •23.2.8.2 - Conductivity
- •23.2.9 Others
- •23.3 INPUT ISSUES
- •23.4 SENSOR GLOSSARY
- •23.5 SUMMARY
- •23.6 REFERENCES
- •23.7 PRACTICE PROBLEMS
- •23.8 PRACTICE PROBLEM SOLUTIONS
- •23.9 ASSIGNMENT PROBLEMS
- •24. CONTINUOUS ACTUATORS
- •24.1 INTRODUCTION
- •24.2 ELECTRIC MOTORS
- •24.2.1 Basic Brushed DC Motors
- •24.2.2 AC Motors
- •24.2.3 Brushless DC Motors
- •24.2.4 Stepper Motors
- •24.2.5 Wound Field Motors
plc analog - 22.22
1" or less typical
Figure 22.18 A Twisted Pair
When designing shielding, the following design points will reduce the effects of electromagnetic interference.
•Avoid “noisy” equipment when possible.
•Choose a metal cabinet that will shield the control electronics.
•Use shielded cables and twisted pair wires.
•Separate high current, and AC/DC wires from each other when possible.
•Use current oriented methods such as sourcing and sinking for logical I/O.
•Use high frequency filters to eliminate high frequency noise.
•Use power line filters to eliminate noise from the power supply.
22.4DESIGN CASES
22.4.1Process Monitor
Problem: Design ladder logic that will monitor the dimension of a part in a die. If
the
Solution:
22.5SUMMARY
•A/D conversion will convert a continuous value to an integer value.
•D/A conversion is easier and faster and will convert a digital value to an analog value.
•Resolution limits the accuracy of A/D and D/A converters.
•Sampling too slowly will alias the real signal.
•Analog inputs are sensitive to noise.
•The analog I/O cards are configured with a few words of memory.
•BTW and BTR functions are needed to communicate with the analog I/O cards.
plc analog - 22.23
•Analog shielding should be used to improve the quality of electrical signals.
22.6PRACTICE PROBLEMS
1.Analog inputs require:
a)A Digital to Analog conversion at the PLC input interface module
b)Analog to Digital conversion at the PLC input interface module
c)No conversion is required
d)None of the above
2.You need to read an analog voltage that has a range of -10V to 10V to a precision of +/-0.05V. What resolution of A/D converter is needed?
3.We are given a 12 bit analog input with a range of -10V to 10V. If we put in 2.735V, what will the integer value be after the A/D conversion? What is the error? What voltage can we calculate?
4.Use manuals on the web for an analog input card, and describe the process that would be needed to set up the card to read an input voltage between -2V and 7V. This description should include jumper settings, configuration memory and ladder logic.
5.We need to select a digital to analog converter for an application. The output will vary from -5V to 10V DC, and we need to be able to specify the voltage to within 50mV. What resolution will be required? How many bits will this D/A converter need? What will the accuracy be?
6.Write a program that will input an analog voltage, do the calculation below, and output an analog voltage.
Vout = ln ( Vin)
7.The following calculation will be made when input A is true. If the result x is between 1 and 10 then the output B will be turned on. The value of x will be output as an analog voltage. Create a ladder logic program to perform these tasks.
A = I:000/00 x = 5y1 + sin y B = O:001/00
x = F8:0 y = F8:1
8.You are developing a controller for a game that measures hand strength. To do this a START button is pushed, 3 seconds later a LIGHT is turned on for one second to let the user know when to start squeezing. The analog value is read at 0.3s after the light is on. The value is converted to a force F with the equation below. The force is displayed by converting it to BCD and
plc analog - 22.24
writing it to an output card (O:001). If the value exceeds 100 then a BIG_LIGHT and SIREN are turned on for 5sec. Use a structured design technique to develop ladder logic..
Vin
F = ------
6
22.7 PRACTICE PROBLEM SOLUTIONS
1. b)
2.
R = |
10---------------------------------V – ( –10V) |
= 200 |
7 bits = 128 |
|
0.1V |
|
8 bits = 256 |
The minimum number of bits is 8.
3.
N = 12 |
R = 4096 |
|
|
Vmin |
|
= –10V |
Vmax = 10V |
Vin = 2.735V |
|||||||||||
|
|
= |
|
|
|
Vin – Vmin |
|
|
|
= |
2608 |
|
|
||||||
V |
|
INT |
|
|
R |
|
|
||||||||||||
|
|
---------------------------- |
|
|
|||||||||||||||
|
I |
|
|
|
|
V |
|
– V |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
max |
|
|
min |
|
|
|
|
|
|
|
|
|
|
|
|
VI |
|
|
|
|
|
|
|
|
|
|
|
|
||||
V |
|
= |
|
( V |
|
– V |
|
|
) |
+ V |
|
|
= 2.734V |
|
|
||||
|
---- |
|
|
|
|
|
|
|
|
||||||||||
|
C |
|
R |
|
max |
|
min |
|
|
|
|
min |
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
4.for the 1771-IFE card you would put keying in the back of the card, because voltage is being measured, jumpers inside the card are already in the default position. Calibration might be required, this can be done using jumper settings and suppling known voltages, then adjusting trim potentiometers on the card. The card can then be installed in the rack - it is recommended that they be as close to the CPU as possible. After the programming software is running the card is added to the IO configuration, and automatic settings can be used - these change the memory values to set values in integer memory.
plc analog - 22.25
5.
A card with a voltage range from -10V to +10V will be selected to cover the entire range.
R = |
10---------------------------------V – ( –10V) |
= 400 |
minimum resolution |
|
0.050V |
|
|
8 bits = 256
9 bits = 512
10 bits = 1024
The A/D converter needs a minimum of 9 bits, but this number of bits is not commonly available, but 10 bits is, so that will be selected.
V |
|
= |
Vmax |
– Vmin |
10V – ( –10V) |
= |
± 0.00976V |
ERROR |
---------------------------- |
= |
--------------------------------- |
||||
|
|
2R |
2( 1024) |
|
|
||
|
|
|
|
plc analog - 22.26
6.
FS
BT9:1/EN BT9:0/EN
BT9:1/EN
BT9:1/DN
BTW
Rack 0
Group 0
Module 0
Control Block BT9:0
Data N7:0
Length 37
Continuous No
BTR
Rack 0
Group 0
Module 0
Control Block BT9:1
Data N7:37
Length 20
Continuous No
BTW
Rack 0
Group 1
Module 0
Control Block BT9:2
Data N7:57
Length 13
Continuous No
CPT
Dest N7:57 Expression "LN (N7:41)"
plc analog - 22.27
7.
A
LIM
lower lim. 1 value F8:0 upper lim. 10
SIN
Source A F8:1
Dest. F8:0
ADD
Source A 1
Source B F8:0
Dest. F8:0
SQR
Source A F8:0
Dest. F8:0
XPY
Source A 5
Source B F8:1
Dest. F8:2
MUL
Source A F8:0
Source B F8:2
Dest. F8:0
B
A |
|
|
|
|
MOV |
|
|
|
|
|
|||
|
|
|
|
|
Source A F8:0 |
|
|
|
|
|
|
||
|
|
|
|
|
Dest. N7:0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A |
|
BT9:0/EN |
BTW |
|||
|
Rack 0 |
|||||
|
|
|
|
|||
|
|
|
|
|
||
|
|
|
|
|
Group 0 |
|
|
|
|
|
|
||
|
|
|
|
|
Module 0 |
|
|
|
|
|
|
Control Block BT9:0 |
|
|
|
|
|
|
Data N7:0 |
|
|
|
|
|
|
Length 13 |
|
|
|
|
|
|
Continuous No |
|
|
|
|
|
|
|
|
plc analog - 22.28
8. |
|
|
|
|
|
|
|
|
FS |
S1 |
TON(S1,START) |
S2 |
F>100 |
S3 |
|
||
|
waiting |
|
|
sampling |
|
winner |
|
|
|
|
TON(S2, 1sec) |
|
|
|
|
|
|
|
FS |
|
|
TON(S3, 5sec) |
|
|
|
|
|
L |
ST1 |
|
|
|
|
|
|
|
|
|
|
TON |
|
|
||
|
|
|
|
|
|
|
|
|
|
|
U |
ST2 |
|
|
T4:1 |
|
|
|
|
|
|
preset 1s |
|
|
||
|
|
|
|
|
|
|
|
|
|
|
U |
ST3 |
T4:0/DN |
|
BTR |
|
|
|
|
BTW |
|
|
|
Device Analog Input |
|
|
|
|
|
|
|
location 000 |
|
||
|
|
Device Analog Input |
|
|
Control BT10:1 |
|
||
|
|
location 000 |
|
|
Data N9:40 |
|
||
|
|
Control BT10:0 |
|
|
Length 20 |
|
|
|
|
|
Data N9:0 |
|
BT10:1/DN |
|
DIV |
|
|
|
|
Length 37 |
|
|
|
|
|
|
|
|
|
|
|
Source A N9:40 |
|
||
|
ST2 |
|
|
|
|
|
||
|
|
LIGHT |
T4:1/DN |
Source B 6 |
|
|
||
|
|
|
|
|
||||
|
ST3 |
|
|
T4:1/DN |
|
Dest. N7:0 |
|
|
|
|
|
|
U |
ST2 |
|
||
|
|
|
BIG_LIGHT |
|
|
|||
|
|
|
SIREN |
|
|
L |
ST1 |
|
|
ST1 |
MCR |
|
|
|
|
|
|
|
|
|
|
TOD |
|
|
||
|
START |
|
|
|
|
|
|
|
|
TON |
|
|
Source A N7:0 |
|
|||
|
|
|
|
Dest. O:001 |
|
|||
|
T4:0/TT |
T4:0 |
|
|
|
|||
|
T4:1/DN |
GRT |
|
|
|
|||
|
preset 3s |
|
U |
ST1 |
||||
|
|
|
||||||
|
|
|
Source A N7:0 |
|||||
|
|
|
|
|
||||
|
T4:0/DN |
|
|
|
|
|
||
|
U |
ST1 |
|
Source B 100 |
L |
ST3 |
||
|
|
|
|
|
|
|
||
|
|
L |
ST2 |
ST3 |
|
MCR |
|
|
|
|
|
|
|
MCR |
|
||
|
|
MOV |
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
Source 0.0 |
|
|
|
TON |
|
|
|
|
Dest F8:0 |
|
|
|
|
|
|
|
|
|
|
|
T4:2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MCR |
|
|
preset 5s |
|
|
|
|
|
T4:2/DN |
|
|
|
|
||
|
ST2 |
|
|
|
U |
ST3 |
|
|
|
MCR |
|
|
|
||||
|
|
|
|
|
||||
|
|
|
|
|
|
|
||
|
|
TON |
|
|
|
L |
ST1 |
|
|
|
|
|
|
|
|
|
|
|
|
T4:0 |
|
|
|
MCR |
|
|
|
|
preset 0.3s |
|
|
|
|
||
|
|
|
|
|
|
|
|