(4) Status Information BFM #29
Bit devices of BFM #29
ON
OFF
b0 : Error
When any of b1 to b4 is ON.
If any of b2 to b4 is ON, A/D conversion of
all the channels is stopped
No error
b1 : Offset / gain error
Offset/Gain data in EEPROM is corrupted
or adjustment error.
Offset/Gain data normal
b2 : Power source abnormality
24V DC power supply failure
Power supply normal
b3 : Hardware error
A/D converter or other hardware failure
Hardware Normal
b10 : Digital range error
Digital output value is less than -2048 or
more than +2047
Digital output value is normal.
b11: Averaging error
Number of averaging samples is 4097 or
more or 0 or less (default of 8 will be used)
Averaging is normal.
(between 1 and 4096)
b12: Offset / gain adjust prohibit Prohibit-(b1, b0) of BFM #21 is set to (1, 0) Permit-(b1, b0) of BFM #21 is set to (0,1)
NOTE: b4 to b7, b9 and b13 to b15 are undefined.
(5) Identification Code BFM #30
The identification (or ID) code number for a Special Function Block is read using the FROM command.
This number for the FX
2N
-4AD unit is K2010.
The user’s program in the PC can use this facility in the program to identify the special function block before
commencing data transfer from and to the special function block.
CAUTION
•
Values of BFM #0, #23 and #24 are copied to EEPROM memory of the FX
2N
-4AD. BFM #21 and BFM #22
are only copied when data is written to the gain/offset command buffer BFM #22. Also, BFM #20 causes
writing to the EEPROM memory. The EEPROM has a life of about 10,000 cycles (changes), so do not
use programs which frequently change these BFMs.
•
Because of the time needed to write to the EEPROM memory, a delay of 300 ms is required between
instructions that cause a write to the EEPROM.
Therefore, a delay timer should be used before writing to the EEPROM a second time.
Offset and gain can be set independently or together. Reasonable offset ranges are -5 to +5V or -20mA to 20mA, and
gain values 1V to 15V or 4mA to 32mA. Gain and offset can be adjusted by software in the FX
2N
main unit (see
program example 2)
•
Bit device’s b1, b2 of the gain/offset BFM #21 should be set to 0, 1 to allow adjustment.
•
Once adjustment is complete these bit devices should be set to 1, 0 to prohibit any further changes.
•
Channel initialization (BFM #0) should be set to the nearest range, i. e. voltage/current etc.
5.1 Basic Program
In the following example channels CH1 and CH2 are used as voltage inputs. The FX
2N
-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.
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
2N
-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 practice.
The analog input channels (CH1, CH2) are setup by writing
H3300 to BFM #0 of the FX
2N
-4AD.
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
2N
-4AD is read from BFM #29
and output as bit devices at the FX
2N
main unit.
If there are no errors in the operation of the FX
2N
-4AD, then the
averaged data BFM’s are read.
In the case of this example BFM #5 and #6 are read into the FX
2N
main unit and stored at D0 and D1. These devices contain the
averaged data for CH1 and CH2 respectively.
5.2 Using gain and offset in a program
The gain and offset of the FX
2N
-4AD can be adjusted using push-button switches on the input terminal of the PC. It can
also be adjusted using software settings sent from the PC.
Only the gain and offset values in the memory of the FX
2N
-4AD need be adjusted. A voltmeter or an ammeter for the
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
2N
-4AD block is in the position of block No.0 (i.e. closest to the FX
2N
main unit).
Example: Adjusting gain/offset via software settings
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.
(K0)
→
BFM #23 (offset)
(K2500)
→
BFM #24 (gain)
(H0003)
→
BFM #22 (offset/gain adjust)
3 = 0011 i.e.
O1 = 1,
G1 = 1.
Therefore channel 1 is adjusted.
Adjustment end.
(K2)
→
BFM #21
BFM #21 gain/offset adjust prohibit.
6.1 _Preliminary checks
I.
Check whether the input wiring and/or extension cables are properly connected on FX
2N
-4AD analog special function
block
II.
Check that the FX
2N
system configuration rules have not been broken, i.e. the number of special function blocks
does not exceed 8 and the total system I/O is equal or less than 256 I/O.
III.
Ensure that the correct operating range has been selected for the application.
IV. Check that there is no power overload on either the 5V or 24V power sources, remember the loading on a FX
2N
main unit or a powered extension unit varies according to the number of extension blocks or special function
blocks connected.
V.
Put the FX
2N
main unit into RUN.
6.2 Error checking
If the FX
2N
-4AD special function block does not seem to operate normally, check the following items.
•
Check the status of the POWER LED.
Lit
:
The extension cable is properly connected.
Otherwise :
Check the connection of the extension cable.
•
Check the external wiring.
•
Check the status fo the “24V” LED (top right corner of the FX
2N
-4AD).
Lit
:
FX
2N
-4AD is OK, 24V DC power source is OK.
Otherwise :
Possible 24VDC power failure, if OK possible FX
2N
-4AD failure.
•
Check the status fo the “A/D” LED (top right corner of the FX
2N
-4AD).
Lit
:
A/D conversion is proceeding normally.
Otherwise :
Check buffer memory #29 (error status). If any bits (b2 and b3) are ON, then this is why
the A/D LED is OFF.
Guidelines for the safety of the user and protection of the FX
2N
-4AD special 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
-24AD always consult a professional
electrical engineer who is qualified and trained to the local and national standards. If in doubt
about the operation or use of the FX
2N
-4AD please consult the nearest Mitsubishi Electric
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.
HEAD OFFICE:MITSUBISHI DENKI BLDG MARUNOUCHI TOKYO 100 TELEX:J24532 CABLE MELCO TOKYO
HIMEJI WORKS:840, CHIYODA CHO, HIMEJI, JAPAN
Manual number
: JY992D65201
Manual revision
: A
Date
: JUNE 1997
JY992D65201A
Effective JUN. 1997
Specifications are subject to
change without notice
Gain determines the angle or slope of the calibration line,
identified at a digital value of 1000.
(a) Small gain
Large steps in digital readings
(b) Zero gain
default : 5V or 20mA
(c) Large gain
Small steps in digital readings
Offset is the ‘Position’ of the calibrated line, identified at a
digital value of 0.
(d) Negative offset
(e) Zero offset
default : 0V or 4mA
(f)
Positive offset
+1,000
Analog
Digital
Gain value
(a)
(b)
(c)
Gain
Analog
Digital
Offset value
(d)
(e)
(f)
Offset
0
M8002
initial
pulse
TO
K0
K30
D4
K1
CMP
K2010
D4
M0
TO
K0
K0
H3300 K1
P
M1
TO
K0
K1
K4
K2
P
FROM K0
K29 K4M10
K1
M10 M20
FROM K0
K5
D0
K2
NO
error
Digital output
value is normal
X010
SET
M0
TO
K0
K0
H0000 K1
P
TO
K0
K21
K1
K1
P
TO
K0
K22
K0
K1
M0
TO
TO
K0
K23
K0
K1
P
TO
K0
K24
K2500 K1
P
TO
K0
K22
H0003 K1
TO
T1
TO
K0
K21
K2
K1
P
T1
RST
M0
P
K4
K4
P
DEFINING GAIN AND OFFSET
4
EXAMPLE PROGRAM
5
DIAGNOSTICS
6
www.datasheet4u.com