Mitsubishi Electronics FX3G Video Gaming Accessories User Manual


 
100
FX3G/FX3U/FX3UC Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
4 Devices in Detail
4.6 Counter [C]
4.6.7 Handling counters as numeric devices
Counters use output contacts operating in accordance with the set value or use the counter value (current value) as
numeric data for control.
The figure below shows the structure of the current value register of a counter. When a counter number is specified in
an operand of an applied instruction in execution, the counter is handled as a device storing 16-bit or 32-bit data in the
same way as data register.
A 32-bit counter is handled as 32-bit data.
1. Structure of register storing current value of counter
1) 16-bit
2) 32-bit
2. Examples in applied instructions
For the full use of counters as numeric devices, refer to the explanation of applied instructions later.
1010101010101010
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
b15
Sign
0: Positive
number
1: Negative
number
*1
b0
High
order
Low
order
16 bits Available numeric value range
16-bit counter: 0 to 32767
32-bit counter:
2,147,483,648 to
+2,147,483,647
*1. The sign is valid only when a counter is handled as a substitute for data register.
0000111100001111
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
b31
Sign
0: Positive
number
1: Negative
number
b0
High
order
Low
order
32 bits
1010101010101010
32768
65536
131,072
262,144
524,288
1,048,576
2,097,152
4,194,304
8,388,608
16,777,216
33,554,432
67,108,864
134,217,728
268,435,456
536,870,912
1,073,741,824
FNC 12
MOV
C 20 D 10
FNC 10
CMP
K100 C 30 M 0
FNC 18
BCD
C 10 K2Y000
FNC 22
MUL
C 5 K 2 D4(D5)
FNC 12
DMOV
C200 D0(D1)
FNC 11
DZCP
K100 K20000 C200 M10
*1
C20 (current value) is transferred to D10.
*1. Make sure to use 32-bit operation instructions for 32-bit counters.
A decimal integer "100" is compared with C30
(current value), and the result is output to M0 to M2.
The contents of C10 (current value) are converted into
BCD, and output to Y000 to Y007.
(Seven-segment display unit is controlled.)
C5 (current value) is multiplied by 2, and transferred
to (D5, D4).
C 200 (current value) is transferred to (D1, D0).
C200 (current value) is compared with a decimal
integer zone 100 to 20000, and the result is output to
M10 and M12.