SR1568 Communication Protocol
SR1568 Communication Protocol
SR1568
Revision History
-1-
Revision History .......................................................................................................................... - 1 -
General ........................................................................................................................................ - 3 -
Alarm .......................................................................................................................................... - 3 -
CmdList: ..................................................................................................................................... - 4 -
Appendex: ................................................................................................................................ - 5 -
Status list: .......................................................................................................................... - 5 -
Example (old version, not updated): ................................................................................. - 7 -
GET_STAT: .................................................................................................................. - 7 -
CRC16.................................................................................................................................. - 8 -
-2-
General
This document describe protocols for server to communicate with SR1568 via RS485, the default
setting is low baud rate (“9600, n, 8, 1”). From version V1.00.0034, SR1568 can support high
baud rate “38400, n, 8, 1”, but when controller power up, it is in low baud rate.
The interface is RS485. So after server received data from SR1568, please delay about 15ms,
before you send next command
Alarm
Send Alarm, when controller get alarm from normal status, it will send this data to server.
Name Data sent
List:
000 No Error
005 No Flow
-3-
CmdList:
-4-
Appendex:
Status list:
-5-
0=OK, 1=Emerg,
Load2Status byte 1 0=OK, 1=Emerg, 2=Max
2=Max
WarningStatu 0=OK,
byte 1 0=OK, 1=Warning
s 1=Warning
DumpStatus byte 1 0=OFF, 1=ON 0=OFF, 1=ON
BypassStatus byte 1 0=OFF, 1=ON 0=OFF, 1=ON
TimerStatus byte 1 0=OFF, 1=ON 0=OFF, 1=ON
ParRelayStat
byte 1 0=OFF, 1=ON 0=OFF, 1=ON
us
HolidayStatu
byte 1 0=OFF, 1=ON 0=OFF, 1=ON
s
0=NoCard, 0=NoCard,
SDCardStatus byte 1
1=CardExist 1=CardExist
AHStatus byte 1 0=OFF, 1=ON 0=OFF, 1=ON
0=OFF, 0=OFF,
Disinfection 1=disinfectin 1=disinfecting,
byte 1
Status g, 2=Waiting, 2=Waiting,
3=Finished 3=Finished
BlockStatus byte 1 0=OFF, 1=ON 0=OFF, 1=ON
First 6 bytes
R1~R5,HK
ManualStatus char[10] 10 Status of R1~R5,HK
status;
(0=OFF, 1=ON)
Temperature of
VFS(None, Temperature(None,
TVFS char[5] 5
0.0-100.0, 0.0-100.0, Break)
Break)
Flow (None,
Flow(None, 0.0-24.0,
Flow char[5] 5 0.0-24.0,
Break)
Break)
Pressure
(None, Pressure(None,
Pressure char[5] 5
0.0-20.0, 0.0-20.0, Break)
Break)
Today’s Today’s heat
char[5] 5 Heat measurement
Measurement (kWh)
Total’s
Total Total heat
Measurement( char[5] 5
heat(kWh) heasurement(kWh)
kWh)
Total’s Total Total heat
char[5] 5
Measurement( heat(mWh) heasurement(mWh)
-6-
mWh)
PowerOn Time int 4 Power on days Total time of power on
Current Current Total seconds
controller int 4 controller’s Hour=total/3600,Minu
time(s) time tes=(total%3600)/60
Controller Controller
Char[8] 8 “ SR1568”
Type type
Block 数据结构
域 长度(bytes)
Block length 4
End Flat 2 是否文件的最后一个 Block(00=最后
一包,01=不是最后一包)
Block Index 4 发送过来的 Block 索引
CRC 2 后面数据的 crc16 值
Data Xxx 除了最后一包变长,其他固定为 512
字节
GET_STAT:
In binary shown:
Detail:
Name Lenght Example data Example data (Hex)
包头 ADS123:GET_STAT 68 \r\n 41 44 53 31 32 33 3A 47 45 54 5F 53 54 41 54 20 36 31 0D 0A
Crc 0-1 6F 23
Sys 2 14 14
-7-
T0 3~7 _ 58.7 20 35 38 2E 37
T1 8~12 888.8 38 38 38 2E 38
T2 13~17 888.8 38 38 38 2E 38
T3 18~22 _25.0 20 32 35 2E 30
T4 23~27 _65.6 20 36 35 2E 36
T5 28~32 888.8 38 38 38 2E 38
T6 33~37 888.8 38 38 38 2E 38
R1 38 0 00
R2 39 0 00
R3 40 0 00
R4 41 0 00
R5 42 0 00
HK 43 0 00
Solar1Status 44 0 00
Solar2Status 45 0 00
Load1Status 46 0 00
Load2Status 47 0 00
WarningStatus 48 1 01
DumpStatus 49 0 00
BypassStatus 50 0 00
TimerStatus 51 0 00
ParRelayStatus 52 0 00
HolidayStatus 53 1 01
SDCardStatus 54 1 01
AHStatus 55 0 00
DisinfectionStatus 56 2 02
BlockStatus 57 0 00
CRC16
shift = seed;
for(i=0;i<length;i++) {
if((i % 8) == 0)
data = (*buf++)<<8;
val = shift ^ data;
shift = shift<<1;
data = data <<1;
-8-
if(val&0x8000)
shift = shift ^ POLY16;
}
return shift;
}
-9-