Download Print this page

Mitsubishi Electric FX2N-1HC User Manual page 4

Special function block (counter module) fx2n series
Hide thumbs Also See for FX2N-1HC:

Advertisement

2) BFM #3, #2 Ring length
Stores the data that specifies the length of the
16-bit counter (default: K65,536).
X 002
D
T0
K2
K2
K100
In the above example, K100 is written into BFMs #3 and
#2 of special block No.2 as a 32-bit binary value (BFM
#3 = 0, BFM #2 = 100). Permitted values: K2 to K65,536.
Note: Write counter data with (D) TO
Count data is always handled as a pair from two 16-bit values in this special function block. 16-bit 2's
complement value stored in the registers of the PLC cannot be used.
When you are writing a positive value between K32,768 and K65,535, the data should be treated as a
32-bit value even when a 16-bit ring counter is used.
When transferring counter data to/from this special function block, always use the 32-bit forms of the
FROM/TO instructions ((D) FROM, (D) TO).
3) BFM #4 Command
BFM#4
When '0'(OFF)
b0
Count prohibit
b1
YH output prohibit
b2
YS output prohibit
YH/YS independent
b3
action
b4
Preset prohibit
b5 to b7
Undefined
b8
No action
b9
No action
b10
No action
b11
No action
b12
No action
4) BFM #11, #10 Preset data
Data to used as the initial value when the counter starts to count.
Data becomes valid when b4 of BFM #4 is set to ON, and PRESET input terminal changes from OFF
to ON. The default value of the counter is zero. You can change it by writing a value into BFM #11 and
#10 or by using the command below.
The initial counter value can also be set by writing the data directly into BFM #21 and #20 (current
value of the counter).
5) BFM #13, #12 Comparison value for YH output, BFM #15, #14 Comparison value for YS output
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
result.
YH, YS output will not turn ON if you use 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.
The YS comparison operation takes about 300µs, and if a match
occurs, the output goes ON.
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.
6) 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.
7) Maximum count value (BFM #23, 22)
These store the maximum and minimum value reached by the counter. If the power is turned off, the
stored data is cleared.
8) Comparison status (BFM #26)
BFM#26
When '0' (OFF)
Set value ≤ current
b0
value
Set value ≠ current
YH
b1
value
Set value ≥ current
b2
value
BFM #26 is for reading only. Write commands from the programmable controller are ignored.
9) Terminal status (BFM #27)
BFM#26
When '0' (OFF)
b0
PRESET input is OFF. PRESET input is ON.
b1
DISABLE input is OFF. DISABLE input is ON.
K1
1. When b0 is set to ON and the DISABLE input
When '1'(ON)
terminal to OFF, the counter is permitted to
start counting input pulses.
Count permit
2. Unless b1 is set to ON, YH (hardware
YH output permit
compared output) does not turn ON.
3. Unless b2 is set to ON, YS (software
YS output permit
compared output) does not turn ON.
Mutual reset
4. When b3=ON, YS output is reset if YH output
action
is set, and YH output is reset if YS output is
set. When b3=OFF, YH and YS output act
Preset permit
independently, and do not reset each other.
5. When b4=OFF, preset function by the
PRESET input terminal is disabled.
Error flag reset
6. When b8 is set to ON, all error flags are reset.
YH output reset
7. When b9 is set to ON, YH output is reset.
YS output reset
8. When b10 is set to ON, YS output is reset.
YH output set
9. When b11 is set to ON, YH output is set ON.
10.When b12 is set to ON, YS output is set ON.
YS output set
-1HC outputs the comparison
2N
When '1' (ON)
BFM#26
Set value > current
b3
value
Set value = current
YS
b4
value
Set value < current
b5
value
When '1' (ON)
BFM#26 When '0' (OFF)
b2
b3
b4-b15 Undefined
UP
98 99
0
1
DOWN
1
0
99 98
When ring length K100 is specified, the
value of the counter changes as shown
above.
Current value
Current value
BFM #4
b9,b10
Coincidence output
Coincidence output
When '0' (OFF)
When '1' (ON)
Set value ≤ current
Set value > current
value
value
Set value ≠ current
Set value = current
value
value
Set value ≥ current
Set value < current
value
value
When '1' (ON)
YH output is OFF. YH output is ON.
YS output is OFF. YS output is ON.
BFM #4
b9,b10

Advertisement

loading