MELSEC System Q Beginners Manual 6 – 5
More Advanced Programming Applied Instructions Reference
Category Instruction Function
Data rotation
instructions
16-bit data
ROR
Rotation of bits to the right
RCR
Rotation of bits to the right with carry flag
ROL
Rotation of bits to the left
RCL
Rotation of bits to the left with carry flag
32-bit data
DROR
Rotation of bits to the right
DRCR
Rotation of bits to the right with carry flag
DROL
Rotation of bits to the left
DRCL
Rotation of bits to the left with carry flag
Data shift
instructions
16-bit data
SFR
Shifting a 16-bit data word n bits to the right (n: 0 to 15)
SFL
Shifting a 16-bit data word n bits to the left (n: 0 to 15)
Bit devices
BSFR
Shifting of a number of bit devices 1 bit to the right
BSFL
Shifting of a number of bit devices 1 bit to the left
Word devices
DSFR
Shifting of a number of word devices 1 bit to the right or
the left
DSFL
Bit processing
instructions
Setting/resetting
BSET
Setting of single bits
BRST
Resetting of single bits
BKRST
Batch reset of bits
Bit test
TEST
Test of single bits in 16-/32-Bit data words
DTEST
Data process
-
ing instructions
Search data
SER
Search 16-bit data
DSER
Search 32-bit data
Check data bits
SUM
Determine the number of bits set in a 16-/32-bit data word
DSUM
Decoding data
DECO
Decode from 8 to 256 bit (binary to decimal)
Encoding data
ENCO
Encode from 256 to 8 bit (decimal to binary)
7-segment decoding
SEG
Converts a 4-digit binary value into 7-segment code in
order to display the values 0 to F
Disunite/unite 16-bit
data words
DIS
Disunite 16-bit data words into groups of 4 bit
UNI
Store each 4 lowest bits of up to four 16-bit data values in
a 16-bit data value
NDIS
Disunite data in random bit units
NUNI
Unite data in random bit units
WTOB
Disunite data in byte units
BTOW
Unite data in byte units
Search maximum
values
MAX
Search maximum value in 16-bit data blocks
DMAX
Search maximum value in 32-bit data blocks
Search minimum
values
MIN
Search minimum value in 16-bit data blocks
DMIN
Search minimum value in 32-bit data blocks
Sort
SORT
Sort 16-bit data
DSORT
Sort 32-bit data
Calculation of totals
WSUM
Calculate totals of 16-bit binary data blocks
DWSUM
Calculate totals of 32-bit binary data blocks
Structured
program
instructions
Repetition instructions
FOR
Start of a program repetition
NEXT
End of a program repetition
BREAK
Terminate the FOR/NEXT loop