7. APPLICATION INSTRUCTIONS
7
−
44
MELSEC-A
Execution Conditions
Program Examples SUM
Program which obtains the number of bits, which are on (1), in the data of X30 to 3F
when X8 turns on.
DSUM
Program which stores the number of bits, which are on (1), in the data of X20 to 5B,
to D18 when XB turns on.
OFF
ON
Executed
per scan
Executed
per scan
Executed
only once
Executed
only once
Operation command
P
•
Coding
0 LD
X008
1 SUMP K4X030
4 END
X008
0
P
K4
SUM X030
Counted data
Total number of 1s is stored into A0.
Searching the data of X20 to 3F, the number of bits
which are "on" is stored into A0.
X00B
0
P
K8
DSUM X020
P
K7
DSUM X040
P
MOV A0
D18
P
+ A0
D18
Data of A0 is stored into D18.
Searching the data of X40 to 5B, the number of bits
which are "on" is stored into A0.
Data of A0 and that of D18 are added and stored into
D18.
•
Coding
0 LD
X00B
1 DSUMP K8X020
4 MOVP A0
D18
9 DSUMP K7X040
12
+P
A0
D18
17
END
Содержание MELSEC-A series
Страница 1: ......
Страница 2: ......
Страница 13: ...A 11 MEMO...
Страница 505: ...APPENDICES APP 100 MELSEC A MEMO...
Страница 507: ......
Страница 508: ......