Handling Counters As Numeric Devices - Mitsubishi Electric MELSEC FX3U Programming Manual

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
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
High
order
0
b15
*1
Sign
0: Positive
number
1: Negative
number
*1. The sign is valid only when a counter is handled as a substitute for data register.
2) 32-bit
High
order
0
1
b31
Sign
0: Positive
number
1: Negative
number
2. Examples in applied instructions
For the full use of counters as numeric devices, refer to the explanation of applied instructions later.
*1
*1. Make sure to use 32-bit operation instructions for 32-bit counters.
16 bits
1
0
1
0
1
0
1
0
1
0
1
0
0
1
0
1
0
1
0
1
0
1
0
FNC 12
C 20
D 10
MOV
FNC 10
K100
C 30
M 0
CMP
FNC 18
C 10 K2Y000
BCD
FNC 22
C 5
K 2 D4(D5)
MUL
FNC 12
C200 D0(D1)
DMOV
FNC 11
K100 K20000 C200
DZCP
Low
Available numeric value range
order
16-bit counter: 0 to 32767
1
0
1
32-bit counter: −2,147,483,648 to
b0
32 bits
1
1
1
1
0
0
0
0
1
1
0
1
C20 (current value) is transferred to D10.
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
M10 and M12.
4 Devices in Detail
4.6 Counter [C]
+2,147,483,647
Low
order
1
1
1
0
0
0
0
b0
1
2
3
4
5
6
7
8
9
10
107

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents