- •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 advanced functions - 16.18
A
X
UID
B
FAL Control R6:0 length 5 position 0 Mode all
Destination #N7:5 Expression #N7:0 + 5
UIE
Figure 16.18 Disabling Interrupts
16.4 INPUT AND OUTPUT FUNCTIONS
16.4.1 Immediate I/O Instructions
The input scan normally records the inputs before the program scan, and the output scan normally updates the outputs after the program scan, as shown in Figure 16.19. Immediate input and output instructions can be used to update some of the inputs or outputs during the program scan.
plc advanced functions - 16.19
• The normal operation of the PLC is
fast [input scan]
Input values scanned
slow [ladder logic is checked]
Outputs are updated in memory only, as the ladder logic is scanned
fast [outputs updated]
Output values are updated to match values in memory
Figure 16.19 Input, Program and Output Scan
Figure 16.20 shows a segment within a program that will update the input word I:001, determine a new value for O:010/01, and update the output word O:010 immediately. The process can be repeated many times during the program scan allowing faster than normal response times.
plc advanced functions - 16.20
e.g. Check for nuclear reactor overheat |
I:001/03 overheat sensor |
|||||
|
|
|
||||
|
|
|
O:010/01 reactor shutdown |
|||
|
|
|
|
|
IIN |
I:001 |
|
|
I:001/03 |
|
|
O:010/01 |
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
O:010
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.
Figure 16.20 Immediate Inputs and Outputs
16.4.2 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 BTW function. 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
plc advanced functions - 16.21
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.
Block Transfer Write
BT10:1/EN A Module Type Example Output Card
Rack 00
Group 3
Module 0
Control Block BT10:1
Data File N9:0
Length 10
Continuous No
Figure 16.21 A BTW Function
The BTR function is similar to the BTW function, except that it will read multiple values back from an input card. This gets values from the card O:000, and places 9 values in memory from N9:4 to N9:13. The function is continuous, so when it is complete, the process of reading from the card will begin again.
|
BT10:0/15 |
A |
|
BTR |
|||
|
|
||||||
|
|
Rack: 00 |
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Group: 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module: 0 |
|
|
|
|
|
|
|
BT Array: BT10:0 |
|
|
|
|
|
|
|
Data File: N9:4 |
|
|
|
|
|
|
|
Length: 9 |
|
|
|
|
|
|
|
Continuous: Yes |
|
|
|
|
|
|
|
|
Figure 16.22 A BTR Function