Professional Documents
Culture Documents
Data Hand. Process Control
Data Hand. Process Control
And
Experimental Design for Engineers
(MIEng 6331)
DATA HANDLING IN PROGRAMMABLE LOGIC
CONTROLLERS
(PLCS)
Objective
What is Data Handling in Programmable Logic
Controllers (PLCs)
What are the common Data Handling instruction in PLCs
Explainthe difference between a move instruction and a
Masked move instruction.
Determine the data resulting after execution of a masked
move instruction.
Describe the function of the common comparison
instructions.
Data Handling
Data handling :- deals with more than bit, like moving or
transferring numbers from one memory location to another,
comparing data values or performs simple arithmetic operations.
Uses when data needs to be moved, copied, from one data file
source to another.
Data handling instruction requires two or more words of data
memory for operation.
The data handling instructions allow the movement, manipulation,
or storage of data in either single- or multiple-word groups from one
data memory area of the PLC to another.
Move instruction (MOV)
Comes in a block format with both a source and a destination
parameter.
Simply moves data from the source word and puts it into the
destination word. It does not convert or manipulate the data in any
way.
The data in a move block’s source parameter can be either a
variable value stored in a word, which changes during program
execution, or a fixed constant value, which is entered during
programming .
When instruction is true, a copy of the source data will be moved
to the specified destination address.
Move instruction Cont.…
For the rung shown when there is
For moving data an input to || in the rung, the move
from one location or occurs from the designated source
register to another, Mitsubishi address to the designated
Figure illustrates a destination address.
common practice of Typical ladder program data-
using one rung of a handling instruction contains
ladder program for Data-handling instruction
each move Allen-Bradley
The source (S) address from
operation, showing
the form used by
where the data is to be
three obtained
manufacturers : The destination (D) address to
Siemens where it is to be moved.
Move instruction Cont.…
Figure shows an example of the
MOV instruction.
When the rung is true, input
switch A closed, the value
stored at the source address,
N7:30, is copied into the
destination address, N7:20.
When the rung goes false,
input switch A opened, the
destination address will retain
the value unless it is changed
elsewhere in the program. Block-formatted move instruction
The source value remains
unchanged and no data
conversion occurs.
Move instruction Cont.…
Figure illustrates how the move (MOV) instruction can be used
to create variable preset timer values. A two-position selector
switch is operated to select one of two preset timer values.
When the selector switch is in the open 10 s position, rung 2
has logic continuity and rung 3 does not.
Asa result, the value 10 stored at the source address, N7:1, is
copied into the destination address, T4:1.PRE.
Therefore,the preset value of timer T4:1 will change from 0
to 10. When pushbutton PB1 is closed, there will be a 10 s
delay period before the pilot light is energized.
When the selector switch is in the closed 5 s position, rung 3
has logic continuity and rung 2 does not.
As a result, the value 5 stored at the source address,
N7:2, is copied into the destination address, T4:1. PRE.
Closingpushbutton PB1 will now result in a 5 s time-delay
period before the pilot light is energized.
Move instruction used to change the preset
time of a timer
Masked Move Instruction(MVM)
This is an output instruction that moves
a copy of one data file element through
a mask to a specified destination.
When a true instruction, a copy of the
data specified in the source is moved Operation of a mask word
through a hexadecimal mask to the • The pattern of characters in the mask determines which source
specified destination. bits will be passed through to the destination address.
• The bits in the mask that are set to zero (0) do not pass data.
A masked move instruction operates
• Only the bits in the mask that are set to one (1) will pass the
like a regular move instruction, except source data through to the destination.
that a masked move filter out data • Bits in the destination are not affected when the corresponding
which do not want to move. bits in the mask are zero.
Moves data from a source location to a • The MVM instruction is used to copy the desired part of a 16-
selected portion of the destination. bit word by masking the rest of the value.
Masked Move Instruction(MVM)
Figure shows an example of a mask move (MVM)
instruction.
This instruction transfers data through the mask from the
source address, B3:0, to the destination address, B3:4.
Themask may be entered as an address or in hexadecimal
format, and its value will be displayed in hexadecimal.
When there is a 1 in the mask, data will pass from
the source to the destination.
When there is a 0 in the mask, data in the destination will
remain in their last state.
Statusin bits 4–7 are unchanged due to zeroes in the
mask (remained in their last state).
Statusin bits 0–3 and 8–15 were copied from the
source to destination when the MVM instruction went
true.
Figure Masked move (MVM) instruction.
The mask must be the same word size as the source
and destination.
Comparison Instructions