Está en la página 1de 28

Contents

Pag

Number Formats (16 Bits)


...................................................................................................................
Number Formats (32 Bits)
..................................................................................................................
Loading and Transferring Data (1)
............................................................................................
Loading and Transferring Data (2)
............................................................................................
Loading and Transferring Data (3)
............................................................................................
Timers: Time Formats for S5 Timers in STEP 7
.................................................................................
Timers: ON Delayy (SD)
( )
.......................................................................................................
Timers: Stored ON Delay (SS)
................................................................................
Timers: OFF Delay (SF)
.....................................................................................................
Timers: Pulse (SP)
.............................................................................................................................
Timers: Extended Pulse (SE)
.........................................................................................................
Timers: Bit Instructions
..................................................................................................................
Exercise .............................................................................................................................................. 14
S5 Counters in STEP 7
......................................................................................................................
Counters: Bit Instructions
................................................................................................................
C
Counters:
t
F
Function
ti Diagram
Di
............................................................................................................
Exercise: Program for a Bottling Plant (Filling Cycle and Bottle Count)
..............................
Conversion Operations BCD <-> Integer
......................................................................................
Conversion Operations I -> DI -> REAL
.....................................................................................
Comparision Operations
....................................................................................................................
Digital Logic Operations
....................................................................................................................
Basic Mathematical Functions ......................................................................................... 23
Exercise: Program for a Bottling Plant (Production Data)
..........................................................
Exercise: Program for a Bottling Plant (Number of Packaging Units)
.............................
Shift Operations (Word / Doubleword)
...........................................................................................
Shift Signed Integer to the Right
...........................................................................
Doubleword Rotation Operations ....................................................................................................... 28

Training Center
for Automation and Drives

Page 1

2
3
4
5
6
7
8
9
10
11
12
13
15
16
17
18
19
20
21
22
24
25
26
27

ST-7PRO1
Digital Operations

BCD Code

Each digit of a decimal number is encoded in four bit positions. Four bits are used
b
because
th
the hi
highest
h td
decimal
i l di
digit,
it 9
9, requires
i
att lleastt ffour bit positions
iti
iin bi
binary
code ( 1001).
The decimal digits from 0 to 9 are represented in BCD code in the same way as the
binary numbers from 0 to 9.

INTEGER

The data type INT is an integer (16 bits).


The sign (bit 15) indicates whether the number is positive or negative ("0" = positive,
"1" = negative).
A 16-bit
16 bit iinteger
t
can b
be b
between
t
-32
32 768 and
d +32 767
767.
In binary format, the negative form of an integer is represented as the twos
complement of the positive integer. (The twos complement is obtained by reversing
the bit pattern and then adding 1.)
In evaluating the bit pattern of a negative number, the zero positions are weighted,
then 1 is added to the result and a minus sign is placed in front.

Training Center
for Automation and Drives

Page 2

ST-7PRO1
Digital Operations

DINT

32-bit integers with sign are also referred to as "double integers or long integers.
They cover the range from L# -2147483648 to L#+2147483647.

REAL

A real number (also known as a floating-point number) is a positive or negative


number in the range from -1.17549510-38 to 3,4028231038 .
Examples: +10.339 or +1.0339E1
-234567 or -2.34567E5.
In exponential representation the exponent is specified as a power of 10.
A real number takes up two words in memory
memory. The most significant bit indicates the
sign. The other bits represent the mantissa and the exponent to the base 2.
Note: The representation of real numbers in STEP 7 is in accordance with the IEEE
standard.

Training Center
for Automation and Drives

Page 3

ST-7PRO1
Digital Operations

MOVE (LAD/FBD)

If the EN input is active, the value at input IN is copied to the address at output
OUT.
OUT
ENO has the same signal state as EN.

L and T (STL)

Load and Transfer instructions are executed regardless of the RLO. Data is
exchanged via the accumulator.
The Load instruction writes the value from the source address right-justified into
accumulator 1 and pads the remaining bits (32 bits in all) with "0"s.
The Transfer instruction copies some or all of the contents of the accumulator to the
specified
ifi d d
destination
ti ti ((see nextt page).
)

Training Center
for Automation and Drives

Page 4

ST-7PRO1
Digital Operations

ACCU1

ACCU 1 is the central register in the CPU. When a Load instruction is executed, the
value
l tto be
b lloaded
d d iis written
itt into
i t ACCU 1
1; ffor a T
Transfer
f iinstruction
t ti th
the value
l tto b
be
transferred is read from ACCU 1, and the results of the mathematical functions,
Shift and Rotate operations, etc. are also entered in ACCU 1.

ACCU2

When a Load instruction is executed, the old contents of ACCU 1 are first shifted to
ACCU 2 and ACCU 1 is cleared (reset to 0) before the new value is written into
ACCU 1.
ACCU 2 is also used for comparison operations, digital logic operations,
mathematical
th
ti l and
d Shift operations.
ti
These
Th
operations
ti
will
ill b
be di
discussed
d iin d
detail
t il llater
t
on.

Training Center
for Automation and Drives

Page 5

ST-7PRO1
Digital Operations

General

Accumulators are auxiliary memories in the CPU for data exchange between
various
i
addresses
dd
and
d ffor comparison
i
and
d mathematical
th
ti l operations.
ti
The S7-300 has 2 accumulators with 32 bits each and the S7-400 has 4
accumulators with 32 bits each.

Load

The Load instruction loads the contents of the specified byte, word or double word
into ACCU 1.

Transfer

When a Transfer instruction is executed, the contents of ACCU 1 are retained. The
same information can therefore be transferred to different destinations. If onlyy one
byte is transferred, the eight bits furthest to the right are used (see diagram).

RLO

In LAD and FBD you can use the Enable input (EN) of the MOVE box to make Load
and Transfer operations dependent on the RLO.
In STL Load and Transfer operations are always executed, regardless of the RLO,
but you can implement RLO-dependent load and transfer by using conditional jumps
to skip the Load / Transfer instructions.

Training Center
for Automation and Drives

Page 6

ST-7PRO1
Digital Operations

Time Specifications

1. Fixed time values specified as time constants (e.g.: S5T#100ms, S5T#35s,


S5T#5 2 200
S5T#5m2s200ms,
S5T#2h2
S5T#2h2m2s50ms).
2 50 )
2. Time values to be changed by the machine operator using pushwheel buttons.
3. Process or recipe-dependent time values in memory words or data words.

Timer Cell

A special area of memory is reserved for timers in your CPU. This area contains
a 16-bit word for each timer address.
Bits 0 to 9 of the timer word contain the time value in binary code.
When the timer is updated, the time value is decremented by one unit at the interval
d fi d b
defined
by th
the titime b
base.

Time Base

Bits 12 and 13 of the timer word contain the time base in binary code:
0 = 10 ms
1 = 100 ms
2 = 1s
3 = 10 s.
The time base defines the interval at which the time value is to be decremented
by one unit.
Wh th
When
the titime iis specified
ifi d as a constant
t t (S5T#...),
(S5T# ) th
the titime b
base iis assigned
i
d
automatically by the system. If the time is to be specified using pushwheel
buttons or via a data interface, the user must also specify the time base.

L / BI

The address at the BI output contains the time value in the form of a
10-digit binary number (without time base!).

LC / BCD

The address at the BCD output contains both the time value as a 3-digit BCD
number ((12 bits)) and the time format (bits
(
12 and 13).
)

Note

IEC-compliant timers can also be implemented in STEP7.


The use of system function blocks for implementing IEC timers is dealt with in
an advanced programming course.

Training Center
for Automation and Drives

Page 7

ST-7PRO1
Digital Operations

Start

The timer starts when the RLO at the "S" input changes from 0 to 1. The timer
runs starting with the time value specified at the TV input as long as the signal state
at input S =1.

Reset

When the RLO at Reset input "R" is "1", the current time value and the time base
are deleted and output Q is reset.

Digital Outputs

The current time value can be read as a binary number at the BI output and as a
BCD number at the BCD output.
The current time value is the initial value of TV minus the value for the time that has
elapsed since the timer was started.

Binary Output

The signal at the "Q" output changes to "1" when the timer has expired without error
and input "S" has signal state "1".
If the signal state at the "S" input changes from "1" to "0" before the timer has
expired, the timer stops running. In this case output Q has signal state "0".

Training Center
for Automation and Drives

Page 8

ST-7PRO1
Digital Operations

Start

The timer starts when the RLO at the "S" input changes from "0" to "1". The timer
runs starting
t ti with
ith the
th time
ti
value
l specified
ifi d att input
i
t TV and
d continues
ti
to
t run even if
the signal at input "S" changes to "0" during that time.
If the signal at the Start input changes from 0 to 1 again while the timer is still
running, the timer starts again from the beginning.

Reset

When the RLO at Reset input "R" is "1", the current time value and the time base
are deleted and output Q is reset.

Binary Output

The signal state at output Q changes to "1"


1 when the timer has expired without
error, regardless of whether the signal state at the "S" input is still "1".

Training Center
for Automation and Drives

Page 9

ST-7PRO1
Digital Operations

Start

The timer starts when the RLO at the "S" input changes from 1 to 0. When the
ti
timer
has
h expired,
i d the
th signal
i
l state
t t att output
t t Q changes
h
to
t "0".
"0"
If the signal state at the "S" input changes from 0 to 1 while the timer is running,
the timer stops and the next time the signal state changes from "1" to "0" it starts
again from the beginning.

Reset

When the RLO at Reset input "R" is "1", the current time value and the time base
are deleted and output Q is reset.
If both inputs (S and R) have signal state 1, output Q is not set until the dominant
Reset is deactivated
deactivated.

Binary Output

Output "Q" is activated when the RLO at the "S" input changes from 0 to 1. If
input S is deactivated, output Q continues to have signal state 1 until the
programmed time has expired.

Training Center
for Automation and Drives

Page 10

ST-7PRO1
Digital Operations

Start

The timer starts when the RLO at the S input changes from 0 to 1. Output Q is
also
l sett tto 1.
1

Reset

Output Q is reset when:


the timer has expired, or
the Start signal changes from 1 to 0, or
the Reset input R has signal state 1.

Training Center
for Automation and Drives

Page 11

ST-7PRO1
Digital Operations

Start

The timer starts when the RLO at the "S" input changes from 0 to 1. Output "Q"
i also
is
l sett tto 1
1.
The signal state at output Q remains at 1 even if the signal at the "S" input
changes to 0.
If the signal at the Start input changes from 0 to 1 again while the timer is
running, the timer is restarted.

Reset

Output Q is reset when:


the timer has expired, or
the Reset input
p "R" has signal
g
state "1".

Training Center
for Automation and Drives

Page 12

ST-7PRO1
Digital Operations

Bit Instructions

Training Center
for Automation and Drives

All timer functions can also be started with simple bit instructions. The similarities
and
d diff
differences b
between
t
thi
this method
th d and
d th
the titimer ffunctions
ti
di
discussed
d so ffar are
as follows:
Similarities:
- Start conditions at the "S" input
- Specification of the time value
- Reset conditions at the R input
- Signal response at output Q
Differences (for LAD and FBD):
- It is not possible to check the current time value (there are no BI and
BCD outputs).

Page 13

ST-7PRO1
Digital Operations

Exercise

Training Center
for Automation and Drives

Complete the function diagrams of the timers in the above slide!

Page 14

ST-7PRO1
Digital Operations

Counter Value

A 16-bit word is reserved for each counter in the system data memory. This is used
f storing
for
t i the
th counter
t value
l for
f the
th counter
t (0...999)
(0 999) in
i bi
binary code.
d

Count Up

When the RLO at the CU input changes from 0 to 1 the current counter reading
is incremented by 1 (upper limit = 999).

Count Down

When the RLO at the CD input changes from 0 to 1 the current counter reading
is decremented by 1 (lower limit = 0).

Set Counter

When the RLO at the "S"


S input changes from 0
0 to 1
1 the counter is set to the
value at the CV input.

Reset Counter

When RLO = 1 the counter is set to zero. If the Reset condition is fulfilled, the
counter cannot be set and counting is not possible.

PV

The preset value (0...999) is specified in BCD at the PV input:


as a constant (C#...)
in BCD format via a data interface.
interface

CV / CV_BCD

The counter value can be loaded as a binary number or BCD number into the
accumulator and transferred from there to other addresses.

The signal state of the counter can be checked at output Q:


Count = 0 -> Q = 0
Count >< 0 -> Q = 1

Types of Counter

Training Center
for Automation and Drives

S_CU
S_CD
S_CUD

= Up counter (counts up only)


= Down counter (counts down only)
= Up/Down counter.

Page 15

ST-7PRO1
Digital Operations

Bit Instructions

All counter functions can also operate with simple bit instructions. The similarities
and
d diff
differences between
b t
this
thi method
th d and
d th
the counter
t functions
f
ti
discussed
di
d so ffar are
as follows:
Similarities:
- Setting conditions at the "SC" input
- Specification of the counter value
- RLO change at the "CU" input
- RLO change at the "CD" input
Differences:
- It is not possible to check the current counter value
(there are no BI and BCD outputs).
- There is no binary output Q in the graphical representation.
.

Note

IEC-compliant counters can also be implemented in STEP 7.


The use of system function blocks for implementing IEC counters is dealt with in an
advanced p
programming
g
g course.

Training Center
for Automation and Drives

Page 16

ST-7PRO1
Digital Operations

Notes

If the counter reaches the value 999 during up counting, or the value 0 during down
counting,
ti
th
then th
the countt remains
i unchanged
h
d even iin th
the case off ffurther
th counting
ti
pulses.
If up counting and down counting is lined up at the same time, the count remains
the same.

Training Center
for Automation and Drives

Page 17

ST-7PRO1
Digital Operations

Goal

To add new functions to the bottling plant program. In addition to the already
programmed manual mode (FC15)
(FC15), a program for the automatic mode is to be
created.

Conveyor Control
in Automatic Mode

When the conveyor belt motor (Q 20.5 / Q 8.5) is switched on in automatic mode,
it remains on until it is switched off with the Stop switch (I 0.1) or until the sensor
(I 16.6 / I 8.6) detects a bottle. When the bottle has been filled, the conveyor must
automaticallly start moving again and keep moving until another bottle is detected or
the Stop switch is operated.

Bottle Filling

When a bottle is detected under the filling


f
funnel
f
(I
( 16.6
16 6 / I 8
8.6
6 =1),
1) ffilling begins.
Filling is simulated for 3 seconds and indicated at output Q 9.0 (Q 5.0).

Bottle Counting

Another two sensors are provided for registering the full and empty bottles. Bottle
sensor I 16.5 (I 8.5) registers the empty bottles and bottle sensor I 16.7 (I 8.7)
registers the full bottles.
Both the empty bottles and the full bottles are to be counted from the time when the
plant is switched on (C 1 for the empty bottles and C 2 for the full bottles) and the
number of full bottles is to be displayed on digital display QW 12 (QW 6).

What to Do

1. Write the program in block FC 16 and program a call to FC 16 in OB 1 (project


"My Project", "FILL program).
You must also modify the network in FC 15 containing the Jog Conveyor
Forwards program.
2. Test your solution on the training unit.

Result

It should work.

Training Center
for Automation and Drives

Page 18

ST-7PRO1
Digital Operations

Example

A user program is to perform mathematical functions using values entered with


pushwheel
h h lb
buttons
tt
and
d display
di l the
th resultlt on a digital
di it l di
display.
l
M
Mathematical
th
ti l
functions cannot be performed in BCD format, so the format must be changed.

Conversion
Instructions

The instruction set of the S7-300/400 supports a multitude of conversion


facilities. The instructions all have the same format:

EN, ENO

If RLO is =1 at Enable input EN, the conversion is performed. Enable output ENO
always has the same signal state as EN. If this is not the case, it is clearly indicated
in the corresponding
p
g instructions.

IN

When EN=1, the value at IN is read into the conversion instruction.

OUT

The result of the conversion is stored at the address at the OUT output.

BCD_I / BTI

(Convert BCD to integer) reads the contents of the IN parameter as a three-digit


BCD number (+/- 999) and converts it to an integer value (16 bits).

I_BCD / ITB

(Convert integer to BCD) reads the contents of the IN parameter as an integer value
(16 bits) and converts this value to a three-digit BCD number (+/- 999). If an
overflow occurs, ENO = 0.

BCD_DI / BTD

Converts a BCD number (+/- 9999999) to a double integer (32 bits).

DI_BCD / DTB

Converts a double integer to a seven-digit BCD number (+/- 9999999). If an


overflow occurs, ENO = 0.

Training Center
for Automation and Drives

Page 19

ST-7PRO1
Digital Operations

Example

A user program that works with integers also needs to perform division, which is
lik l tto result
likely
lt iin values
l
lless th
than 1
1. Si
Since th
these values
l
can only
l b
be represented
t d as
real numbers, conversion to real numbers is necessary. To do this, the integer must
first be converted to a double integer.

I_DI / ITD

Converts an integer to a double integer.

DI_R / DTR

Converts a double integer to a real number.

Note

Other conversion instructions, such as:


INV_I / INVI
NEG_I / NEGI
TRUNC / TRUNC
ROUND / RND
CEIL / RND+
FLOOR / RND INV_DI / INVD
NEG_DI / NEGD
NEG_R / NEGR
CAW,
CAW CAD
are discussed in an advanced programming course.

Training Center
for Automation and Drives

Page 20

ST-7PRO1
Digital Operations

CMP

Training Center
for Automation and Drives

You can use comparison instructions to compare the following pairs of numerical
values:
l
I
Compare integers (on the basis of 16 bit fixed-point number)
D
Compare integers (on the basis of 32 bit fixed-point number)
R
Compare floating-point numbers (on 32 bit real number basis =
IEEE floating-point numbers).
If the result of the comparison is True", then the RLO of the operation "1",
otherwise "0".
The values at inputs
p
IN1 and IN2 are compared
p
for conformity
y with the specified
p
condition:
==
IN1 is equal to IN2
<>
IN1 is not equal to IN2
>
IN1 is greater than IN2
<
IN1 is less than IN2
>=
IN1 is greater than or equal to IN2
<=
IN1 is less than or equal to IN2.

Page 21

ST-7PRO1
Digital Operations

WAND_W

The "AND Word" operation gates the two digital values at inputs IN1 and IN2 bit by
bit iin accordance
d
with
ith th
the AND ttruth
th ttable.
bl Th
The result
lt off th
the AND operation
ti IIs stored
t d
at the address at output OUT.
The instruction is executed when EN = 1.
Example: Masking out the 4th decade of the pushwheel buttons :
IW4=
= 0100 0100 1100 0100
W#16#0FFF
= 0000 1111 1111 1111
MW30
= 0000 0100 1100 0100

WOR W
WOR_W

The "OR Word"


Th
W d" operation
ti gates
t the
th two
t
digital
di it l values
l
att inputs
i
t IN1 and
d IN2 bit by
b
bit in accordance with the OR truth table. The result of the OR operation is stored at
the address at output OUT.
The instruction is executed when EN = 1.
Example: Setting bit 0 in MW32 :
MW32
= 0100 0010 0110 1010
W#16#0001
= 0000 0000 0000 0001
MW32
= 0100 0010 0110 1011

WXOR_W

The "Exclusive OR Word" operation gates the two digital values at inputs IN1 and
IN2 bit by bit in accordance with the XOR truth table. The result of the OR operation
is stored at the address at output OUT. The result of the XOR operation is stored at
the address at output OUT.
The instruction is executed when EN=1.
Example: detecting signal changes in IW0 :
IW0
= 0100 0100 1100 1010
MW28
= 0110 0010 1011 1001
MW24
= 0010 0110 0111 0011

Training Center
for Automation and Drives

Page 22

ST-7PRO1
Digital Operations

General

The instruction set of the S7-300/400 supports a multitude of mathematical


f
functions.
ti
All th
the iinstructions
t ti
h
have th
the same fformatt :

EN
ENO

The instruction is executed if RLO is =1 at Enable input EN.


If the result is outside the permissible range for the data type concerned, overflow
bits OV=Overflow and OS=Stored Overflow are set and Enable output ENO=0.
This prevents subsequent operations dependent on ENO from being executed.

IN1,IN2

The value at IN1 is read in as the first address and the value at IN2 as the second.

OUT

The result of the mathematical operation is stored at the address at output OUT.

Instructions

Addition:

Subtraction:

M lti li ti
Multiplication:

Division:

Note

Training Center
for Automation and Drives

ADD_I
ADD_DI
ADD_R
SUB_I
SUB_DI
SUB_R
MUL I
MUL_I
MUL_DI
MUL_R
DIV_I
DIV_DI
DIV_R

Add integer
Add double integer
Add real number
Subtract integer
Subtract double integer
Subtract real number
M lti l iinteger
Multiply
t
Multiply double integer
Multiply real number
Divide integer
Divide double integer
Divide real number

The advanced mathematical functions (ABS, SQR, SQRT, LN, EXP, SIN, COS,
TAN,, ASIN,, ACOS,, ATAN)) are discussed in an advanced programming
p g
g course.

Page 23

ST-7PRO1
Digital Operations

Goal

To extend the function of the bottle counting program.


The maximum number that can be counted with a counter is 999. To count larger
numbers, you would have to connect a number of counters in series.
You should therefore use mathematical operations here for counting. The
production data shown in the diagram are also required for management.

What to Do

1. Delete the networks for the bottle counting function in FC 16 (FILL


program).
2. Write an FC 18 for the counting function. When the plant is switched on, the
values in MW 100/102/104 are deleted.
When an edge is detected at I 16.5 (I 8.5) or I 16.7 (I 8.7), the bottle count is
incremented by adding 1.
The difference between the number of full bottles and the number of empty
bottles is stored in MW 104.
3. Program a call to FC18 in OB1.
4. Download all the blocks of the S7 program FILL to the CPU and test your
program.
program

Training Center
for Automation and Drives

Page 24

ST-7PRO1
Digital Operations

Goal

To make the following addition to the program for the production data of the
bottling
b
ttli plant
l t:
The full bottles are packed in units of 6. The number of packs required is to
be calculated and displayed at QW12 (QW6).
The program for this task is to be written in FC19.

What to Do

1. Write a program in FC 19 (S7-Program FILL) for dividing the number of full


bottles (MW102) by the integer 6.
2. Convert the result to BCD.
3. Transfer the BCD value to the digital display (QW12 / QW6).
4. In FC 18, delete the network for displaying the full bottles.
5. Program a call as well to FC 19 in OB 1.
6. Save the program, then download it and test it.

Result

The number on the digital display (number of packs required ) is increased by 1 for
each multiple of 6 (bottles).

Training Center
for Automation and Drives

Page 25

ST-7PRO1
Digital Operations

Shift

The instruction is executed if RLO = 1 at Enable input EN.

SHL_W / SLW

The SHL_W operation shifts bits 0 to 15 of ACCU 1 bit-by-bit to the left by the number of
places specified at input N.
The bits on the right are padded with zeros.

SHR_W / SRW

The SHR_W operation shifts bits 0 to 15 of ACCU 1 bit-by-bit to the right by the number
of places specified at input N.
The bits on the left are padded with zeros.

ACCU1-H

Bits 16 to 31 are not affected.

OUT

The result of the shift operation is stored at the address at output OUT.

The permissible range for N=0...15. If N>=16, OUT=0.

ENO

If the instruction is executed (EN = 1), ENO indicates the signal state of the last bit
shifted.
shifted
This means that other instructions dependent on ENO (cascading) are not executed if
the signal state of the last bit shifted is "0".

SHL_DW / SLD
SHR_DW / SRD

The procedure for the SHL_DW or SHR_DW operations is the same as that for the
SHL_W or SHR_DW operations, except that the entire contents of ACCU1 ( bits 0 to 31)
are shifted bit-by-bit to the left or right by the specified number of bits.

Training Center
for Automation and Drives

Page 26

ST-7PRO1
Digital Operations

SHR_I / SSI

The Shift Right Signed Integer operation shifts only ACCU1-L (bits 0 to 15) bit by bit
t the
to
th right.
i ht Th
The bit
bits th
thatt are vacated
t d are fill
filled
d with
ith th
the contents
t t off the
th sign
i bit (bit
15).
Bits 16 to 31 are not affected. Input N specifies the number of bit positions by which
the number is to be shifted. If N is greater than 16, N = 16 is assumed.

EN/ENO

If the instruction is executed (EN = 1), ENO indicates the signal state of the bit last
shifted (this bit corresponds to the CC1 and RLO bits in the status word). This
means that other instructions dependent on ENO (cascading) are not executed if
the signal
g
state of the last bit shifted is "0".

SHR_DI / SSD

The Shift Right Signed Double Integer operation shifts the entire contents of ACCU
1 (bits 0 to 31) to the right by the specified number of bits.
Permissible values for N: 0 to 32.

Note

The shift operations are discussed in more detail in an advanced programming


course.

Training Center
for Automation and Drives

Page 27

ST-7PRO1
Digital Operations

ROL_DW / RLD

The Rotate Left Doubleword operation rotates the entire contents of ACCU 1 to the
l ft The
left.
Th vacated
t d bits
bit are fill
filled
d with
ith th
the signal
i
l states
t t off th
the bit
bits th
thatt are pushed
h d out.
t
The last bit rotated is loaded in condition code bit 1 of the status word and also
stored at output ENO. This means that other instructions dependent on ENO
(cascading) are not executed if the signal state of the last bit rotated is "0".

ROR_DW / RRD

Rotate Right Doubleword.

Note

The rotation operations are discussed in more detail in an advanced programming


course.
course

Training Center
for Automation and Drives

Page 28

ST-7PRO1
Digital Operations

También podría gustarte