Download Print this page

Mitsubishi Electric MELSEC FX-1HC User Manual page 10

Special function block
Hide thumbs Also See for MELSEC FX-1HC:

Advertisement

4
Please use the following program as a guide whenever you use the FX-1HC unit. Other instructions to
read the current value of the counter, status etc. can be added as required.
M8002
TO
Initial
pulse
(D) TO
X014
TO
M8002
(D) TO
(D) TO
X010
M10
M8000
M11
X011
M14
X012
PLS
X013
M19 and M20
PLS
M8000
TO
RUN
monitor
(D)FROM
5
5.1 Preliminary checks
(1) Check that the I/O wiring and extension cable of the FX-1HC are properly connected.
(2) 5V 70mA power is supplied from the base or extension units for the FX-1HC. Check that there is no
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 outputs
before you start.
5.2 Error checking
The following LEDs on the main panel of the FX-1HC may help you to troubleshoot the unit.
φA, φB
Goes on/off as φA, φB input turn ON/OFF. It can be checked by rotating the encoder slowly.
:
:
UP, DN Lights up to indicate whether the counter is going up (UP) or down (DN).
PRESET and DIS : The appropriate LED lights up when the PRESET terminal or the DISABLE terminal
:
YH, YS
The appropriate LED lights up when YH/YS output is turned on.
You can check the error status by reading the content of BFM #29 to the PC. Error contents are shown in
section 3.3 (10).
EXAMPLE PROGRAM
K2
K0
K11
K2
K2
K1234
K2
K1
K1
K2
K12
K1000
K2
K14
K900
Count allowed
Output allowed
M13
Mutual reset
Preset allowed
M18
Error flag reset
YH YS output reset
K2
K4
K4M10
K2
K20
D2
DAIGNOSTICS
is ON.
1.
K11 is written into BFM #0 of special function block
K1
No.2. The counter input is 16-bit 1-phase. Please
use a pulse command for this initialization.
K1234 → BFM #3, #2 (special function block No.2)
2.
K1
3.
UP/DOWN direction should be specified for 1-
K1
phase 1-input software determined UP/DOWN
counter.
K1
K1000 → BFM #13, #12
4.
K900 → BFM #15, #14
K1
5.
6.
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.
7.
(M25 to M10)
K1
8. BFM (#21, #20) → Reads the current value to the
K1
The ring length can be specified when a
16-bit counter is specified.
Set the compare value
for YH output.
Set the compare value
for YS output (not necessary if only YH
output is used).
→ BFM #4 (b15 to b0) command
data registers D3 and D2.

Advertisement

loading