Function hint, Precautions, Sample program – Omron SYSMAC CP CP1E-N@@D@-@ User Manual
Page 152: 2 instructions
2 Instructions
2-116
CP1E CPU Unit Instructions Reference Manual(W483)
Function
Hint
• Up to 255 bits of data can be transferred per execution of XFRB(062).
• It is possible for the source words and destination words to overlap. By transferring data overlapping
several words, the data can be packed more efficiently in the data area. (This is particularly useful
when handling position data for position control.)
• Since the source words and destination words can overlap, XFRB(062) can be combined with
ANDW(034) to shift m bits by n spaces.
Precautions
• Be sure that the source words and destination words do not exceed the end of the data area.
• When the number of transfer bits (n of C) is 0, transfer does not take place.
• Bits in the destination words that are not overwritten by the source bits are left unchanged.
Sample program
When CIO 0.00 is ON in the following example, the 20 bits beginning with W0.06 are copied to the 20
bits beginning with W100.
XFRB(062) transfers up to 255 consecutive
bits from the source words (beginning with bit
l of S) to the destination words (beginning with
bit m of D).
The beginning bits and number of bits are
specified in C, as shown in the following dia-
gram.
S
l
n
D
m
C
n
8
15
m
l
0
3
4
7
XFRB
D100
W0
W100
0.00
C
S
D
C:D100
1 4
8
15
0
6
0
3
4
7
S:W0
W1
0
1
2
3
4
5
6
14
15
7
8
D:W100
W101
0
15
20 bits