5
EXAMPLE PROGRAM
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.
K0
K30
D4
K1
M8002
Initial
pulse
K2010
D4
M0
K0
K0
H3300
K1
K0
K1
K4
K2
K0
K29
K4M10
K1
K0
K5
D0
K2
M1
M18
M10
The analog input channels (CH1, CH2) are setup by
writing H3300 to BFM #0 of the FX-4AD.
The ID code for the special function block at position
"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
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 number of averaged samples for CH1 and CH2
is set to 4 by writing 4 to BFM #1 and #2 respectively.
Do not execute the pulse.
If there are no errors in the operation of the FX-4AD,
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.
The operational status of the FX-4AD is read from
BFM #29 and output as bit devices at the FX base
unit.
READY
NO
error
CMP
TO
P
FROM
FROM
TO
FROM
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com