background image

 

3.

   CR#2 ~ CR#5: The settings of average times of the signals at CH1 ~ CH4. Range: K1 ~ K20 (default = K10). 

Please note that the average time settings at CR#2 ~ CR#5 only need to be written in once. 

4.

   CR#6 ~ CR#9: The average of the signals at CH1 ~ CH4 obtained from the settings in CR#2 ~ CR#5. For 

example, if the settings in CR#2 ~ CR#5 is 10, the content in CR#6 ~ CR#9 will be the average of the most 
recent 10 signals at CH1 ~ CH4. 

CR#10, CR#11, CR#16, CR#17, CR#22, CR#23, CR#28 and CR#29 are reserved. 

5.

   CR#12 ~ CR#15: The present value of input signals at CH1 ~ CH4. 

6.

   CR#18 ~ CR#21: The adjusted OFFSET value of CH1 ~ CH4, representing the analog input voltage or current 

when the analog signal is converted into digital value 0. 

The adjustable range of voltage: -5V ~ +5V (-4,000

LSB 

~ +4,000

LSB

The adjustable range of current: -20mA ~ +20mA (-4,000

LSB 

~ +4,000

LSB

7.

   CR#24 ~ CR#27: The adjusted GAIN value of CH1 ~ CH4, representing the analog input voltage or current when 

the analog signal is converted into digital value 4,000. 

The adjustable range of voltage: -4V ~ +20V (-3,200

LSB 

~ +16,000

LSB

The adjustable range of current: -16mA ~ +52mA (-3,200

LSB 

~ +10,400

LSB

Please note that: GAIN value – OFFSET value = +800

LSB

 ~ +12,000

LSB 

(voltage) or +800

LSB

 ~ +6,400

LSB

 (current) 

When GAIN – OFFSET is small (steep oblique), the resolution of input signal will be finer and variation on the 
digital value will be greater. When GAIN – OFFSET is big (gradual oblique), the resolution of input signal will be 
rougher and variation on the digital value will be smaller. 

8.

   CR #30: Error status value (See the table below) 

Error status 

Content 

b15 ~ b8 

b7 

b6 

b5 

b4 

b3 

b2 

b1 

b0 

Abnormal 

power 

supply K1(H’1) 

0 0 0 0 0 0 0 1 

Incorrect analog input 
value 

K2(H’2) 

0 0 0 0 0 0 1 0 

Incorrect 

mode 

setting  K4(H’4) 

0 0 0 0 0 1 0 0 

OFFSET/GAIN 

error  K8(H’8) 

0 0 0 0 1 0 0 0 

Hardware malfunction 

K16(H’10) 

0 0 0 1 0 0 0 0 

Abnormal digital range 

K32(H’20) 

0 0 1 0 0 0 0 0 

Incorrect average times 
setting 

K64(H’40) 

0 1 0 0 0 0 0 0 

Instruction error 

K128(H’80) 

reserved 

1 0 0 0 0 0 0 0 

Note: Each error status is determined by the corresponding bit (b0 ~ b7) and there may be more than 2 errors occurring at the same time. 

0 = normal; 1 = error   

9.

     CR#31: The setting of RS-485 communication address (Range: 01 ~ 255, default = K1). 

10.

   CR#32: The setting of RS-485 communication speed. b0: 4,800bps; b1: 9,600bps (default); b2: 19,200bps; b3: 

38,400bps; b4: 57,600bps; b5: 115,200bps; b6 ~ b13: reserved; b14: high/low bit exchange of CRC checksum 
(only valid in RTU mode); b15 = 0: ASCII mode; b15 = 1: RTU mode. ASCII data format: 7-bit, Even bit, 1 stop 
bit (7, E, 1); RTU data format: 8-bit, Even bit, 1 stop bit (8, E, 1). 

11.

   CR#33: For authorizations on some internal functions, e.g. OFFSET/GAIN tuning. The latched function will 

store the output setting in the internal memory before the power is cut off. 

12.

   CR#34: Firmware version of the model. 

13.

   CR#35 ~ CR#48: Parameters for system use. 

14.

   CR#0 ~ CR#34: The corresponding parameter addresses H’4032 ~ H’4022 are for users to read/write data by 

RS-485 communication. When using RS-485, the user has to separate the module with MPU first.   

a. Communication baud rate: 4,800/9,600/19,200/38,400/57,600/115,200bps 

b. Modbus ASCII/RTU communication protocols: ASCII data format (7-bit, Even bit, 1 stop bit (7, E, 1)); RTU 

data format (8-bit, Even bit, 1 stop bit (8, E, 1)). 

c. Function: H’03 (read register data); H’06 (write 1 word datum to register); H’10 (write many word data to 

register) 

d. Latched CR should be written by RS-485 communication to stay latched. CR will not be latched if written by 

MPU through TO/DTO instruction. 

 

Adjusting A/D Conversion Curve

 

4.1 Explanation 

Voltage Input Mode 

 

+8,000

+4,000

-4,000

10V

-8,000

-6V

-10V

6V

5V

2V

0

GAIN

OFFSET

D

ig

it

a

l o

u

tp

u

t

Voltage input

Mode 0

Mode1

 

CR#1 mode 0 

GAIN = 5V (4,000

LSB

OFFSET = 0V (0

LSB

CR#1 mode 1 

GAIN = 6V (4,800

LSB

OFFSET = 2V (1,600

LSB

GAIN 

The voltage input value when the digital 
output value = K4,000 
Range: -4V ~ +20V (-3,200

LSB

 ~ 

+16,000

LSB

OFFSET 

The voltage output value when the digital 
input value = K0 
Range: -5V ~ +5V (-4,000

LSB

 ~ +4,000

LSB

GAIN - OFFSET 

Range: +1V ~ +15V (+800

 LSB

 ~ +12,000

 

LSB

 

 
Current Input Mode 

 

+4,000

-4,000

-12mA

-20mA

4mA

0

OFFSET

20mA

GAIN

D

ig

it

a

l o

u

tp

u

t

Current input

Mode 3

Mode 2

 

CR#1 mode 2 

GAIN = 12mA (2,400

LSB

OFFSET = 4mA (800

LSB

CR#1 mode 3 

GAIN = 10mA (2,000

LSB

OFFSET = 0mA (0

LSB

GAIN 

The current input value when the digital 
output value = K2,000 
Range: -8mA ~ +40mA (-1,600

LSB

 ~ 

+8,000

LSB

OFFSET 

The current input value when the digital 
output value = K0 
Range: -10mA ~ +10mA (-2,000

LSB

 ~ 

+2,000

LSB

GAIN - OFFSET 

Range: +2mA ~ +30mA (+400

 LSB

 ~ +6,000

 

LSB

 

 

The user can adjust the OFFSET/GAIN curves according to the actual needs by changing the OFFSET value 
(CR#18 ~ CR#21) and GAIN value (CR#24 ~ CR#27). 
LSB refers to “least significant bit”: In voltage input, 1

LSB 

= 10V/8000 = 1.25mV; in current input, 1

LSB 

= 20mA/4,000 = 

5

μ

A.

 

 

4.2 Program 

Example 

Example 1: Set the OFFSET value of CH1as 0V (= K0

LSB

) and GAIN value as 2.5V (= K2,000

LSB

). 

X0

K2000

K24

H0

K1

K0

K1

H0

K1

M1002

K0

K33

K1

K0

K1

K18

K0

K0

TO

TO

TO

TO

 

 Write H’0 into CR#1 of analog input module 

No.0 and set CH1 in mode 0 (voltage input 
-10V ~ +10V). 

 Write H’0 into CR#33 and allow OFFSET/GAIN 

tuning in CH1 ~ CH4 

 When X0 goes from Off to On, write the 

OFFSET value K0

LSB

 into CR#18 and the GAIN 

value K2,000

LSB

 into CR#24. 

Example 2: Set the OFFSET value of CH2 as 2mA (= K400 

LSB

) and GAIN value as18mA (= K3,600

LSB

).

 

X0

K3600

K25

H18

K1

K0

K1

H0

K1

M1002

K0

K33

K1

K0

K1

K19

K400

K0

TO

TO

TO

TO

 

 Write H’18 into CR#1 of analog input module 

No.0 and set CH2 in mode 3 (current input 
-20mA ~ +20mA). 

 Write H’0 into CR#33 and allow OFFSET/GAIN 

tuning in CH1 ~ CH4 

 When X0 goes from Off to On, write the 

OFFSET value K400

LSB

 into CR#19 and the 

GAIN value K3,600

LSB

 into CR#25. 

 

Trial Operation & Troubleshooting

 

™

 

LED Display

 

1.  When the module is powered for the first time, POWER LED will be on and ERROR LED will be on for 0.5 

second. After this, A/D LED will start to flash. 

2.  When the power supply is normal, POWER LED will be on and ERROR LED should be off. When the 

power supply is less than 19.5V, ERROR LED will keep being on until the power supply is higher than 
19.5V.  

3.  When controlled by RS-485, the RS-485 LED on the module will flash after receiving the RS-485 

instruction. 

4.  When the input or output value exceeds the upper bound or falls below the lower bound after conversion, 

ERROR LED will flash. 

™

 

Program Example

 

K1

K0

K1

K1

K0

K0

K0

M1000

FROM

TO

END

K2

K6

D0

H618

K10

D20

K4

FROM

TO

K0

K2

=  H6400  D0

M1002

=  H6400  D0

 

 Read the model name from K0 and see if it is DVP04AD-H2: H’6400. 

 If D0 = H’6400, set the input modes: (CH1, CH3) mode 0, (CH2, CH4) mode 3. 

 Set the average times in CH1 and CH2 as K10. 

 Read the average of input signals at CH1 ~ CH4 from CR#6 ~ CR#9 and store the 4 data in D20 ~ D23. 

 
 
 
 

 

Relevant Instructions

 

 

API 

 

 

 

78 

 

F R O M  

 

 

 

 

Read CR data in special modules 

 

 Instruction
Explanation

 

 

: No. of special module (m1 = 0 ~ 7)     

: CR# in special module to be read 

: Device for storing read data                 

: Number of data to be read at a time 

Pr ogr am
Example

 

Read CR#24 of special module No.0 into D0 and CR#25 into D1. Only 2 groups of data are read 
at a time (n = 2). 

 

X0

FROM

K0

K24

D0

K2

 

 

API 

 

 

 

79 

 

T O  

 

 

 

 

Write CR data into special modules 

 

 Instruction
Explanation

 

: No. of special module (m1 = 0 ~ 7)     

: CR# in special module to be written 

: Data to be written into CR                     

: Number of data to be written at a time 

Pr ogr am
Example

 

Use 32-bit instruction DTO to write the content in D11 and D10 into CR#3 and CR#2 of special 
module No.0. Only 1 group of data is written in at a time (n = 1).   

 

X0

DTO

K0

K2

D10

K1

 

Remarks

 

Operand rules 

1. 

: The No. of special modules connected to PLC MPU. No. 0 is the module closest to te 

MPU. Maximum 8 modules are allowed to connected to a PLC MPU and they will not occupy 
any I/O points. 

2. 

: CR#. CR (control register) is the 49 16-bit memories built in the special module, 

numbered in decimal as #0 ~ #48. All operation status and settings of the special module are 
contained in the CR. 

3.  FROM/TO instruction is for reading/writing 1 CR at a time. DFROM/DTO instruction is for 

reading/writing 2 CRs at a time. 

 

CR #10

CR #9

L ower  1 6- bi t

Designated CR number

High er 16 -b it

 

 

4.  Number of groups “n” to be transmitted: n = 2 in 16-bit instructions and n = 1 in 32-bit 

instructions mean the same. 

 

D0
D1
D2
D3
D4
D5

CR #5
CR #6
CR #7
CR #8
CR #9
CR #10

D0
D1
D2
D3
D4
D5

CR #5
CR #6
CR #7
CR #8
CR #9
CR #10

Designated device

Designated CR

Designated device Designated CR

16-bit instruction  when n=6

32-bit instruction when n=3

 

 

M1083 for switching instruction modes in EH2 series models 

1.  When M1083 = Off, during the execution of FROM/TO instruction, all external or internal 

interruption subroutines will be forbidden. The interruptions are allowed only after FROM/TO 
instruction finishes its execution. FROM/TO instruction can also be used in an interruption 
subroutine. 

2.  When M1083 = On and an interruption signal occurs during the execution of FROM/TO 

instruction, the interruption will be processed first (with a 100us delay) and the execution of 
FROM/TO will be stopped. After the interruption subroutine finishes its execution, the 
program will jump to the next instructio of FROM/TO. FROM/TO cannot be used in an 
interruption subroutine. 

 

The content of this instruction sheet may be revised without prior notice. Please consult our distributors or 

download the most updated version at http://www.delta.com.tw/industrialautomation 

Reviews: