background image

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

Содержание MELSEC-F FX-4AD

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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...

Страница 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 ...

Страница 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...

Отзывы: