background image

5.2 Using gain and offset in a program

The gain and offset of the FX-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-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-4AD block is in the position of block No.0 (i.e. closest to the FX base unit).

Example: Adjusting gain/offset via software settings

X010

SET

M0

• Adjustment start.

M0

TO  

P

K0

K0

H0000

K1

TO  

P

K0

K1

K1

K21

• (H0000) 

 BFM #0 (initialize input channels)

Enter the instructions on the left and RUN the PC with
the MODE switch of the FX-4AD set to READY.

• (K1) 

 BFM #21

BFM #21 (gain/offset adjust prohibit) must be set to

permit with (b1, b0) = (0,1).

TO

K0

K0

K22

• (K0) 

 BFM #22 (offset/gain adjust)

Reset adjust bits.

K1

T0

K4

T0

TO  

P

K0

K23

K0

K1

TO  

P

K0

K2500

K1

K24

TO  

P

K0

H0003

K1

K22

T1

K4

• (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.

RST

M0

TO  

P

K0

K21

K2

K1

T1

• Adjustment end.

• (K2) 

 BFM #21

BFM #21 gain/offset adjust prohibit.

Summary of Contents for MELSEC-F FX-4AD

Page 1: ...on set Data transfer between the FX 4AD and the FX base unit is by buffer memory exchange There are 32 buffer memories each of 16 bits in the FX 4AD The FX 4AD occupies 8 points of I O on the FX FX2C expansion bus The 8 points can be allocated from either inputs or outputs The FX 4AD draws 30mA from the 5V rail of the FX base unit or powered extension unit This manual contains text diagrams and ex...

Page 2: ...erminals to each other 4 If there is excessive electrical noise connect the FG frame ground terminal with the grounded terminal on the FX 4AD 5 Connect the ground terminal on the FX 4AD unit with the grounded terminal on the base unit Use class 3 grounding on the base unit if available 73 2 87 63 2 48 95 3 74 140 5 51 125 4 92 Mounting holes 5 5mm 0 27in dia Extension cable and connector 10 0 39 M...

Page 3: ...can be selected with your choice of input terminal Up to four input points can be used at one time Analog input range DC 10V to 10V input resistance 200K Ω DC 20mA to 20mA input resistance 250 Ω Warning this unit may be damaged by input voltage in excess of 15V Warning this unit may be damaged by input currents in excess of 32mA Digital output 12 bit conversion stored in 16 bit 2 s complement form...

Page 4: ...n between analog and digital circuits DC DC converter isolation of power from FX base unit No isolation between analog channels Number of occupied I O points 8 points taken from the FX expansion bus can be either inputs or outputs Digital Output 10V 10 235V Voltage Input 2047 2000 10 24V 10V 2000 2048 NOTE Preset ranges are selected by an appropriate setting in buffer memory of the analog block Cu...

Page 5: ...ions BFMs marked with an data can be written from the PC using the TO command For buffer memories BFMs without the mark data can be read to the PC using the FROM command Before reading from the analog special function block ensure these settings have been sent to the analog special function block Otherwise the previous values held in the analog block will be used The buffer memory also gives a fac...

Page 6: ... and offset values of BFM 23 and 24 are sent to non volatile memory gain and offset registers of the specified input channels Input channels to be adjusted are specified by the appropriate G O gain offset bits of BFM 22 Example If bits G1 and O1 are set to 1 input channel 1 will be adjusted when BFM 22 is written to by a TO instruction Channels can be adjusted individually or together with the sam...

Page 7: ...tween instructions that cause a write to the EEPROM Therefore a delay timer should be used before writing to the EEPROM a second time NOTE b4 to b7 b9 and b13 to b15 are undefined Bit ON OFF b 0 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 b 1 Offset Gain error Offset Gain data in EEPROM is corrupted or adjustment error Offset Gai...

Page 8: ...he calibrated line identified at a digital value of 0 d Negative offset e Zero offset default 0V or 4mA Positive offset f Analog Digital Offset value f e d 0 1000 Digital a b c Gain value Analog Offset Gain 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...

Page 9: ...d 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...

Page 10: ...ition of block No 0 i e closest to the FX base unit Example Adjusting gain offset via software settings X010 SET M0 Adjustment start M0 TO P K0 K0 H0000 K1 TO P K0 K1 K1 K21 H0000 BFM 0 initialize input channels Enter the instructions on the left and RUN the PC with the MODE switch of the FX 4AD set to READY K1 BFM 21 BFM 21 gain offset adjust prohibit must be set to permit with b1 b0 0 1 TO K0 K0...

Page 11: ...sion unit varies according the number of extension block or special function blocks connected Put the FX base unit into RUN 6 2 Error checking If the FX 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 ...

Page 12: ... 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 prod...

Reviews: