Sie sind auf Seite 1von 56

Week 5-6

17 - 28 Feb. 2014

Special Contacts (PLC Functions)


Generally there are many special purpose contacts which are available
to programmers
Special Contacts include:
One Shot Rising
Immediate Input Instruction
Immediate Output Instruction

One Shot Rising:


An input instruction that can trigger an event to occur only once

When the rung condition changes from false to true, OSR will be true for
once scan only

Immediate Input Instruction


Immediate input instruction is generally used when the input
is highly time dependent (mainly analog inputs)
Example:
Consider that we have to read an input every 10 milliseconds but the
ladder evaluation time is 50 milliseconds!!!
The scan time would be too slow in this specific case.

The use of this instruction allows the input to be updated


immediately
Rockwell SLC 500 IIM Instruction:
When the CPU encounters this rung,
it interrupts the scan and the data from
the I/O Slots is moved through a mask to the input table and then
evaluated
The length specifies number of words to be fetched (in SLC up till 8
words can be specified for a slot)

Immediate Input Instruction


Use of Masks?
Used for bit wise operation on a word
A 1 in the bit position in the mask allow the data to be placed from source
to destination
A 0 in the bit position in the mask inhibits the data to be placed from source
to destination

Thus IIM instruction get the real time states of the actual inputs and
places them in the input image table
After the IIM instruction has been evaluated, the CPU returns to
evaluating the logic
Mainly used when time is a crucial factor
Examples of Usage:
Motor Control (Position or Velocity Control)

Immediate Output Instruction


Used to update output states immediately.
In some cases the ladder scan times is
longer then the updated time for outputs
A specific mask can be specified to perform bit wise operations

The CPU exists the ladder logic evaluation and immediately outputs the
value to the specific output slot
Used where performance required immediate output
Example:
It might be a safety problem if an output was not turned ON before an entire
scan
Motor control command for position or velocity control

Program Flow Instructions (Program Control)


They can be used to control the sequence in which the program is
executed
Allows the programmer to change the sequence in which the CPU
evaluates the logic
These instructions are mainly used to reduce scan time and create
efficient programs
Rockwell Program Flow Instructions:
JMP/LBL (with tags specified) instructions are used in pairs
These instructions can be used to avoid a certain part of the ladder logic
when it might be irrelevant
It is possible to Jump Forward & Backward in the ladder
Whenever the rung containing the JMP instruction becomes true, it jumps
to the rung containing the LBL instruction

Use of JMP/LBL Instruction

Subroutines Instructions
Rockwell has Subroutines instructions available as well such as JSR
(Jump to Subroutine), SBR (Subroutine) and RET (return)
All these above mentioned functions are used together
JSR (Jump to Subroutine):
This instruction specifies the File number/ Subroutine to jump to when a
specified condition becomes true

SBR (Subroutine):
This instruction should be present in the first rung of the subroutine

RET (Return):
This instruction should be present at the end of the subroutine/ File
number

Example of JSR, SR & RET

Math Instructions
Rslogix 500 has many Arithmetic, Relational & Logical instructions set
which can be useful in a lot of cases
Many applications require mathematical calculations, thus these
arithmetic operations can be very useful

For example conversion of Degrees to Radians


Addition of Variables
Conversion of Temperature (Celsius to Fahrenheit)
Taking Log of a certain variable

Lots of applications require comparison (or threshold in certain cases)


Example:
If Temperature is less then 20 then perform a certain operation
If Temperature is greater then 20 and less then 50 then perform another
operation

Arithmetic Operations
ADD Operation:
The Add functions adds source A to source B
The Add operator becomes active whenever the
contact becomes energized
The data is always converted to the destination type (if destination is Integer
the value will be stored as integer even if it is a float)
In case of addition the sequence of variables can change (the end result will be
same), but it is not true for Subtraction and Division

Arithmetic Operations
Subtract Operation:
The Subtract functions subtracts Source B
from source A
The Subtract operator becomes active whenever
the contact becomes energized
The data is always converted to the destination type (if destination is Integer
the value will be stored as integer even if it is a float)

Multiply Operation:
Multiplies two number and stores in the destination
address
Operator becomes active whenever
the contact becomes energized

Arithmetic Operations
Division Operator:
Divides Source A by Source B and stores in the
destination address
Operator becomes active whenever
the contact becomes energized

Other Operators
Negation Operator:
It is used to change sign of the source value
A positive number becomes negative and
a negative number becomes positive

Square Root Operator:


Takes the square root of the source value and
places it at the destination

Clear Operator:
Clears the value at the destination (places Zero)

Absolute Operator:
Provides the absolute of the Source Value at
the Destination

Example

Other Operators
Scale with Parameters:
Defines a linear Scales on an input value
defined (with a Minimum & Maximum) to a Scaled
minimum & Scaled Maximum
Linear
Scaling

y mx b
m

( Scaled _ max Scaled _ min)


( Input _ max Input _ min)

b Scaled _ min m Input _ min

Other Operators
Scale with Parameters:
Defines a linear Scales on an input value
defined (with a Minimum & Maximum)
to a Scaled minimum & Scaled Maximum

Advanced Mathematical Operations


Most of these functions are not available in the Demo Version

Implementation of a Mathematical Function

Boolean Operators
Bitwise AND:
Converts integers to Binary and
and then performs AND operation
bit by bit

Boolean Operators

Boolean Operators
Bitwise OR:
Converts integers to Binary (or could
be just Binary) and then performs
OR operation

Bitwise XOR:
Converts integers to Binary (or could
be just Binary) and then performs
XOR operation
NOT Operation:
Performs NOT operation on the
Integer or Binary Value

Boolean Operators (Bitwise OR Example)

Boolean Operators (Bitwise XOR Example)

Boolean Operators (NOT Example)

Another Example

Relational Operators
Majority processes require comparisons or relational operators to
provide differences or equivalence
Different Relational Operators used are given below:

EQU (Equal to)


GEQ (Greater than equal to)
GRT (Greater than)
LES (Less than)
LIM (Limit)
NEQ (Not Equal to)

These relational operators are inputs thus they replace contacts

Rockwell Relational Operators


EQU (Equal to)

GEQ (Greater than equal to)

GRT (Greater than)

LES (Less than)

LIM (Limit)

NEQ (Not Equal to)

Examples

Example

Utilization of Sensors
In the past , the operators were the brains behind the control of the
process as they had all the information about the operation of the
process.
The operators were the source of information for quality control as they
could sense the problems (through Vision, Hearing etc)
Sensors are the source of Information for Industrial Automation
systems.
They provide information regarding the current state of the system
Sensors work more effectively and accurately then Humans

Classification of Sensors
Sensors can be classified based on different factors:
Contact versus Non Contact Sensors
Digital or Analog
Classification based on principles

Contact versus Non Contact Sensors:


Non Contact sensors are generally called Proximity Switches and it involves
no physical contact with the part to be detected
Optical Sensors, IR Sensors
Reed Switches (shown below):

Classification of Sensors
Non contact sensors mostly do not operate Mechanically and are more reliable
and less likely to fail then mechanical ones (there is no wear & tear)

Contact Sensors:
Contact sensors operate when the part physically touches the sensor.
Examples:
Limit Switches

Digital or Analog Sensors:


Digital Sensors:
Digital sensor have two states either ON or OFF and are used to measure
discrete variables.
Application generally involve presence or counting.
Quite effective and inexpensive.
Easy to integrate with Computers as they are digital devices and work with 1 or
0.

Classification of Sensors
Analog Sensors:
Measure Continuous variables
Analog sensors give a range of values between certain limits [0,100]
Most Industrial sensors follow the standard of 4-20mA (signal carries to
about 800m).
4mA stands for the lowest possible value for the sensor
20mA stands for the highest possible value
Example:
For a Linear Temperature Sensor (measuring values between 0 and 100
degrees) 4mA 0 Degrees and 20mA100 Degrees

Classification of Sensors
Classification based on Principle (Digital Only):
Optical Sensors:

Reflective Sensors
Polarizing Photo Sensors
Retro reflective Sensors
Thru Beam Sensors
Laser Sensors
Color Mark Sensor

Ultrasonic Sensors
Electronic Field Sensors
Inductive Sensors
Capacitive Sensors

Logical Actuators
Logical Actuators:
Logical Actuators are very frequently used in Industry
Most commonly used techniques for operation of actuators are:
Solenoids (electrically operated)

Logical Actuators can also be driven by Hydraulics or Pneumatics as well

Solenoids:
Solenoids are the most commonly used actuators
It consists of a Ferrous core moving in and out of a Coil

Continuous Actuators
Continuous Actuators allow a systems to adjust outputs in a range
of values
In general Continuous Actuators require Sophisticated control techniques
Continuous Actuators can be driven by different principles:
Electric Motors
Hydraulic
Pneumatic

The most commonly used actuators in the industry are Electric motors
Hydraulic actuators are used in cases when large amount of forces are
required and slow speeds

Wiring Diagrams
Sensors should convey information (using different methods) once there
is a change in environment:

Sensors (AC or DC) are in general of two types:


Load Powered Sensors or Loop powered sensors

Transistor
Transistor Logic

2 Wire Sensors

Line Powered Sensors


3 or 4 Wire Sensors

Depending on Sensors characteristics it can be used in two


configurations:
Sinking
Sourcing

Wiring Diagrams
Load or Loop Powered Sensors:
Generally called 2 wire sensors
These sensors are connected in series to the Supply and PLC input card
Operation:
These sensors require a small amount of current to operate called Leakage or
Operating Current
When the sensors turns ON it allows enough current to turn the PLC input ON

Wiring Diagrams
Line Powered Sensors:
These sensors are either 3 wire or 4 wire sensors
They draw current directly from the power supply
These sensors generally need a small amount of current called burden or
load current

Wiring Diagrams
Sinking & Sourcing Configurations:
2 wire or 3 wire sensor can be used in Sinking or Sourcing Configuration
depending on their characteristics
In Sinking configuration the current flows into the sensor
In Sourcing configuration the current flows out of the sensor
Examples of 2 wire sensors used in Sinking & Sourcing configuration is shown
below:

Wiring Diagrams
Sinking & Sourcing Configurations:
3 wire sensors used in Sinking configuration are generally NPN driven
Sourcing configuration are generally PNP driven
The general schematic is shown below:

Sinking Configuration

Sourcing Configuration

Wiring Diagrams
Sinking & Sourcing Configurations:
Sinking and Sourcing configurations with load attached is shown
below:

Wiring Diagrams
PLC Connections for Sinking & Sourcing Sensors:
The following images show the plc connections for Sinking and Sourcing
Sensors:

Wiring Diagrams
Wiring Specific to Different Input/Output Cards in PLCs:
Digital Input:

Wiring Diagrams for AC or TTL Modules are similar

Wiring Diagrams
Wiring Specific to Different Input/Output Cards in PLCs:
Digital Output:
Digital Output cards are used to switch different output voltages as
mentioned below:

120 VAC
24 VDC
12-48 VAC & DC
5 VDC

All digital cards have 8 to 16 Outputs and generally are connected to


external relays which operate the actual load
Most commonly DC Output cards are available in Relay, Transistors or Triac
Relay outputs are capable of switching AC & DC outputs but they are slower,
bulkier and cost more and fail after millions of cycles (Dry Outputs) separate
relay for each output
Transistors are limited to DC Output & Triac are limited to AC output (Switched
Outputs)

Wiring Diagrams

Transistors

Triac (Triode for


Alternating
Current)

Relay Output

Wiring Diagrams
Wiring Specific to Different Input/Output Cards in PLCs:
Digital Output:

Sourcing DC Output Card

Sinking DC Output Card

Wiring Diagrams
Wiring Specific to Different Input/Output Cards in PLCs:
Digital Output:
Output modules are generally fused in order to protect against Short Circuiting

Wiring Diagrams for AC or TTL Modules are similar

Wiring Diagrams
Analog Input:

Wiring Diagrams
Analog Input Module Wiring:

Wiring Diagrams
Analog Output:

Process & Instrumentation Diagrams


Basic Symbols for Valves:

Process & Instrumentation Diagrams

Process & Instrumentation Diagrams

Process Flow Diagram

Process & Instrumentation Diagrams

Process & Instrument Diagram

Das könnte Ihnen auch gefallen