DY-RAIN Communication Driver

 

DY-RAIN communication driver is the driver to communicate with electronic rainfall controller of Dongyoung in Korea.

 

1. Read settings

 

<Figure 1> is read setting example of  DY-RAIN communication driver. 

<Figure 1>  Read setting example of  DY-RAIN communication driver

Device part of  <Figure 1> input Com Port(COM1), Baud Rate(fixed to 9600), Parity Bit(0), Data Bit(8), Stop Bit(1) respectively, according to setting of controller.

Also you can input 'rainfall analog input tag', weather to 'time reftesh'( 0 = not use, 1 = use, default : 0) and weather to 'truncate readed data'( 0 = not use, 1 = use, default : 0) by using option part.

Rainfall analog input tag use for data saving from 'P:' read command.

 

DY-RAIN communication driver¡¯s read schedule

Read schedule setting parameters are as follows:

1) Station – Don't care.

2) Read Type – Read type = N: ,  S:

3) Read Start Address Don't care.

4) Save start address for Communication Server – Saving start address of Communication Server.

5) Read Size – fixed to according read type. ( N: = 2,  S: = 11 WORD data )

 

Read schedule example) 

READ,    ,   N:,   0,    0,    2,

READ,    ,   S:,   0,    2,   11,

 

<Table 1> is data saving address and contents of DY-RAIN communication driver.

Read type
Read size
Contents Data Saving Address
N:
2
Read of rainfall of a hour and a day

Start Add + 0 = rainfall of a hour

Start Add + 1 = rainfall of a day

Start Add + 0 of DWORD = Total rainfall.

S
11
Read of RTU information

Start Add + 0 = year of current

Start Add + 1 = month of current

Start Add + 2 = day of current

Start Add + 3 = hour of current

Start Add + 4 = minute of current

Start Add + 5 = second of current

Start Add + 6 = year of ROM version

Start Add + 7 = month of ROM version

Start Add + 8 = day of ROM version

Start Add + 9 = status 0

Start Add + 10 = status 1

<Table 1> Data saving address and contents of DY-RAIN communication driver
2. Writing settings

You can write the setting value by using write settings.

 

Bit Write

Bit write setting parameters are as follows:

1)  PORT                   Port no. (0 ~ 255)

2)  STATION             Don't care.

3)  ADDRESS           Don't care

4)  Extra1                   Write command.

R: = Reset of RTU,

T: = Time synchronization with computer,

P: = Saved data read of RTU. After data read, the readed data store in 'rainfall analog input tag'.

Also, read data start time and end time have to set before 'P:' command.

 

EOT = Send EOT signal to RTU,

RST = Clear saved data of RTU.

5)  Extra2                   Don't care.

 

Write example 1) 

Port : 0,  Station : 0,  Address : 0000,  EXTRA1 : R:,  EXTRA2 : 

The setting parameter shown above is a reset example of RTU.

  

Word Write

Word write setting parameters are as follows:

1)  PORT                   Port no. (0 ~ 255)

2)  STATION             Don't care.

3)  ADDRESS           Don't care.

4)  Extra1                   Write command.

P: =  Read data time setting command.

5)  Extra2                   Read data time type when 'P:' command.

0 = start year of read data,

1 = start month of read data,

2 = start day of read data,

3 = start hour of read data,

10 = end year of read data,

11 = end month of read data,

12 = end day of read data,

13 = end hour of read data.

 

Write example 1) 

Port : 0,  Station : 0,  Address : 0000,  EXTRA1 : P:,  EXTRA2 : 0,    Write Data : 2013,

The setting parameter shown above is a start year( = 2013) of read data write example.