Example Program - Mitsubishi Melsec FX-4AD User Manual

Special function block
Table of Contents

Advertisement

5
5.1 Basic program
In the following example channels CH1 and CH2 are used as voltage inputs. The FX-4AD block is connected
at the position of special function block No.0. Averaging is set at 4 and data registers D0 and D1 of the PC
receive the averaged digital data.
M8002
FROM
K0
K30
Initial
pulse
CMP
K2010
M1
TO
P
K0
K0
TO
K1
K0
FROM
K0
K29
M10
M18
FROM
K5
K0
NO
READY
error
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

EXAMPLE PROGRAM

The ID code for the special function block at position
D4
K1
"0" is read from BFM #30 of that block and stored at
D4 in the base unit. This is compared to check the
block is an FX-4AD, if OK M1 is turned ON. These
D4
M0
two program steps are not strictly needed to perform
an analog read. They are however a useful check
and are recommended as good practise.
The analog input channels (CH1, CH2) are setup by
H3300
K1
writing H3300 to BFM #0 of the FX-4AD.
The number of averaged samples for CH1 and CH2
K4
K2
is set to 4 by writing 4 to BFM #1 and #2 respectively.
Do not execute the pulse.
The operational status of the FX-4AD is read from
K4M10
K1
BFM #29 and output as bit devices at the FX base
unit.
If there are no errors in the operation of the FX-4AD,
D0
K2
then the averaged data BFM's are read.
In the case of this example BFM #5 and #6 are read
into the FX base unit and stored at D0 and D1. These
devices contain the averaged data for CH1 and CH2
respectively.

Advertisement

Table of Contents
loading

Table of Contents