- •24.3 HYDRAULICS
- •24.4 OTHER SYSTEMS
- •24.5 SUMMARY
- •24.6 PRACTICE PROBLEMS
- •24.7 PRACTICE PROBLEM SOLUTIONS
- •24.8 ASSIGNMENT PROBLEMS
- •25. CONTINUOUS CONTROL
- •25.1 INTRODUCTION
- •25.2 CONTROL OF LOGICAL ACTUATOR SYSTEMS
- •25.3 CONTROL OF CONTINUOUS ACTUATOR SYSTEMS
- •25.3.1 Block Diagrams
- •25.3.2 Feedback Control Systems
- •25.3.3 Proportional Controllers
- •25.3.4 PID Control Systems
- •25.4 DESIGN CASES
- •25.4.1 Oven Temperature Control
- •25.4.2 Water Tank Level Control
- •25.5 SUMMARY
- •25.6 PRACTICE PROBLEMS
- •25.7 PRACTICE PROBLEM SOLUTIONS
- •25.8 ASSIGNMENT PROBLEMS
- •26. FUZZY LOGIC
- •26.1 INTRODUCTION
- •26.2 COMMERCIAL CONTROLLERS
- •26.3 REFERENCES
- •26.4 SUMMARY
- •26.5 PRACTICE PROBLEMS
- •26.6 PRACTICE PROBLEM SOLUTIONS
- •26.7 ASSIGNMENT PROBLEMS
- •27. SERIAL COMMUNICATION
- •27.1 INTRODUCTION
- •27.2 SERIAL COMMUNICATIONS
- •27.2.1.1 - ASCII Functions
- •27.3 PARALLEL COMMUNICATIONS
- •27.4 DESIGN CASES
- •27.4.1 PLC Interface To a Robot
- •27.5 SUMMARY
- •27.6 PRACTICE PROBLEMS
- •27.7 PRACTICE PROBLEM SOLUTIONS
- •27.8 ASSIGNMENT PROBLEMS
- •28. NETWORKING
- •28.1 INTRODUCTION
- •28.1.1 Topology
- •28.1.2 OSI Network Model
- •28.1.3 Networking Hardware
- •28.1.4 Control Network Issues
- •28.2 NETWORK STANDARDS
- •28.2.1 Devicenet
- •28.2.2 CANbus
- •28.2.3 Controlnet
- •28.2.4 Ethernet
- •28.2.5 Profibus
- •28.2.6 Sercos
- •28.3 PROPRIETARY NETWORKS
- •28.3.1 Data Highway
- •28.4 NETWORK COMPARISONS
- •28.5 DESIGN CASES
- •28.5.1 Devicenet
- •28.6 SUMMARY
- •28.7 PRACTICE PROBLEMS
- •28.8 PRACTICE PROBLEM SOLUTIONS
- •28.9 ASSIGNMENT PROBLEMS
- •29. INTERNET
- •29.1 INTRODUCTION
- •29.1.1 Computer Addresses
- •29.1.2 Phone Lines
- •29.1.3 Mail Transfer Protocols
- •29.1.4 FTP - File Transfer Protocol
- •29.1.5 HTTP - Hypertext Transfer Protocol
- •29.1.6 Novell
- •29.1.7 Security
- •29.1.7.1 - Firewall
- •29.1.7.2 - IP Masquerading
- •29.1.8 HTML - Hyper Text Markup Language
- •29.1.9 URLs
- •29.1.10 Encryption
- •29.1.11 Compression
- •29.1.12 Clients and Servers
- •29.1.13 Java
- •29.1.14 Javascript
- •29.1.16 ActiveX
- •29.1.17 Graphics
- •29.2 DESIGN CASES
- •29.2.1 Remote Monitoring System
- •29.3 SUMMARY
- •29.4 PRACTICE PROBLEMS
- •29.5 PRACTICE PROBLEM SOLUTIONS
- •29.6 ASSIGNMENT PROBLEMS
- •30. HUMAN MACHINE INTERFACES (HMI)
- •30.1 INTRODUCTION
- •30.2 HMI/MMI DESIGN
- •30.3 DESIGN CASES
- •30.4 SUMMARY
- •30.5 PRACTICE PROBLEMS
- •30.6 PRACTICE PROBLEM SOLUTIONS
- •30.7 ASSIGNMENT PROBLEMS
- •31. ELECTRICAL DESIGN AND CONSTRUCTION
- •31.1 INTRODUCTION
- •31.2 ELECTRICAL WIRING DIAGRAMS
- •31.2.1 Selecting Voltages
- •31.2.2 Grounding
- •31.2.3 Wiring
- •31.2.4 Suppressors
- •31.2.5 PLC Enclosures
- •31.2.6 Wire and Cable Grouping
- •31.3 FAIL-SAFE DESIGN
- •31.4 SAFETY RULES SUMMARY
- •31.5 REFERENCES
- •31.6 SUMMARY
- •31.7 PRACTICE PROBLEMS
- •31.8 PRACTICE PROBLEM SOLUTIONS
- •31.9 ASSIGNMENT PROBLEMS
- •32. SOFTWARE ENGINEERING
- •32.1 INTRODUCTION
- •32.1.1 Fail Safe Design
- •32.2 DEBUGGING
- •32.2.1 Troubleshooting
- •32.2.2 Forcing
- •32.3 PROCESS MODELLING
- •32.4 PROGRAMMING FOR LARGE SYSTEMS
- •32.4.1 Developing a Program Structure
- •32.4.2 Program Verification and Simulation
- •32.5 DOCUMENTATION
- •32.6 COMMISIONING
- •32.7 REFERENCES
- •32.8 SUMMARY
- •32.9 PRACTICE PROBLEMS
- •32.10 PRACTICE PROBLEM SOLUTIONS
- •32.11 ASSIGNMENT PROBLEMS
- •33. SELECTING A PLC
- •33.1 INTRODUCTION
- •33.2 SPECIAL I/O MODULES
- •33.3 SUMMARY
- •33.4 PRACTICE PROBLEMS
- •33.5 PRACTICE PROBLEM SOLUTIONS
- •33.6 ASSIGNMENT PROBLEMS
- •34. FUNCTION REFERENCE
- •34.1 FUNCTION DESCRIPTIONS
- •34.1.1 General Functions
- •34.1.2 Program Control
- •34.1.3 Timers and Counters
- •34.1.4 Compare
- •34.1.5 Calculation and Conversion
- •34.1.6 Logical
- •34.1.7 Move
- •34.1.8 File
- •34.1.10 Program Control
- •34.1.11 Advanced Input/Output
- •34.1.12 String
- •34.2 DATA TYPES
plc function ref - 34.20
34.1.6 Logical
AND, OR, XOR - AND, OR, eXclusive OR |
|
|
|||
|
|
|
|
|
|
|
|
A |
AND |
|
|
|
|
||||
|
|
|
|
BITWISE AND |
|
|
|
|
|
|
|
|
|
|
|
Source A |
N7:0 |
|
|
|
|
||
|
|
|
|
Source B |
N7:1 |
|
|
|
|
Dest |
N7:2 |
|
|
|
|
||
|
|
|
|
|
|
Description: |
These functions do basic boolean operations to the numbers in locations |
|
|
|
A and B. The results of the operation are stored in Dest. These calcu- |
|
|
lations will be perform whenever the input is true. The functions are, |
|
AND - Bitwise and |
|
|
OR - Bitwise or |
|
|
XOR - Bitwise exclusive or |
|
Status Bits: |
C |
Carry - always 0 |
|
V |
Overflow - always 0 |
|
Z |
Zero - sets if the result is zero. |
|
S |
Sign - sets if the MSB of the result is set |
Registers: none
Available on: Micrologix, PLC-5
NOT - NOT
Description:
A |
|
NOT |
|
|
|
NOT |
|
|
|
||
|
|
Source |
N7:0 |
|
|
||
|
|
Dest |
N7:1 |
This function will invert all of the bits in a word in memory whenever the input is true.
Status Bits: |
C |
Carry - always 0 |
|
V |
Overflow - always 0 |
|
Z |
Zero - sets if the result is zero. |
|
S |
Sign - sets if the MSB of the result is set |
Registers: none
Available on: Micrologix, PLC-5
plc function ref - 34.21
34.1.7 Move
BTD - BiT Distribute |
|
|
|||
|
|
|
|
|
|
|
|
A |
BTD |
|
|
|
|
||||
|
|
|
|
BIT FIELD DISTRIB |
|
|
|
|
|
||
|
|
|
|
Source |
N7:0 |
|
|
|
|
||
|
|
|
|
Source bit |
0 |
|
|
|
|
Dest |
N7:1 |
|
|
|
|
||
|
|
|
|
Dest bit |
4 |
|
|
|
|
Length |
5 |
|
|
|
|
|
|
Description:
Status Bits:
Registers:
This function will copy the bits starting at N7:0/0 to N7:1/4 for a length of 5 bits.
none
none
Available on: Micrologix, PLC-5
MOV - MOVe
Description:
A |
|
MOV |
|
|
|
MOVE |
|
|
|
||
|
|
Source |
N7:0 |
|
|
||
|
|
Dest |
N7:1 |
This instruction will move values from one location to another, and if necessary change value types, such as integer to a floating point.
Status Bits: |
C |
Carry - always 0 |
|
V |
Overflow - Sets if an overflow occurred during conversion |
|
Z |
Zero - sets if the result is zero. |
|
S |
Sign - sets if the MSB of the result is set |
Registers: none
Available on: Micrologix, PLC-5
plc function ref - 34.22
MVM - MoVe Masked
Description:
Status Bits:
A |
|
MVM |
|
|
|
MAKSED MOVE |
|
|
|||
|
|
Source |
N7:0 |
|
|
||
|
|
Mask |
N7:1 |
|
|
Dest |
N7:2 |
|
|
|
|
This function will retrieve the values from the source and mask memory and AND them together. Only the bits that are true in the mask will be copied to the new location.
C |
Carry - always 0 |
V |
Overflow - always 0 |
Z |
Zero - sets if the result is zero. |
S |
Sign - sets if the MSB of the result is set |
Registers: none
Available on: Micrologix, PLC-5
34.1.8 File
Most file instructions will contain Mode options. The user may choose these with the implications listed below.
All - All of the operations will be completed in a single scan when the input to the function is edge triggered. Care must be used not to create an operation so long it causes a watchdog fault in the PLC
Incremental - Each time there is a positive input edge the function will advance the file operation by one.
’number’ - when a number is supplied the function will perform that many iterations while the input rung is true.
plc function ref - 34.23
COP - file COPy |
|
|
|
||||
|
|
A |
|
COP |
|
|
|
|
|
|
|||||
|
|
|
|
COPY FILE |
|
|
|
|
|
|
|
|
|||
|
|
|
|
Source |
#N7:50 |
|
|
|
|
|
|
||||
|
|
|
|
Dest |
#N7:20 |
|
|
|
|
|
|
Length |
4 |
|
|
Description: |
|||||||
|
|
|
|||||
This instruction copies from one list to another. When ’A’ is true the |
|||||||
|
|
|
instruction will copy the entire source list to the destination location in |
||||
|
|
|
a single scan. In this example this would mean N7:20=N7:50, |
||||
|
|
|
N7:21=N7:51, N7:22=N7:52 and N7:23=N7:53. The source values |
||||
|
|
|
are not changed. This instruction will not convert data types. |
||||
Status Bits: |
none |
|
|
||||
Registers: |
none |
|
|
Available on: Micrologix, PLC-5
plc function ref - 34.24
FAL - File Arithmetic and Logic |
|
|
|||
|
|
A |
FAL |
|
|
|
|
||||
|
|
|
|
FILE ARITH/LOGICAL |
|
|
|
|
|
||
|
|
|
|
Control |
R6:0 |
|
|
|
|
||
|
|
|
|
Length |
10 |
|
|
|
|
Position |
0 |
|
|
|
|
||
|
|
|
|
Mode |
ALL |
|
|
|
|
Dest |
#N7:10 |
|
|
|
|
Expression |
#N7:0 - N7:21 |
|
|
|
|
|
|
Description: |
This function will evaluate the expression over a range of values. The |
|
|
length specifies the number of positions in the expression and destina- |
|
|
tion files. The position value will be updated to indicate the current |
|
|
position in the calculation. See earlier in this section for a description |
|
|
of the Mode variable. This example would perform all of the calcula- |
|
|
tions in a single scan. These calculations would be N7:10=N7:0- |
|
|
N7:21, N7:11=N7:1-N7:21, ......N7:19=N7:9-N7:21. More complex |
|
|
mathematical expressions can be used with the following operators; |
|
|
|
+, -, *, | - basic math |
|
|
BCD/FRD - BCD conversion |
|
|
SQR - square root |
|
|
AND, OR, NOT, XOR - Boolean operators |
|
|
Note: advanced math operators are also available |
Status Bits: |
EN |
enable - this will be on while the function is active |
|
DN |
done - this will be on when a calculation has completed |
|
ER |
error - this will be set if there was an error during calculation |
Registers: |
POS |
position - tracks the current position in the list |
|
LEN |
length - the length of the file |
Available on: Micrologix, PLC-5
plc function ref - 34.25
FLL - file FiLL |
|
|
|
||
|
|
A |
|
FLL |
|
|
|
||||
|
|
|
|
FILE FILL |
|
|
|
|
|
||
|
|
|
|
Source |
F8:0 |
|
|
|
|
||
|
|
|
|
Destination |
#F8:30 |
|
|
|
|
Length |
10 |
|
|
|
|||
|
|
|
|
|
|
Description: |
The contents of a single memory location are copied into a list. In this |
|
example the value in ’F8:0’ is copied into locations ’F8:30’ to ’F8:39’ |
|
each scan when ’A’ is true. The source value is not changed. This |
|
instruction will not convert data types. |
Status Bits: |
none |
Registers: |
none |
Available on: Micrologix, PLC-5
plc function ref - 34.26
FSC - File Search and Compare |
|
|
|
|
|||
|
|
A |
FSC |
|
|
X |
|
|
|
|
|||||
|
|
|
|
FILE SEARCH/COMPARE |
|
||
|
|
|
|
|
|
||
|
|
|
|
Control |
R6:36 |
|
|
|
|
|
|
|
|
||
|
|
|
|
Length |
14 |
|
|
|
|
|
|
Position |
0 |
|
|
|
|
|
|
|
|
||
|
|
|
|
Mode |
3 |
|
|
|
|
|
|
Expression |
#F8:5 > F8:0 |
|
|
|
|
|
|
|
|
|
|
Description:
Status Bits:
Registers:
lists of numbers can be compared using the FSC command. When ’A’ becomes true the function will start to compare values as determined by the ’Mode’ (see the beginning of this section for details on the mode). The expression will be evaluated from the initial locations in the expression. The end of the list is determined by the Length. In this example 3 values will be evaluated for each scan. The comparison in the first scan will be F8:5>F8:0, F8:6>F8:0 and F8:7>F8:0. This instruction will continue until all 14 values have been compared, and all are true, at which time X will turn on and stay on while A is on. If any values are false the compare will stop, and the output will stay off.
EN |
enable - will be on while the instruction input is on |
DN |
done - will be on when the length is reached, or a false compare |
|
occurred |
ER |
error - will occur if there is an error in the expression or range |
IN |
inhibit - if a false statement is found the inhibit bit will be set. if |
|
this is turned off (i.e., R6:36/IN=0) the search will continue |
FD |
found - this bit will be set when a false condition is found |
LEN |
length - the number of the comparison list |
POS |
position - the current position in the comparison list |
Available on: Micrologix, PLC-5
plc function ref - 34.27
BSL, BSR - Bit Shift Left, Bit Shift Right |
|
|
|||
|
|
A |
BSL |
|
|
|
|
||||
|
|
|
|
BIT SHIFT LEFT |
|
|
|
|
|
||
|
|
|
|
File |
#B3:0 |
|
|
|
|
||
|
|
|
|
Control |
R6:0 |
|
|
|
|
Bit Address |
I:0.0/0 |
|
|
|
|
||
|
|
|
|
Length |
6 |
Description: |
These functions will shift bits through left or right through a string of bits |
|
|
starting at #B3:0 with a length of 6 in the example above. As the bits |
|
|
shift the bit shifted out will be put in the UL bit. A new bit will be |
|
|
shifted into the vacant spot from the Bit Address. When the bits are |
|
|
shifted they are moved in the memory locations starting at file #B3:0. |
|
|
The two options available are: |
|
|
|
BSR - Bit Shift Right |
|
|
BSL - Bit Shift Left |
Status Bits: |
EN |
Enable - is on when the input to the function is on |
|
DN |
Done - is on when the shift operation is complete |
|
ER |
Error - indicates when an error has occurred |
|
UL |
Unload - the unloaded value is stored in this bit |
Registers: |
none |
|
Available on: Micrologix, PLC-5
plc function ref - 34.28
FFL, FFU, LFL, LFU - FiFo Load, FiFo Unload, LiFo Load, LiFo Unload
|
A |
|
FFL |
|
|
|
|
||
|
|
|
FIFO LOAD |
|
|
|
|
||
|
|
|
Source |
N7:0 |
|
|
|
||
|
|
|
FIFO |
N7:10 |
|
|
|
Control |
R6:0 |
|
|
|
Length |
10 |
|
|
|
Position |
0 |
|
|
|
|
|
|
|
|
|
|
|
B |
|
FFU |
|
|
|
|
FIFO UNLOAD |
|
|
|
|
|
|
|
|
|
FIFO |
N7:10 |
|
|
|
Dest |
N7:11 |
|
|
|
Control |
R6:0 |
|
|
|
Length |
10 |
|
|
|
||
|
|
|
Position |
0 |
|
|
|
|
|
Description: |
Stack instructions will take integer words and store them, and then allow |
|
|
later retrieval. The load instructions will store a value on the stack on a |
|
|
false to true input change. The Unload instructions will remove a |
|
|
value from that stack and store it in the Dest location. A Last On First |
|
|
Off stack will return the last value pushed on. A First On First Off |
|
|
stack will give the oldest value on the stack. If an attempt to load more |
|
|
than the stack length, the values will be ignored. The instructions |
|
|
available are: |
|
|
FFL - FIFO stack load |
|
|
FFU - FIFO stack unload |
|
|
LFL - LIFO stack load |
|
|
LFU - LIFO stack unload |
|
Status Bits: |
EN |
Enable - is on when the input to the function is on |
|
DN |
Done - is on when the shift operation is complete |
|
ER |
Error - indicates when an error has occurred |
|
UL |
Unload - the unloaded value is stored in this bit |
Registers: |
none |
|
Available on: Micrologix, PLC-5
plc function ref - 34.29
SQI - SeQuencer Input |
|
|
|||
|
|
A |
SQI |
|
|
|
|
||||
|
|
|
|
SEQUENCER INPUT |
|
|
|
|
|
||
|
|
|
|
File |
#N7:10 |
|
|
|
|
||
|
|
|
|
Mask |
FF00 |
|
|
|
|
Source |
N7:0 |
|
|
|
|
||
|
|
|
|
Control |
R6:0 |
|
|
|
|
Length |
7 |
|
|
|
|
Position |
0 |
Description: |
This will compare a source value to a set of values in a sequencer table. |
|
|
In this example the 8 most significant bits of ’N7:0’ will be loaded |
|
|
each time ’A’ goes from false to true. The sequencer will load words |
|
|
from ’N7:10’ to ’N7:17’. |
|
Status Bits: |
EN |
enable - true when the function is enabled |
|
DN |
done - set when the sequencer is full |
|
ER |
error - set if an error has occured |
Registers: |
POS |
position - the current location in the sequencer |
|
LEN |
length - the total length of the sequencer |
Available on: Micrologix, PLC-5
SQL - SeQuencer Load |
|
|
|||
|
|
A |
SQL |
|
|
|
|
||||
|
|
|
|
SEQUENCER LOAD |
|
|
|
|
|
||
|
|
|
|
File |
#N7:10 |
|
|
|
|
||
|
|
|
|
Source |
N7:0 |
|
|
|
|
Control |
R6:0 |
|
|
|
|
||
|
|
|
|
Length |
6 |
|
|
|
|
Position |
0 |
|
|
|
|
|
|
Description: |
When the input goes from false to true the value at the source will be |
|
|
loaded into the sequencer. After the position has reached the length the |
|
|
following values will be ignored, and the done bit will be set. |
|
Status Bits: |
EN |
Enable - will be true when the input to the function is true |
|
DN |
Done - will be set when the sequencer is fully loaded |
|
ER |
Error - will be set when there has been an error |
Registers: |
none |
|
Available on: Micrologix, PLC-5