Mitsubishi QD51 Programming Manual page 537

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
Program Example
10 ' This program rotates the bits of the value A%
20 A%=&H55FF
30 B%=1
40 C%=-1
50 D%=ROT(A%,B%)
60 E%=ROT(A%,C%)
70 PRINT "Rotate A%=";A%;" to the left by one bit---> D%=";D%
80 PRINT "Rotate A%=";A%;" to the right by one bit---> E%=";
RUN
Rotate A%=22015 to the left by one bit--->D%=-21506
Rotate A%=22015 to the right by one bit--->E%=-21761
OK
11 - 367
REMARK
See the SHA and SHT functions.
:
'Specifies the number of bits to be rotated
:
'Rotates the bits
:
'Displays the result
E%
MELSEC-Q
11 - 367

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents