N4DAC02 2-channel RS485 DAC  module

Features:

1: Operating Voltage : DC 12 (DC 12-25V), recommended power supply with small ripple

2: Operating Current : 12-13MA

3: MODBUS RTU Command support 03 06 function code

4: CH1(O1) output voltage is 0-5V, maximum output current is 20MA. 1-5V accuracy 1%, <1V there is a ripple of 50HZ/40MV.

CH2(O2) output voltage is 0-10V, maximum output current is 20MA. 2-10V accuracy 1%, <2V there is a ripple of 50HZ/80MV.

5: The voltage resolution is 0.01V, the output accuracy is 1%; if the error is greater than 1%, it can be calibrated

6 :MODBUS commands can be made serial HyperTerminal (serial assistant)  OR PLC Enter;

7 :Under the MODBUS command mode, it can support up to 247 devices in parallel

8 :Size: 45 * 35 * 15mm

9 :Weight: 10g

 

Slave ID: Different "Sliver ID" can be set by command, the maximum number is 247

Under the MODBUS command mode,the slave ID must be correct

Modbus RTU Command Please refer to : "N4DAC02 modbus rtu protocol "

 

Note:

This is a low-cost digital-to-analog conversion module based on the PWM+ADC solution. It has the following disadvantages:

1 channel 1 (O1) has 1% accuracy at 1-5V, <1V has 50HZ/40MV ripple, channel 2 (O2) has 1% accuracy at 2-10V, and <2V has 50HZ/80MV Ripple.

2 channel 1 (O1) minimum output voltage is 0.05V, channel 2 (O2) minimum output voltage is 0.1V    

3 There is a 10-20MS high pulse at the moment of power-on

 

Wiring diagram:

 

Command Description, Please refer to " N4AIA04 modbus rtu protocol "

 

 

 

N4DAC02_7.jpg

 

N4DAC02 modbus rtu protocol

Function code

RS485 address

(Station address)

(1)

Function (1)

Register address (2)

Read number (2)

CRC16 (2)

 

03  Read

 

 

 

 

06  Write

 

 

 

 

Read-only register,Read Function code Is 03

Register address

Register contents

Number of bytes

Units

Remarks

0x0000

(CH1)O1 Voltage value

2

0.01V

such as:

Input 0x00C8

Decimal 200

Output= 200 * 0.01 = 2.00V

0x0001

(CH2)O2 Voltage value

Read / write register; Read function code is 03 ,Write function code is 06

0x0007

(CH1)O1 Voltage ratio

2

0.1%

millesimal

This value can be corrected when the Actual output voltage is greater than 1%, such as:

1000 means 1:1

1010: 1% increase

990: 1% decrease

0x0008

(CH2)O2 Voltage ratio

0x000E

RS485 address

(Station address)

2

 

Read Address 0XFF

Write Address 1-247

0x000F

Baud rate

2

 

0~4     0:1200

1:2400  2:4800

3:9600default

4:19200

5: Factory reset

 

 

Serial baud rate9600default),N81

 

Modbus RTU Communication protocol

Read the output voltage value of channel 1/2, the unit is 0.01V

1.      Read Voltage value

Send data

RS485 address

(Station address)

(1)

Function (1)

Register address (2)

Read number (2)

CRC16(2)

 

Returns data

RS485 address

(Station address)

(1)

Function (1)

Number of bytes  (1)

data (n)

CRC16(2)

RS485 address(Slave ID) : 0x01~0xFE

   Function code 0x03

   Register address0x0000-0x0001, Indicates 1-2channel value

Read number0x0001-0x0002

 

For example:

Send data(RS485 address is 1)01 03 00 00 00 01 84 0A ;00 means channel 1

Returns data01 03 02 00 C8 B9 D2

01 RS485 address,03 Function,02 length,B9 D2 crc16

00C8 is the Output voltage value, it is converted to decimal = 200, 200/100=2.00V

 

For example:

Send data(RS485 address is 1)01 03 00 01 00 01 D5 CA ;01 means channel 2

Returns data01 03 02 01 F4 B8 53

01 RS485 address,03 Function,02 length, B8 53 crc16

01F4 is the Output voltage value, it is converted to decimal = 500, 500/100=5.00V

 

2.      Set Output Voltage value

Set the output voltage value of channel 1/2, the unit is 0.01VSend data

RS485 address

(Station address)

(1)

Function (1)

Register address (2)

Setting Content  (2)

CRC16(2)

 

Returns data

RS485 address

(Station address)

(1)

Function (1)

Register address

  (2)

Register value  (2)

CRC16(2)

 

RS485 address(Slave ID) : 0x01~0xFE

Function code 0x06

 

Register address0x0000-0x0001; Indicates 1-2 channel value

Setting value: 2 bytes, unit 0.01V. The voltage range set for channel 1 is 0.05-5V, and the voltage range set for channel 2 is 0.10-10V.

 

For example 1: Let CH1 output 3.3V voltage. Input value 330 and convert it to hexadecimal 014A

Send frame: 01 06 00 00 01 4A 09 AD

Return frame: 01 06 00 00 01 4A 09 AD

 

For example 2: Let CH2 output 4V voltage. Input value 400 and convert it to hexadecimal 0190

Send frame: 01 06 00 00 01 90 88 36

Return frame: 01 06 00 00 01 90 88 36

 

3.      Read Voltage ratio:

Send data

RS485 address

(Station address)

(1)

Function (1)

Register address (2)

Read number (2)

CRC16(2)

 

Returns data

RS485 address

(Station address)

(1)

Function (1)

Number of bytes  (1)

data (n)

CRC16(2)

RS485 address(Slave ID) : 0x01~0xFE

   Function code 0x03

Register address0x0007-0x0008 ; Indicates 1-2 channel value

Read number0x0001-0x0002

Return data: 0.1%  millesimal

The voltage ratio can be corrected by this value when the voltage reading deviation is greater than 1%. The default value is 1000 (3E8).

For example 1:

send data(RS485 address is 1)01 03 00 07 00 01 35 CB;  07 is Channel 1

Returns data01 03 02 03 E8 B8 FA 

03E8 is the voltage ratio, which is 1000 in decimal and divided by 1000=1; indicating that channel 1 does not need to modify the voltage value.

For example 2:

send data(RS485 address is 1)01 03 00 08 00 01 05 C8; 08 is Channel 2 

Returns data01 03 02 03 DE 38 EC

03DE is the voltage ratio, which is 990 in decimal and divided by 1000=0.99; Indicates that channel 2 reads 0.99 times the actual acquisition value.

 

4.      Set current ratio

When the actual output voltage deviation is greater than 1%, it can be corrected by this value, the default is 1000 (03E8)

Send data

RS485 address

(Station address)

(1)

Function (1)

Register address (2)

Setting Content  (2)

CRC16(2)

Returns data

RS485 address

(Station address)

(1)

Function (1)

Register address

  (2)

Register value  (2)

CRC16(2)

RS485 address(Slave ID) : 0x01~0xFE

   Function code 0x06

Register address0x0007-0x0008 ; Indicates 1-2 channel value

Setting Content2Bytes

 

Setting value: 2 bytes, unit 0.1%. When this value is set to 1000 (3E8), the voltage value does not change.

 

For example 1: Set the channel 1 to 5V, but the actual output voltage is 4.9V. Output deviation: 5/4.9=1.020. Input 1020 (0X03FC) to correct the output error

Send frame: 01 06 00 07 03 FC 38 BA

Return frame: 01 06 00 07 03 FC 38 BA

 

For example 2: Set the channel 2 to 4V, but the actual output voltage is 4.1V. Output deviation: 4/4.1=0.975. Input 975 (0X03CF) to correct the output error

Send frame: 01 06 00 08 03 CF 48 AC

Return frame: 01 06 00 08 03 CF 48 AC

 

 

5.      Read RS485 address

Send data

RS485 address

(Broadcast address)

(1)

Function (1)

Register address (2)

Read number (2)

CRC16(2)

 

Returns data

RS485 address

( Broadcast address )

(1)

Function (1)

Number of bytes  (1)

data (n)

CRC16(2)

 

Broadcast address 0xff

   Function code 0x03

Register address0x000E

Read number0x0001

 

For example:

send dataFF 03 00 0E 00 01 F0 17

Returns dataFF 03 02 00 01 50 50

FF Broadcast address03 Function02 length01 is the current module RS485 address , 50 50 crc16

Note: When using this command, only one temperature module can be connected to the RS485 bus, more than one will be wrong!

 

 

6.      Write RS485 address

Send data

RS485 address

(Station address)

(1)

Function (1)

Register address (2)

Setting Content  (2)

CRC16(2)

 

Returns data

RS485 address

(Station address)

(1)

Function (1)

Register address

  (2)

Register value  (2)

CRC16(2)

RS485 address(Slave ID) : 0x01~0xFE

   Function code 0x06

Register address0x000E

Setting Content2Bytes(1-247)

 

 

For example, The current RS485 address is 1, We need to change the RS485 address to 3:

send data(RS485 address is 1)01 06 00 0E 00 03 A8 08

Returns data01 06 00 0E 00 03 A8 08

 

7.      Read baud rate

Send data

RS485 address

(Station address)

(1)

Function (1)

Register address (2)

Read number (2)

CRC16(2)

 

Returns data

RS485 address

(Station address)

(1)

Function (1)

Number of bytes  (1)

data (n)

CRC16(2)

RS485 address(Slave ID) : 0x01~0xFE

   Function code 0x03

Register address0x000F

Read number0x0001

For example:

send data(RS485 address is 1)01 03 00 03 00 01 74 0A

Returns data01 03 02 00 03 F8 45

01 RS485 address03 Function02 lengthF8 45 crc16

   03 means the current baud rate is 9600bps

Baud rate corresponds to the number: 0: 1200  1: 2400  2: 4800  3: 9600  4: 19200

 

8.      Write baud rate

Send data

RS485 address

(Station address)

(1)

Function (1)

Register address (2)

Setting Content  (2)

CRC16(2)

 

Returns data

RS485 address

(Station address)

(1)

Function (1)

Register address

  (2)

Register value  (2)

CRC16(2)

RS485 address(Slave ID) : 0x01~0xFE

   Function code 0x06

Register address0x000F

Setting Content2Bytes(0-4)

 

For example, Change the baud rate to 4800bps:

send data(RS485 address is 1)01 06 00 0F 00 02 38 08

Returns data01 06 00 0F 00 02 38 08

Baud rate corresponds to the number: 0: 1200  1: 2400  2: 4800  3: 9600  4: 19200

5: Factory reset

Note: 1 The baud rate will be updated when the module is powered up again!

     2 The factory setting can be restored when the baud rate corresponding to the number is 5. For example: 01 06 00 0F 00 05 79 CA

 

 

MODBUS commands you can use "Modbus Poll" input, as shown below

CRC check generated automatically

 

You can also use HyperTerminal serial input, as shown below

Manually add CRC check