Download Print this page

Mitsubishi MELSEC-F FX2NC Series User Manual page 3

Hide thumbs Also See for MELSEC-F FX2NC Series:

Advertisement

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).
BFM #
Description
Default
BFM #0
Counter mode (Setting range: K0 to K11)
K0
DOWN/UP command
BFM #1
K0
1-phase 1-input mode (S/W counter) only
BFM #2
Lower
Ring length
K65536
BFM #3
Upper
BFM #4
Command
K0
B F M # 5
Not available
-
~ #9
BFM #10
Lower
Preset data
K0
BFM #11
Upper
BFM #12
Lower
YH compare value
K32767
BFM #13
Upper
BFM #14
Lower
YS compare value
K32767
BFM #15
Upper
BFM #16
Not available
-
~ #19
BFM #20
Lower
Counter current value
K0
BFM #21
Upper
BFM #22
Lower
Maximum count value
K0
BFM #23
Upper
BFM #24
Lower
Minimum count value
K0
BFM #25
Upper
BFM #26 Compare results
-
BFM #27 Terminal status
-
BFM #28 Not available
-
BFM #29 Error status
-
BFM #30 Model identification code: K4010
K4010
BFM #31 Not available
-
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.
Count modes
32 bits
2-phase
1 edge count
K0
input
2 edge count
K2
(phase
difference
4 edge count
K4
pulse)
1-phase 2-input (add/subtract pulse)
K6
Hardware UP/DOWN
K8
1-phase
1-input
Software UP/DOWN
K10
1) 16/32-bit counter modes
a) 32-bit counter modes
BFM
(K0, K2, K4, K6, K8, K10)
Access
A 32-bit binary counter which executes UP/
DOWN counting will change from the lower
R/W
limit value to the upper limit value or the
upper limit value to the lower limit value
R/W
when overflow occurs. Both the upper and
lower limit values are fixed values: the upper
R/W
limit value is +2,147,483,647, and the lower
limit value is -2,147,483,648.
R/W
b) 16-bit counter modes
R/W
(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;
R/W
the upper limit value is determined by BFMs
R/W
#3 and #2.
2) 2-phase counter [1 edge-count] (K0, K1)
R/W
R/W
Phase A
+1
+1
-1
R/W
Phase B
R/W
Phase B input OFF →
Phase B input ON →
ON while phase A input
OFF while phase A input
-
ON Count up by 1.
ON Count down by 1.
R/W
3) 2-phase counter [2 edge-count] (K2, K3)
R/W
Phase A
R/W
+1
+1
-1
-1
Phase B
R/W
Phase B input OFF →
Phase B input ON →
R/W
ON while phase A input
OFF while phase A input
ON Count up by 1.
ON Count down by 1.
R/W
4) 2-phase counter [4 edge-count] (K4, K5)
R
UP COUNT
DOWN COUNT
R
Phase A
-
+
+1
+1
-1
-1
+1
1
R
Phase B
R
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.
ON
Phase A input-1
Phase A
at OFF → ON
OFF
ON
Phase B input+1
Phase B
at OFF → ON
OFF
1
2
3
3
3
2
1 0
6) 1-phase 1-input counter [Hardware UP/DOWN] (K8, K9)
OFF
ON
Phase A
ON
Phase B
UP/DOWN is
determined by input
OFF
phase A (ON/OFF).
UP
DOWN
Current
value
7) 1-phase 1-input counter [Software UP/DOWN] (K10, K11)
16 bits
Reference
BFM #1
K0
K1
1), 2)
ON
K3
1), 3)
Phase B
K5
1), 4)
OFF
UP
Current
K7
1), 5)
value
K9
1), 6)
5.2.2
DOWN/UP command [BFM #1]
K11
1), 7)
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)
+2,147,483,647
Count Direction
Setting Value
Upper limit value
Up count
K0
0
Down count
K1
5.2.3
Ring length [BFM #3, #2]
Lower limit value
-2,147,483,648
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.
0
X002
FNC 79
K2
Ring length
DTO
(BFM #3, #2) - 1
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.
-1
5.2.4
Command [BFM #4]
Bit No.
OFF (0)
b0
Count prohibit
b1
YH output prohibit
b2
YS output prohibit
b3
YH/YS independent action
b4
Preset prohibit
b5 ~ b7
b8
No action
b9
No action
b10
No action
-1
-1
b11
No action
b12
No action
b13 ~ b15
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.
Example program
The ON/OFF status of M25 to M10 is written in BFM #4 of special function block
K1
No.2 by the following program, and b15 to b0 action. Among these, b4 to b0 are
always ON as controlled by M10-M14.
UP/DOWN is
Furthermore, b8 (M18), b9 (M19), and b10 (M20) are controlled by the input X004
determined by the
of the PLC, and X005 by ON/OFF.
contents of BFM #1,
M8000
(K0/K1).
DOWN
RUN
monitor
X004
X005
M8000
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).
5.2.6
YH compare value [BFM #13,#12],
YH compare value [BFM #15,#14]
K2
K100
K1
• After comparing the current value of the
counter with the value written in BFM #13
and #12, BFM #15 and #14, the hardware
UP
and software comparator in the FX
98
99
0
1
1HC outputs the comparison result.
DOWN
• YH, YS output will not turn ON if using
PRESET or the TO instruction to set the
1
0
99
98
counter value equal to the comparison
value. It will turn ON only when a match
Setting Value
occurs by the counting of input pulses.
However, when BFM #4 b1, b2 are OFF,
ON (1)
it does not set.
• Output occurs when the current value
Count permit
becomes equal to the compare value but
YH output permit
only if b1 and b2 of BFM #4 are ON.
Once an output is set, it remains ON until
YS output permit
it is reset by b9 or b10 of BFM #4. If b3 of
BFM #4 i s O N, however, one of the
Mutual reset action
outputs is reset when the other is set.
Preset permit
• The YS comparison operation takes
about 300µs, and if a match occurs, the
Not available
output goes ON.
Error flag reset
5.2.7
Counter current value [BFM #21, #20]
YH output reset
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
YS output reset
current value of the counter can be forcibly changed by writing a 32-bit value into
the appropriate BFMs from the PLC.
YH output set
5.2.8
Maximum count value [BFM #23, #22],
YH output set
Minimum count value [BFM #25, # 24]
These store the maximum and minimum value reached by the counter. If the
Not available
power is turned off, the stored data is cleared.
5.2.9
Compare results [BFM #26]
Bit No.
b0
b1
b2
b3
b4
b5
b6 ~ b15
Count allowed, YH/YS Output
M10
~
M14
allowed, Mutual reset,
Preset allowed
M18
Error flag reset
M19
M20
YH YS output reset
FNC 79
K2
K4
K4M10
K1
DTO
→ For command details, refer to Subsection 5.2.4
-
2NC
Setting value
BFM #4
b9,b10
Coincidence output
Setting value
BFM #4
b9,b10
Coincidence output
Target
OFF (0)
ON (1)
output
Set value ≤ current value
Set value > current value
Set value ≠ current value
Set value = current value
YH
Set value ≥ current value
Set value < current value
Set value ≤ current value
Set value > current value
YS
Set value ≠ current value
Set value = current value
Set value ≥ current value
Set value < current value
Not available

Advertisement

loading

This manual is also suitable for:

Melsec-f fx2nc-1hc