Download Print this page

Mitsubishi MELSEC-F FX2N Series User Manual page 5

Special function block

Advertisement

5
5.1 Basic Program
In the following example channels CH1 and CH2 are used as voltage inputs. The FX
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
TO
initial
pulse
M1
P
TO
P
TO
FROM K0
M10 M20
FROM K0
NO
Digital output
error
value is normal
5.2 Using gain and offset in a program
The gain and offset of the FX
also be adjusted using software settings sent from the PC.
Only the gain and offset values in the memory of the FX
analog input is not needed. A program for the PC will be needed however.
The following is an example of changing the offset value on input channel CH1 to 0V and the gain value to 2.5V.
The FX
-4AD block is in the position of block No.0 (i.e. closest to the FX
2N
Example: Adjusting gain/offset via software settings
X010
M0
P
TO
TO
P
TO
P
TO
P
TO
P
TO
TO
P
T1
TO
P
EXAMPLE PROGRAM
K0
K30
D4
K1
CMP
K2010
D4
M0
K0
K0
H3300 K1
K0
K1
K4
K2
K29 K4M10
K1
K5
D0
K2
-4AD can be adjusted using push-button switches on the input terminal of the PC. It can
2N
SET
M0
K0
K0
H0000 K1
K0
K21
K1
K1
K0
K22
K0
K1
TO
K0
K23
K0
K1
K0
K24
K2500 K1
K0
K22
H0003 K1
T1
RST
M0
K0
K21
K2
K1
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 main unit.
This is compared to check the block is a FX
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 practice.
The analog input channels (CH1, CH2) are setup by writing
H3300 to BFM #0 of the FX
The number of averaged samples for CH1 and CH2 is set to 4 by
writing 4 to BFM #1 and #2 respectively.
The operational status of the FX
and output as bit devices at the FX
If there are no errors in the operation of the FX
averaged data BFM's are read.
In the case of this example BFM #5 and #6 are read into the FX
main unit and stored at D0 and D1. These devices contain the
averaged data for CH1 and CH2 respectively.
-4AD need be adjusted. A voltmeter or an ammeter for the
2N
Adjustment start.
(H0000) → BFM #0 (initialize input channels)
Enter the instructions on the left and RUN the PC.
(K1) → BFM #21
BFM #21 (gain/offset adjust prohibit) must be set to permit with
(b1, b0) = (0,1).
(K0) → BFM #22 (offset/gain adjust)
Reset adjust bits.
K4
(K0) → BFM #23 (offset)
(K2500) → BFM #24 (gain)
(H0003) → BFM #22 (offset/gain adjust)
3 = 0011 i.e.
O1 = 1,
Therefore channel 1 is adjusted.
K4
Adjustment end.
(K2) → BFM #21
BFM #21 gain/offset adjust prohibit.
-4AD block is connected at the
2N
-4AD.
2N
-4AD is read from BFM #29
2N
main unit.
2N
main unit).
2N
G1 = 1.
-4AD, if OK M1 is
2N
-4AD, then the
2N
2N

Advertisement

loading

This manual is also suitable for:

Melsec-f fx2n-4ad