0% found this document useful (0 votes)
17 views9 pages

SR1568 Communication Protocol

Uploaded by

carmanagerzone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views9 pages

SR1568 Communication Protocol

Uploaded by

carmanagerzone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Communication protocol

SR1568

Revision History

Rev Date Author Description

1.0 10-Nov-2016 Ji GenJun Initial version

1.1 17-Nov-2016 Ji GenJun Update some description

1.2 22-Nov-2016 Ji GenJun Add command to change baud rate

Add crc16 codes

-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

Alarm ADS123:ALARM 10\r\n001;002;...\r\n (maybe more than one error, will be


append as “Code;”)

List:

Code Error information

000 No Error

001 Sensor Error

002 Over Pressure

003 Low Pressure

004 VFS Error

005 No Flow

-3-
CmdList:

No Command Data sent Data received(Sample)

1 Get power on time ADS123:POWER\r\n ADS123:POWER 2\r\n

2 Get controller ADS123:GET_PRO ADS123:SR1568\r\n


name DUCT \r\n

3 Get controller ADS123:GET_VER ADS123:V1.00.0010\r\n


software version SION \r\n

4 Get controller SN ADS123:GET_SN ADS123:19009000\r\n


\r\n

5 Get status ADS123:GET_STAT ADS123:GET_STAT 61\r\n


\r\n
.....(all after 61\r\n will be data of status)

Check the status format below.

6 Restart controller ADS123:RESTART ADS123:RESTART OK\r\n


\r\n

7 Get Alarm ADS123:GET_ALA ADS123:ALARM 10\r\n001;002;…\r\n


RM \r\n (maybe more than one error, will be append
as “Code;”)

8 SET_TIME ADS123: SET_TIME xxx is the total seconds from 00:00:00,for


xxx\r\n example, current time is 10:01:30 then xxx
is 10*3600+1*60 + 30 = 36090

9 SET_RATE ADS123: xxx is rate value,it can be 9600 or 38400


SET_RATE xxx\r\n

-4-
Appendex:

Status list:

Name Type length Note Description


CRC16 of all data
Crc16 ushort 2 CRC16
below
System
Sys byte 1 System index(1~23)
index(1~23)
Temperature of Temperature of
T0 char[5] 5 T0(None, T0(“None,Break,xxx.
0-100, Break) x”)
T1 char[5] 5 T1
T2 char[5] 5 T2
T3 char[5] 5 T3
T4 char[5] 5 T4
T5 char[5] 5 T5
T6 char[5] 5 T6
R1 status
R1 byte 1 Status of pump R1
(0-100)
R2 status
R2 byte 1 Status of pump R2
(0-100)
R3 status
R3 byte 1 Status of pump R3
(0-100)
R4 status (0,
R4 byte 1 Status of value R4
1)
R5 status(0,
R5 byte 1 Status of value R5
1)
HK status(0,
HK byte 1 Status of value HK
1)
0=OK, 1=Emer,
0=OK, 1=Emer,
2=Cooling,
Solar1Status byte 1 2=Cooling, 3=Min,
3=Min,
4=AntiFreeze
4=AntiFreeze
0=OK, 1=Emer,
0=OK, 1=Emer,
2=Cooling,
Solar2Status byte 1 2=Cooling, 3=Min,
3=Min,
4=AntiFreeze
4=AntiFreeze
0=OK, 1=Emerg,
Load1Status byte 1 0=OK, 1=Emerg, 2=Max
2=Max

-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
字节

Example (old version, not updated):

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

ManualStatus 58~67 0000000000 00 00 00 00 00 00 00 00 00 00

CRC16

#define CRC_SEED 0xFFFF


#define POLY16 0x1021

U16 crc16Seed(unsigned char *buf, U32 length, U16 seed)


{
U16 shift,data,val;
int i;

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;
}

U16 crc16(unsigned char *buf,U32 length)


{
return crc16Seed(buf, length, CRC_SEED);
}

-9-

You might also like