Kv -300 – KEYENCE Visual KV Series User Manual
Page 384
9.5 Programming Examples
KV-10/80 Series Only
KV
-300
KV-10/80
Chapter 9 KV-AD4/DA4 Analog I/O Unit
1-360
9
Example 1: Inputting Analog Voltage (-10 to +10 V)
•
The analog input data from analog input V0 on the KV-AD4 is calculated.
(The digital data of data memory DM0992 is used for this operation)
•
The calculated data is written to DM0000. (If the calculated value is a negative
value, 2’s complement is written.) Data is written in mV units.
For example:
When the input is +10V, "10000" (data x 1000) will be written to DM0000.
When the input is -10V, "-10000 (#55536)" (data x 1000) will be written to
DM0000.
1. The data of DM0992 will be calculated, and the calculation result (data x 5 mV -
10000) will be written to DM0000.
Note: "2007" (first scan OFF at power ON) must be set as the input condition. In the
case of analog input, an unsteady value will be input for the first scan when the
power is turned ON.
Example 2: Inputting Analog Current (4 to 20 mA)
•
The analog input data from analog input I0 on the KV-AD4 is calculated.
(The digital data of data memory DM0992 is used for this operation.)
•
The calculated data is written to DM0000. Data is written in µA units.
For example:
When the input is 4 mA, "4000" (data x 1000) will be written to DM0000.
When the input is 20 mA, "20000" (data x 1000) will be written to DM0000.
2007
DM0992
LDA
#00005
MUL
DM0000
STA
#10000
SUB
1
1. The data of DM0992 will be calculated, and the calculation result (data x 4 µA +
4000) will be written to DM0000.
Note: "2007" (first scan OFF at power ON) must be set as the input condition. In the
case of analog input, an unsteady value will be input for the first scan when the
power is turned ON.
2007
DM0992
LDA
#00004
MUL
DM0000
STA
#04000
ADD
1
KVHKA Chap 09.p65
08.3.11, 11:20 AM
360