This manual confers no industrial property rights or any rights of any other kind,
nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be
held responsible for any problems involving industrial property rights which may
occur as a result of using the contents noted in this manual.
Warranty
Mitsubishi will not be held liable for damage caused by factors found not to be
the cause of Mitsubishi; opportunity loss or lost profits caused by faults in the
Mitsubishi products; damage, secondary damage, accident compensation
caused by special factors unpredictable by Mitsubishi; damages to products
other than Mitsubishi products; and to other duties.
For safe use
This product has been manufactured as a general-purpose part for general
industries, and has not been designed or manufactured to be incorporated in
a device or system used in purposes related to human life.
Before using the product for special purposes such as nuclear power, electric
power, aerospace, medicine or passenger movement vehicles, consult with
Mitsubishi Electric.
This product has been manufactured under strict quality control. However
when installing the product where major accidents or losses could occur if the
product fails, install appropriate backup or failsafe functions in the system.
•
•
•
HEAD OFFICE
HIMEJI WORKS
: TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310,
JAPAN
: 840, CHIYODA CHO, HIMEJI, JAPAN
5. Buffer Memories (BFM)
5.1 Buffer memory List
Note;
1) When writing in BFM #0 (counter mode), the BFM #1 to #31 will be initialized.
After setting the counter mode (BFM #0), other BFM(s) have to be setup.
When setting the counter mode, use a TOP (pulsed) instruction, or M8002
(initial pulse) to drive the TO instruction.
2) Read/Write of 16 bit data
When using a positive value between K32,768 and K65,535 with 16 bit
counters, read/writes of data, such as the current value, ring length, preset
data, and the YH/YS compare value, should use the 32-bit forms of the
FROM/TO instructions ((D) FROM, (D) TO).
5.2 Details of buffer memories
5.2.1
Counter mode
[BFM #0]
The counter mode is shown in the upper right table. (Default value: K0)
Note;
When writing in BFM #0 (counter mode), the BFM #1 to #31 will be initialized.
After setting the counter mode (BFM #0), other BFM(s) have to be setup.
When setting the counter mode, use a TOP (pulsed) instruction, or M8002 (initial
pulse) to drive the TO instruction.
BFM #
Description
Default
BFM
Access
BFM #0
Counter mode (Setting range: K0 to K11)
K0
R/W
BFM #1
DOWN/UP command
1-phase 1-input mode (S/W counter) only
K0
R/W
BFM #2
Ring length
Lower
K65536
R/W
BFM #3
Upper
R/W
BFM #4
Command
K0
R/W
B F M # 5
~ #9
Not available
-
-
BFM #10
Preset data
Lower
K0
R/W
BFM #11
Upper
R/W
BFM #12
YH compare value
Lower
K32767
R/W
BFM #13
Upper
R/W
BFM #14
YS compare value
Lower
K32767
R/W
BFM #15
Upper
R/W
BFM #16
~ #19
Not available
-
-
BFM #20
Counter current value
Lower
K0
R/W
BFM #21
Upper
R/W
BFM #22
Maximum count value
Lower
K0
R/W
BFM #23
Upper
R/W
BFM #24
Minimum count value
Lower
K0
R/W
BFM #25
Upper
R/W
BFM #26 Compare results
-
R
BFM #27 Terminal status
-
R
BFM #28 Not available
-
-
BFM #29 Error status
-
R
BFM #30 Model identification code: K4010
K4010
R
BFM #31 Not available
-
-
1) 16/32-bit counter modes
a) 32-bit counter modes
(K0, K2, K4, K6, K8, K10)
A 32-bit binary counter which executes UP/
DOWN counting will change from the lower
limit value to the upper limit value or the
upper limit value to the lower limit value
when overflow occurs. Both the upper and
lower limit values are fixed values: the upper
limit value is +2,147,483,647, and the lower
limit value is -2,147,483,648.
b) 16-bit counter modes
(K1, K3, K5, K7, K9, K11)
A 16-bit binary counter handles only positive
values from 0 to 65,535. Changes to zero
from the upper limit value or to the upper
limit value from zero when overflow occurs;
the upper limit value is determined by BFMs
#3 and #2.
2) 2-phase counter [1 edge-count] (K0, K1)
3) 2-phase counter [2 edge-count] (K2, K3)
4) 2-phase counter [4 edge-count] (K4, K5)
5) 1-phase 2-input counter (K6, K7)
If both phase A and phase B inputs are received simultaneously, the counter value
does not change.
6) 1-phase 1-input counter [Hardware UP/DOWN] (K8, K9)
Count modes
32 bits
16 bits
Reference
2-phase
input
(phase
difference
pulse)
1 edge count
K0
K1
1), 2)
2 edge count
K2
K3
1), 3)
4 edge count
K4
K5
1), 4)
1-phase 2-input (add/subtract pulse)
K6
K7
1), 5)
1-phase
1-input
Hardware UP/DOWN
K8
K9
1), 6)
Software UP/DOWN
K10
K11
1), 7)
+2,147,483,647
Upper limit value
Lower limit value
-2,147,483,648
0
Ring length
(BFM #3, #2) - 1
0
Phase A
Phase B
Phase B input ON
→
OFF while phase A input
ON Count down by 1.
Phase B input OFF
→
ON while phase A input
ON Count up by 1.
+1
+1
-1
-1
Phase A
Phase B
Phase B input OFF
→
ON while phase A input
ON Count up by 1.
+1
+1
Phase B input ON
→
OFF while phase A input
ON Count down by 1.
-1
-1
DOWN COUNT
Phase A
Phase B
UP COUNT
+1
+1
+1
+
1
-1
-1
-1
-1
Phase A
Phase B
Phase A input-1
at OFF
→
ON
Phase B input+1
at OFF
→
ON
ON
OFF
1 0
3
2
3
3
2
1
ON
OFF
Phase A
Phase B
Current
value
UP/DOWN is
determined by input
phase A (ON/OFF).
UP
DOWN
ON
OFF
ON
OFF
7) 1-phase 1-input counter [Software UP/DOWN] (K10, K11)
5.2.2
DOWN/UP command
[BFM #1]
When using the 1-phase 1-input counter [Software UP/DOWN] (counter mode: K10,
K11), set the count direction by the current value of BFM #1. (Default value: K0)
→
For the operation, refer to the Subsection 5.2.1 7)
5.2.3
Ring length [BFM #3, #2]
When setting the upper limit value of the 16 bit counters, the setting range is K2 to
K65536. (Default value: K65536)
In this example, K100 is written to BFM #3, #2 of special function block No.2 as 32 bit
data.
When ring length K100 is specified, the current
value of the counter is changed as the right
figure, and upper limit value is set to 99.
5.2.4
Command [BFM #4]
1) When b0 is set to ON and the DISABLE input terminal to OFF, the counter is
permitted to start counting input pulses.
2) Unless b1 is set to ON, YH (hardware compared output) does not turn ON.
3) Unless b2 is set to ON, YS (software compared output) does not turn ON.
4) When b3=ON, YS output is reset if YH output is set, and YH output is reset if YS
output is set. When b3=OFF, YH and YS output act independently, and do not
reset each other.
5) When b4=OFF, preset function by the PRESET input terminal is disabled.
→
For the preset details, refer to Subsection 5.2.5
6) When b8 is set to ON, all error flags are reset.
7) When b9 is set to ON, YH output is reset.
8) When b10 is set to ON, YS output is reset.
9) When b11 is set to ON, YH output is set ON.
10)When b12 is set to ON, YS output is set ON.
Count Direction
Setting Value
Up count
K0
Down count
K1
Bit No.
Setting Value
OFF (0)
ON (1)
b0
Count prohibit
Count permit
b1
YH output prohibit
YH output permit
b2
YS output prohibit
YS output permit
b3
YH/YS independent action
Mutual reset action
b4
Preset prohibit
Preset permit
b5 ~ b7
Not available
b8
No action
Error flag reset
b9
No action
YH output reset
b10
No action
YS output reset
b11
No action
YH output set
b12
No action
YH output set
b13 ~ b15
Not available
UP/DOWN is
determined by the
contents of BFM #1,
(K0/K1).
BFM #1
Phase B
Current
value
UP
DOWN
K1
K0
ON
OFF
FNC 79
DTO
K100
K2
K2
K1
X002
UP
DOWN
1
0
98
99
99
98
0
1
Example program
The ON/OFF status of M25 to M10 is written in BFM #4 of special function block
No.2 by the following program, and b15 to b0 action. Among these, b4 to b0 are
always ON as controlled by M10-M14.
Furthermore, b8 (M18), b9 (M19), and b10 (M20) are controlled by the input X004
of the PLC, and X005 by ON/OFF.
5.2.5
Preset data [BFM #11, #10]
When BFM #4 b4 is ON and the PRESET input is switched from OFF to ON,
preset data is stored into BFM #21, #20 (counter current value).
→
For command details, refer to Subsection 5.2.4
5.2.6
YH compare value [BFM #13,#12],
YH compare value [BFM #15,#14]
•
After comparing the current value of the
counter with the value written in BFM #13
and #12, BFM #15 and #14, the hardware
and software comparator in the FX
2NC
-
1HC outputs the comparison result.
•
YH, YS output will not turn ON if using
PRESET or the TO instruction to set the
counter value equal to the comparison
value. It will turn ON only when a match
occurs by the counting of input pulses.
However, when BFM #4 b1, b2 are OFF,
it does not set.
•
Output occurs when the current value
becomes equal to the compare value but
only if b1 and b2 of BFM #4 are ON.
Once an output is set, it remains ON until
it is reset by b9 or b10 of BFM #4. If b3 of
BFM #4 is ON, however, one of the
outputs is reset when the other is set.
•
The YS comparison operation takes
about 300
µ
s, and if a match occurs, the
output goes ON.
5.2.7
Counter current value [BFM #21, #20]
The current value of the counter can be read by the PLC. It will not be the correct
value during high-speed operations because of the communication delay. The
current value of the counter can be forcibly changed by writing a 32-bit value into
the appropriate BFMs from the PLC.
5.2.8
Maximum count value [BFM #23, #22],
Minimum count value [BFM #25, # 24]
These store the maximum and minimum value reached by the counter. If the
power is turned off, the stored data is cleared.
5.2.9
Compare results [BFM #26]
Bit No.
Target
output
OFF (0)
ON (1)
b0
YH
Set value
≤
current value
Set value
>
current value
b1
Set value
≠
current value
Set value
=
current value
b2
Set value
≥
current value
Set value
<
current value
b3
YS
Set value
≤
current value
Set value
>
current value
b4
Set value
≠
current value
Set value
=
current value
b5
Set value
≥
current value
Set value
<
current value
b6 ~ b15
Not available
~
FNC 79
DTO
K4M10
K2
K4
K1
M8000
X004
X005
M8000
M10
M14
Count allowed, YH/YS Output
allowed, Mutual reset,
Preset allowed
RUN
monitor
M18
Error flag reset
M19
M20
YH YS output reset
BFM #4
b9,b10
Setting value
Cur
rent
va
lue
Coincidence output
Setting value
Cur
rent
va
lue
BFM #4
b9,b10
Coincidence output
5.2.10 Terminal status [BFM #27]
5.2.11
Error status
[BFM #29]
Error status in the FX
2NC
-1HC can be checked by reading the contents of b0 to b9
of BFM #29 to auxiliary relays of the PLC.
There error flags can be reset by b8 of BFM #4.
5.2.12
Model identification code
[BFM #30]
This BFM stores the identification number for FX
2NC
-1HC.
The identification number for the FX
2N
-1HC unit is K4010.
By reading this identification number, the user may create built-in checking
routines to check whether the physical position of the FX
2NC
-1HC matches to that
of the software.
6. Example Program
Please use the following program as a guide whenever you use the FX
2NC
-1HC
unit. Other instructions to read the current value of the counter, status etc. can be
added as required.
Bit N0.
Signal Name
OFF (0)
ON (1)
b0
PRESET input
OFF
ON
b1
DISABLE input
OFF
ON
b2
YH output
OFF
ON
b 3
YS output
OFF
ON
b 4 ~ b15
Not available
Bit N0.
Error Status
b0
Set when any of b1 to b7 is ON.
b1
Set when the value of the ring length is written incorrectly.
(Except K2 to K65,536)
b2
Set when the preset value is written
incorrectly.
When value
≥
ring length in
16-bit counter mode.
b3
Set when the compare value is
written incorrectly.
b4
Set w hen the current value is
written in correctly.
b5
Set when the counter overflows the
upper limit.
When the upper or lower limit
i s e x c e e d e d o n a 3 2 -b i t
counter.
b6
Set when the counter overflows the
lower limit.
b7
Set when the FROM/TO command is used incorrectly.
b8
S e t w h e n t h e c o u n t e r m o d e
(BFM#0) is written incorrectly.
Except K0 to K11
b9
S et w h en t he BFM nu mb er is
written incorrectly.
Except K0 to K31
b10 ~ b15
Not available
FNC 78
FROM
K3M100
K2
K29
K1
M8000
M8002
Initial
pulse
FNC 79
TO
K11
K2
K0
K1
K11 is written into BFM #0 of special function block No.2. The
counter input is 16-bit 1-phase. Please use a pulse command for
this initialization.
FNC 79
DTO
K1234
K2
K2
K1
K1234
→
BFM #3, #2 (special function block No.2)
The ring length can be specified when a 16-bit counter is specified.
FNC 79
TO
K1
K2
K1
K1
UP/DOWN direction should be specified for 1-phase 1-input
software determined UP/DOWN counter.
FNC 79
DTO
K1000
K2
K12
K1
K1000
→
BFM #13, #12
Set the compare value for YH output.
7. Preliminary checks
1) Check that the I/O wiring and extension cable of the FX
2NC
-1HC are properly
connected.
2) The FX
2NC
-1HC occupies 8 points of I/O on the FX
2NC
, FX
3UC
expansion bus.
The 8 points can be allocated from either inputs or outputs.
5V DC 90mA power is supplied from the main or extension power supply units
(FX
3UC
only) for the FX
2NC
-1HC. Check that there is no power overload from this
and other extension blocks.
3) The following derating curve shows the simultaneous ON ratio of available power
for products connected to the FX
2N C
-1HC with respect to the ambient
temperature.
Use the adjoined following product within the simultaneous input ON ratio range
shown in the figure.
Target input extension block:FX
2NC
-16EX, FX
2NC
-16EX-DS,
FX
2NC
-32EX, FX
2NC
-32EX-DS
4) The counter works correctly only when data such as the counter mode (set with a
pulse command), the TO command, the compare value, etc. are appropriately
specified. Remember to initialize the count (BFM #4 b0), preset (BFM #4 b4), and
output (BFM #4 b2, b1) prohibits. Reset the YH/YS outputs before you start.
Note
Note that inputting the pulse higher than the maximum frequency may cause mis-
counting to FX
2NC
-1HC or a FROM/TO error to the PLC main unit.
~
M8000
M8000
M11
M13
FNC 79
DTO
K900
K2
K14
K1
K900
→
BFM #15, #14
Set the compare value for YS output (not necessary if only YH output is
used).
Count allowed
Output allowed,
Mutual reset
Preset allowed
Error flag reset
YH output reset
YS output reset
Note that counting only occurs if count prohibit is OFF. Also, outputs will not be set from
the counting process at all if the relevant output prohibit are set in the command register.
Please reset the error flags and YH/YS output before you start. The mutual reset and
preset initialization commands can be used as required.
X010
M10
X011
M14
X012
PLS
M18
X013
PLS
M19
PLS
M20
RUN
monitor
FNC 79
TO
K4M10
K2
K4
K1
FNC 78
DFROM
D2
K2
K20
K1
(M25 to M10)
→
BFM #4 (b15 to b0) command
BFM (#21, #20)
→
Reads the current value to the data registers D3 and D2.
Derating curve: FX
2NC
-16EX(-DS), FX
2NC
-32EX(-DS)
Simultaneous ON ratio
100%
45°C
60%
55°C Ambient temperature
Supply voltage:24V DC
8. Diagnostics
1) The following LEDs on the main panel of the FX
2NC
-1HC may help you to
troubleshoot the unit.
a)
φ
A,
φ
B:
Goes on/off as
φ
A,
φ
B input turn ON/OFF. It can be checked by rotating the
encoder slowly.
b) UP, DN:
Lights up to indicate whether the counter is going up (UP) or down (DN).
c) PR, DS:
The appropriate LED lights up when the PRESET (PR) terminal or the
DISABLE (DS) terminal is ON.
d) YH, YS:
The appropriate LED lights up when YH/YS output is turned on.
2) You can check the error status by reading the content of BFM #29 to the PLC.
→
For error contents, refer to the Subsection 5.2.11
STARTUP AND MAINTE-
NANCE PRECAUTIONS
•
Do not disassemble or modify the PLC.
Doing so may cause fire, equipment failures, or malfunctions.
* For repair, contact your local Mitsubishi Electric distributor.
•
Do not drop the product or exert strong impact to it.
Doing so may cause damage.
DISPOSAL
PRECAUTIONS
•
Please contact a certified electronic waste disposal company for the
environmentally safe recycling and disposal of your device.
TRANSPORT AND STOR-
AGE PRECAUTIONS
•
The product is a precision instrument. During transportation, avoid any impacts.
Failure to do so may cause failures in the product.
After transportation, verify the operations of the product.
9. System Block Diagram
BFM #4 b1
T0
16-bit counter
1-phase
1-input
counter
ØB
ØA
DISABLE
PRESET
Preset data
BFM#11, #10
Model code
BFM #30
Maximum value
BFM #23, #22
Minimum value
BFM #25, #24
Error status
BFM #29
Comparisor data
BFM #13, #12
Comparision data
BFM #15, #14
Compare results
BFM #26
Terminal status
BFM #27
S
R
S
R
YH
YS
ØZ
Direct initialization
Count start
BFM#4 b4
DOWN/UP
Counter
16/32-bit
1-phase/2-phase
Current value
register
BFM #21, #20
Reset
BFM #4 b8
for YH output
Matched
for YS output
Sampling cycle
300
µ
s
Comparison is made at the next
sampling point after an input
count.
*1
*1
Matched
BFM #4 b11
BFM #4 b9
BFM #4 b2
BFM #4 b12
BFM #4 b10
Count pulse
T0
T0
BFM #4 b0
T0
T0
BFM #4 b3
Counter mode
BFM #0
Ring upper limit value
BFM #3, #2
DOWN/UP command
BFM #1
Initiali-
zation