Mitsubishi Electric MELSEC-F FX2N-1HC User Manual page 8

Special function block
Hide thumbs Also See for MELSEC-F FX2N-1HC:
Table of Contents

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
K1
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
1. When b0 is set to ON and the DISABLE input
BFM#4
When '0'(OFF)
When '1'(ON)
terminal to OFF, the counter is permitted to
start counting input pulses.
b0
Count prohibit
Count permit
2. Unless b1 is set to ON, YH (hardware
b1
YH output prohibit
YH output permit
compared output) does not turn ON.
3. Unless b2 is set to ON, YS (software
b2
YS output prohibit
YS output permit
compared output) does not turn ON.
YH/YS independent
Mutual reset
b3
4. When b3=ON, YS output is reset if YH output
action
action
is set, and YH output is reset if YS output is
b4
Preset prohibit
Preset permit
set. When b3=OFF, YH and YS output act
independently, and do not reset each other.
b5 to b7
Undefined
5. When b4=OFF, preset function by the
PRESET input terminal is disabled.
b8
No action
Error flag reset
6. When b8 is set to ON, all error flags are reset.
b9
No action
YH output reset
7. When b9 is set to ON, YH output is reset.
b10
No action
YS output reset
8. When b10 is set to ON, YS output is reset.
b11
No action
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.
b12
No action
YS output set
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
-1HC outputs the comparison
2N
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)
When '1' (ON)
BFM#26
≤ current
b0 Set value
Set value > current
b3 Set value
value
value
≠ current
b1 Set value
Set value = current
b4 Set value
YH
YS
value
value
Set value ≥ current
Set value < current
b2
b5
value
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)
When '1' (ON)
BFM#26 When '0' (OFF)
b0
PRESET input is OFF. PRESET input is ON.
b2
b1
DISABLE input is OFF. DISABLE input is ON.
b3
b4-b15 Undefined
10) BFM #29 Error status
Error status in the FX
UP
auxiliary relays of the PLC.
98 99
0
1
BFM#29
DOWN
1
0
99 98
b0
Set when any of b1 to b7 is ON.
W h e n
r i n g
b1
Set when the value of the ring length is written incorrectly (other than K2 to K65,536).
length K100 is specified, the value of
b2
Set when the preset value is written incorrectly.
the counter changes as shown above.
b3
Set when the compare value is written incorrectly.
b4
Set when the current value is written in correctly.
b5
Set when the counter overflows the upper limit.
b6
Set when the counter overflows the lower limit.
b7
Set when the FROM/TO command is used incorrectly.
b8
Set when the counter mode (BFM#0) is written incorrectly.
b9
Set when the BFM number is written incorrectly.
b10-b15
Undefined
There error flags can be reset by b8 of BFM #4.
11) Model identification code number BFM #30
This BFM stores the identification number for FX
The identification number for the FX
By reading this identification number, the user may create built-in checking routines to check whether
the physical position of the FX
4. EXAMPLE PROGRAM
Please use the following program as a guide whenever you use the FX
read the current value of the counter, status etc. can be added as required.
M8002
T0
Initial
pulse
D
T0
X 014
T0
M8002
D
T0
D
T0
X 010
M10
M8000
M11
X 011
M14
Current value
Current value
X 012
PLS M18
BFM #4
BFM #4
X 013
b9,b10
b9,b10
PLS M19 and M20
Coincidence output
Coincidence output
M8000
T0
RUN
monitor
D
FROM K2
5. DIAGNOSTICS
5.1 Preliminary checks
1) Check that the I/O wiring and extension cable of the FX
2) 5V 90mA power is supplied from the main or extension units for the FX
power overload from this and other extension blocks.
3) 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
When '0' (OFF)
When '1' (ON)
outputs before you start.
≤ current
Set value > current
5.2 Error checking
value
value
≠ current
Set value = current
The following LEDs on the main panel of the FX
value
value
φA, φB
Set value ≥ current
Set value < current
value
value
UP , DN
PRESET and DIS:The appropriate LED lights up when the PRESET terminal or the DISABLE terminal
YH, YS
You can check the error status by reading the content of BFM #29 to the PLC.
When '1' (ON)
Error contents are shown in section 3.3 (10).
YH output is OFF. YH output is ON.
YS output is OFF. YS output is ON.
Note that inputting the pulse higher than the maximum frequency may cause mis-counting to
1HC or a FROM/TO error to the PLC main unit.
-1HC can be checked by reading the contents of b0 to b7 of BFM #29 to
2N
Error status
When value ≥ ring length in
16-bit counter mode.
When the upper or lower limit is
exceeded on a 32-bit counter.
When outside of K0 to K11
When outside of K0 to K31
-1HC.
2N
-1HC unit is K4010.
2N
-1HC matches to that of the software.
2N
-1HC unit. Other instructions to
2N
1. K11 is written into BFM #0 of special function block
K2
K0
K11
K1
No.2. The counter input is 16-bit 1-phase. Please use
a pulse command for this initialization.
2. K1234→BFM #3, #2 (special function block No.2)
K2
K2
K1234
K1
The ring length can be specified when a 16-bit
counter is specified.
3. UP/DOWN direction should be specified for 1-phase
K2
K1
K1
K1
1-input software determined UP/DOWN counter.
4. K1000→BFM #13, #12
K2
K12
K1000
K1
Set the compare value for YH output.
5. K900→BFM #15, #14
K2
K14
K900
K1
Set the compare value for YS output (not necessary if
only YH output is used).
Count allowed
Output allowed
6. Note that counting only occurs if count prohibit is
to
M13
Mutual reset
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
Preset allowed
and YH/YS output before you start. The mutual reset
and preset initialization commands can be used as
required.
Error flag reset
YH YS output reset
7. (M25 to M10) →BFM #4 (b15 to b0) command
K2
K4
K4M10
K1
8. BFM (#21, #20)→Reads the current value to the data
K20
D 2
K1
registers D3 and D2.
-1HC are properly connected.
2N
-1HC. Check that there is no
2N
-1HC may help you to troubleshoot the unit.
2N
:Goes on/off as φA, φB input turn ON/OFF. It can be checked by rotating the encoder
slowly.
:Lights up to indicate whether the counter is going up (UP) or down (DN).
is ON.
:The appropriate LED lights up when YH/YS output is turned on.
6. SYSTEM BLOCK DIAGRAM
Counter mode BFM #0
Error status
T0
16-bit
Ring upper limit value
BFM #29
counter
BFM #3,#2
DOWN/UP command
for YH output
BFM #1
T0
Comparisor data
BFM #13,#12
1-phase
1-input
counter
ØB
Count pulse
ØA
DOWN/UP
for YS output
DISABLE
T0
Comparision data
Counter
Count start
BFM#15,#14
16/32-bit
1-phase/
BFM #4 b0
Matched
2-phase
*1
ØZ
PRESET
Initiali-
zation
Current value
BFM#4 b4
register
Sampling cycle
BFM #21,#20
300ms
T0
Preset data
BFM#11,#10
T0
Compare results
Direct initialization
Maximum value
Terminal status
BFM #23,#22
Model code
Minimum value
BFM #30
BFM #25,#24
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.
Guidelines for the safety of the user and protection of the FX
function block
This manual has been written to be used by trained and competent personnel. This is defined
by the European directives for machinery, low voltage and EMC.
If in doubt at any stage during the installation of the FX
2N
electrical engineer who is qualified and trained to the local and national standards. If in doubt
about the operation or use of the FX
-1HC please consult the nearest Mitsubishi Electric
2N
distributor.
Under no circumstances will Mitsubishi Electric be liable or responsible for any consequential
damage that may arise as a result of the installation or use of this equipment.
All examples and diagrams shown in this manual are intended only as an aid to understanding
the text, not to guarantee operation. Mitsubishi Electric will accept no responsibility for actual
use of the product based on these illustrative examples.
Owing to the very great variety in possible application of this equipment, you must satisfy
yourself as to its suitability for your specific application.
Manual number : JY992D65401
Manual revision : F
Date
: April 2015
HEAD OFFICE : TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN
JY992D65401F
Reset
BFM #4 b8
BFM #4 b1
BFM #4
b11
S
YH
Matched
BFM #4 b9
R
BFM#4
b3
BFM#4 b2
BFM#4
b12
S
YS
R
BFM#4 b10
*1
Comparison is made at
BFM #26
the next sampling point
after an input count.
BFM #27
-1HC special
2N
-1HC always consult a professional
Effective April 2015
Specifications are subject to
change without notice

Advertisement

Table of Contents
loading

Table of Contents