Kv -300 – KEYENCE Visual KV Series User Manual

Page 387

Advertising
background image

9.5 Programming Examples

KV-10/80 Series Only

KV

-300

KV-10/80

Chapter 9 KV-AD4/DA4 Analog I/O Unit

1-363

1

9

Example 2: Outputting Analog Current (4 to 20 mA)

Data that has been written to DM0000 is converted to digital data for analog
output.

The digital data is sent to analog output I0 on the KV-DA4.
(Digital data is written to data memory DM0996.)

4 mA is output when input 0000 is ON.

20 mA is output when input 0000 is OFF.

1. #4000 is written to DM0000 when input 0000 is ON.
2. #20000 is written to DM0000 when input 0000 is OFF.
3. ((DM0000

÷

4

µA)

-

1000) is calculated, and the calculation result is written to

DM0001.

4. Before the digital data is written to data memory for D/A conversion, check that

the data is #4095 or less.

Note: An unsteady value will be output if a value outside the range 0 to 4095 is
written to data memory for D/A conversion.

5. The output data will be updated at the rising edge of special utility relay 2800. (As

internal relay 1000 switches ON/OFF at each scan, the output data will be
updated every two scans.)

Note: In the case of current output, DM0996 need not be initialized (#2000 written to
DM0996) when the power is turned ON.

0000 #04000

DW

0000

DM0000

#20000

DM0000

DW

2002 DM0000

LDA

#00004

DIV

DM0001

STA

#01000

SUB

1000

1000

1000

2800

2002

2011

DM0001

LDA

#04095

CMP

DM0001

LDA

DM0996

STA

1

2

3

4

5

( )

( )

KVHKA Chap 09.p65

08.3.11, 11:20 AM

363

Advertising