FourFaith RTU Extended Communication Protocol

download FourFaith RTU Extended Communication Protocol

of 13

Transcript of FourFaith RTU Extended Communication Protocol

  • Xiamen Four-Faith Communication Technology Co., Ltd.

    Xiamen Four-Faith Communication Technology Co.,Ltd.Add J1-J3,3rdFloor,No.44,GuanRiRoad,SoftWare Park,XiaMen .361008.Chinahttp//en.four-faith.com Tel +86 13178273589 E-mail:[email protected]

    1

    FourFaith RTU Extended Communication Protocol................................................31 Format description.............................................................................................. 3

    1.1 TCP format................................................................................................31.1.1 Downlink data................................................................................31.1.2 Uplink data.................................................................................... 3

    1.2 UDP format...............................................................................................41.3 Data.......................................................................................................... 41.4 SMS format...............................................................................................4

    2 RTU extended protocol........................................................................................42.1 Register string and heartbeat string info................................................. 4

    2.1.1 RTU sends register string. The command is 0x5000..................... 42.1.2 DSC replies to the register string. The command is 0xD000.........42.1.3 RTU sends heartbeat string. The command is 0x5001..................52.1.4 DSC replies to heartbeat string. The command is 0xD001............5

    2.2 DIO and ADC control................................................................................ 52.2.5 RTU reports IO acquisition info actively and regularly. The

    command is 0x5010....................................................................................... 52.2.6 DSC replies to the IO acquisition info. The command is 0xD010..62.2.7 DSC controls IO port. The command is 0xD011............................ 62.2.8 RTU replies to the control from DSC. The command is 0x5011....72.2.9 DSC queries the ADC acquisition info. The command is 0xD012..72.2.10 RTU replies to queries from DSC. The command is 0x5012.

    Refer to command 0x5010.............................................................................82.2.11 DSC queries puls counter. The command is 0xD013...................82.2.12 RTU replies to counter query from DSC. The command is

    0x5013............................................................................................................82.2.13 RTU sends alarm info. The command is 0x5014......................... 82.2.14 DSC replies to alarm info. The command is 0xD014................... 9

    2.3 RTU parameters configuration.................................................................92.3.15 Remote configuration with AT commands in DSC. The command

    is 0xD020........................................................................................................ 92.3.16 RTU replies to AT commands from DSC. The command is

    0x5020............................................................................................................92.3.17 Restart RTU from DSC. The command is 0xD024........................92.3.18 RTU replies to reboot command. The command is 0x5024......10

    2.4 Remote upgrade command....................................................................102.4.19 Query firmware version of RTU from DSC. The command is

    0xD035..........................................................................................................102.4.20 RTU replies to firmware version query from DSC. The command

    is 0x5035.......................................................................................................102.4.21 Remote download from DSC. The command is 0xD030........... 11

  • Xiamen Four-Faith Communication Technology Co., Ltd.

    Xiamen Four-Faith Communication Technology Co.,Ltd.Add J1-J3,3rdFloor,No.44,GuanRiRoad,SoftWare Park,XiaMen .361008.Chinahttp//en.four-faith.com Tel +86 13178273589 E-mail:[email protected]

    2

    2.4.22 RTU replies to remote download configuration. The commandis 0x5030.......................................................................................................122.5 RTU transparent transmission function................................................. 12

    2.5.23 Send data from DSC to serial port of RTU transparently. Thecommand is 0xD0FE..................................................................................... 12

    2.5.24 Send data from serial port of RTU to DSC transparently. Thecommand is 0x50FF......................................................................................12

  • Xiamen Four-Faith Communication Technology Co., Ltd.

    Xiamen Four-Faith Communication Technology Co.,Ltd.Add J1-J3,3rdFloor,No.44,GuanRiRoad,SoftWare Park,XiaMen .361008.Chinahttp//en.four-faith.com Tel +86 13178273589 E-mail:[email protected]

    3

    FourFaith RTU Extended Communication Protocol

    1 Format description

    Downlink data: data sent from Data Service Center to RTUUplink data: data sent from RTU to Data Service center

    1.1TCP format

    1.1.1 Downlink data

    Start VersionHigh

    VersionLow

    DatalengthHigh

    DatalengthLow

    Data Datachecksum

    End

    1byte 1byte 1byte 1byte 1byte Accordingto the data

    1byte 1byte

    1. Start byte: 0x7E2. Version: Two bytes, 00023. Data length: According to the data content4. Data: The data content received5. Data checksum: Cumulative sum of the received data except for start byte,

    end byte and checksum itself6. End byte: 0x7E7. Except for start byte and end byte, 0x7E and 0x7D in other fields are

    escaped to 0x7D 0x01 and 0x7D 0x02.

    1.1.2 Uplink data

    Start VersionHigh

    VersionLow

    DatalengthHigh

    DatalengthLow

    Data Datachecksum

    End

    1byte 1byte 1byte 1byte 1byte Accordingto the data

    1byte 1byte

  • Xiamen Four-Faith Communication Technology Co., Ltd.

    Xiamen Four-Faith Communication Technology Co.,Ltd.Add J1-J3,3rdFloor,No.44,GuanRiRoad,SoftWare Park,XiaMen .361008.Chinahttp//en.four-faith.com Tel +86 13178273589 E-mail:[email protected]

    4

    1.2UDP format

    The same as TCP format

    1.3Data

    ID number Commandbyte

    Data length Data

    4bytes 2bytes 2bytes According tothe data

    ID number: Device ID numberData length: Length of data content

    1.4SMS format

    14 bit encoded format is used. It has the same format as 1.3Data.

    2 RTU extended protocol

    The is the extended protocol from FourFaith and its big-edian.

    2.1 Register string and heartbeat string info

    2.1.1 RTU sends register string. The command is 0x5000.

    The info in the register string is as below.

    field length(byte) NoteData content length 2 Total length of the

    parameters belowRTU phone number 20 Add blank space if less

    then 20 bytes

  • Xiamen Four-Faith Communication Technology Co., Ltd.

    Xiamen Four-Faith Communication Technology Co.,Ltd.Add J1-J3,3rdFloor,No.44,GuanRiRoad,SoftWare Park,XiaMen .361008.Chinahttp//en.four-faith.com Tel +86 13178273589 E-mail:[email protected]

    5

    2.1.2 DSC replies to the register string. The command is

    0xD000.

    field Length(byte) NoteData content length 2 Total length of the

    parameters belowReply manner 1 0 stands for register failure

    1 stands for registersuccess

    2.1.3 RTU sends heartbeat string. The command is 0x5001.

    The info in the heartbeat string is below.Field Length(byte) NoteData content length 2 No parameter. Length is 00

    2.1.4 DSC replies to heartbeat string. The command is

    0xD001.

    Field Length(byte) NoteData content length 2 Total length of the

    parameters belowReply manner 1 0 stands for receiving

    heartbeat failure1 stands for receivingheartbeat success

  • Xiamen Four-Faith Communication Technology Co., Ltd.

    Xiamen Four-Faith Communication Technology Co.,Ltd.Add J1-J3,3rdFloor,No.44,GuanRiRoad,SoftWare Park,XiaMen .361008.Chinahttp//en.four-faith.com Tel +86 13178273589 E-mail:[email protected]

    6

    2.2 DIO and ADC control.

    2.2.5 RTU reports IO acquisition info actively and regularly.

    The command is 0x5010.

    The IO acquisition info is below.Field Length

    (byte)Note

    Data content length 2 Total length of the parametersbelow

    Identifier for the same packet 1 To identify if the datacorresponds to ACK packet

    The valid number of DIO ports 1 The valid IO portsnumber(assuming its n1)

    Each DIO portinfo(loop n1times

    addr. 1 Address starts from 1The valid number ofeach DIO port

    1 The valid collection number ofeach DIO port(m1 is no morethan 10)

    Current IOchannelinfo (loopm1 times)

    Value 1 0 stands for low level and 1stands for high level

    Acquisitiontime

    4 Acquisition time. Time after Jan1st 2000(second)

    The valid number of ADC ports 1 The valid acquisition number ofADC port(assuming its n2).

    Each ADC portinfo(loop n2times)

    addr. 1 Address starts from 1The valid number ofeach ADC port

    1 The valid acquisition number ofeach ADC port(m2 is no morethan 10)

    CurrentADCchannelinfo(loop m2times)

    Value 4 The calculated value for ADCacquisition(with symbolicnumber)

    Acquisitiontime

    4 Acquisition time. Time after Jan1st 2000(second)

  • Xiamen Four-Faith Communication Technology Co., Ltd.

    Xiamen Four-Faith Communication Technology Co.,Ltd.Add J1-J3,3rdFloor,No.44,GuanRiRoad,SoftWare Park,XiaMen .361008.Chinahttp//en.four-faith.com Tel +86 13178273589 E-mail:[email protected]

    7

    2.2.6 DSC replies to the IO acquisition info. The command is

    0xD010.

    Field Length(byte) NoteData content length 2 Total length of the

    parameters belowReply manner 1 0 stands for IO acquisition

    failure1 stands for IO acquisitionsuccess

    Identifier for the samepacket

    1 To identify if the datacorresponds to ACK packet

    2.2.7 DSC controls IO port. The command is 0xD011.

    Field Length(byte) NoteData content length 2 The total length of the

    parameters belowNumber of DIO 1 The number of DIO to

    control(assuming its n).DIO portsinfo(loop ntimes)

    DIO port addr. 1 DIO port addr. start from 1DIO port type 1 0 stands for low level output, 1

    stands for high level output, 2stands for rising edge, 4 standsfor falling edge, 5 stands forsquare wave.

    square wavefrequency(if itsnot squarewave, the valueis 0)

    4 The unit is 20mS. The minaccuracy is 20mS due to theinfluence of timer.

    2.2.8 RTU replies to the control from DSC. The command is

    0x5011.

    field Length(byte) NoteData content length 2 The total length of the

  • Xiamen Four-Faith Communication Technology Co., Ltd.

    Xiamen Four-Faith Communication Technology Co.,Ltd.Add J1-J3,3rdFloor,No.44,GuanRiRoad,SoftWare Park,XiaMen .361008.Chinahttp//en.four-faith.com Tel +86 13178273589 E-mail:[email protected]

    8

    parameters belowReply manner 1 0 stands for control failure

    1 stands for controlsuccess

    2.2.9 DSC queries the ADC acquisition info. The command is

    0xD012.

    Data content length 2 The total length of theparameters below

    Identifier for the same packet 1 To identify if the datacorresponds to ACK packet

    Number of the IO ports queried 1 Number of the IO portsqueried(n1)

    Each IO channelinfo(loop n1 times)

    Addr. 1 Address starts from 1

    Valid number of the ADC inputsqueried

    1 Valid number of the ADC inputsqueried(assuming its n2)

    Each ADC channelinfo(loop n2 times)

    Addr. 1 Address starts from 1

    2.2.10 RTU replies to queries from DSC. The command is

    0x5012. Refer to command 0x5010.

    2.2.11 DSC queries puls counter. The command is 0xD013.

    Field Length(byte) NoteData content length 2 No parameter. Length is 00

    2.2.12 RTU replies to counter query from DSC. The command

    is 0x5013.

    Field Length(byte) Note

  • Xiamen Four-Faith Communication Technology Co., Ltd.

    Xiamen Four-Faith Communication Technology Co.,Ltd.Add J1-J3,3rdFloor,No.44,GuanRiRoad,SoftWare Park,XiaMen .361008.Chinahttp//en.four-faith.com Tel +86 13178273589 E-mail:[email protected]

    9

    Data content length 2 The total length of theparameters below

    Counter value 4 The counter value fromthe counting beginning toquery

    2.2.13 RTU sends alarm info. The command is 0x5014.

    Field Length(byte) NoteData content length 2 The total length of the

    parameters belowIdentifier for the samepacket

    1 To identify if the datacorresponds to ACK packet

    Type 1 0 stands for DIO, 2 standsfor ADC input and 2 standsfor counter

    Addr. 1 The correspondingchannel addr, startingfrom 1

    Value 4 The correspondingacquisition value(withsymbolic number)

    Acquisition time 4 Acquisition time. Timeafter Jan 1st 2000(second)

    2.2.14 DSC replies to alarm info. The command is 0xD014.

    Field Length(byte) NoteData content length 2 The total length of the

    parameters belowReply manner 1 0 stands for reply failure

    1 stands for reply successIdentifier for the samepacket

    1 To identify if the datacorresponds to ACK packet

  • Xiamen Four-Faith Communication Technology Co., Ltd.

    Xiamen Four-Faith Communication Technology Co.,Ltd.Add J1-J3,3rdFloor,No.44,GuanRiRoad,SoftWare Park,XiaMen .361008.Chinahttp//en.four-faith.com Tel +86 13178273589 E-mail:[email protected]

    10

    2.3RTU parameters configuration

    2.3.15 Remote configuration with AT commands in DSC. The

    command is 0xD020

    Field Length(byte) NoteData content length 2 The total length of the

    parameters belowOne AT command The length depends on the

    command. End with \r\n

    2.3.16RTU replies to AT commands from DSC. The command is

    0x5020.

    Field Length NoteData content length 2 The total length of the

    parameters belowAT command reply The length depends on the AT

    command reply. It will bedivided if longer than 1450bytes

    2.3.17Restart RTU from DSC. The command is 0xD024.

    Field Length(byte) NoteData content length 2 No parameter. Length is 00

    2.3.18RTU replies to reboot command. The command is

    0x5024.

    Field Length(byte) NoteData content length 2 No parameter. Length is 00

  • Xiamen Four-Faith Communication Technology Co., Ltd.

    Xiamen Four-Faith Communication Technology Co.,Ltd.Add J1-J3,3rdFloor,No.44,GuanRiRoad,SoftWare Park,XiaMen .361008.Chinahttp//en.four-faith.com Tel +86 13178273589 E-mail:[email protected]

    11

    2.4Remote upgrade command

    2.4.19Query firmware version of RTU from DSC. The

    command is 0xD035.

    Field Length(byte) NoteData content length 2 No parameter. Length is 00

    2.4.20RTU replies to firmware version query from DSC. The

    command is 0x5035.

    Field Length Field descriptionData length 2 The length of the fields below, 80 bytes in totalAPP ver. 40 RTU APP program version. Add blank space if less than

    40 bytes.BOOT ver. 40 RTU BOOT program version. Add blank space if less

    than 40 bytes.

    2.4.21Remote download from DSC. The command is 0xD030.

    Field Length Field descriptionData length 2 The length of the fields below, 92 bytes in total

  • Xiamen Four-Faith Communication Technology Co., Ltd.

    Xiamen Four-Faith Communication Technology Co.,Ltd.Add J1-J3,3rdFloor,No.44,GuanRiRoad,SoftWare Park,XiaMen .361008.Chinahttp//en.four-faith.com Tel +86 13178273589 E-mail:[email protected]

    12

    property 1 X111X111 (X is reserved bits)Bit7, bit3: Reservebit6 : 1. Compression mode download; 0.

    Non-compression mode download.bit5 : 1. Download immediately; 0. Dont download

    immediately(according to time set)bit4 : 1. Erase parameter area; 0. Dont erase

    parameter area.bit2~bit0Combination is below:

    0x00 APP program download0x01 BOOT program download

    Other combinations remain to be extended.Mode 1 0x00 TCP, 0x01 UDP

    Reply manner 1 0x00 stands for reply one by one. 0x01 stands for windowreply.

    Max windowframe number

    1 The Max frame number of a window is 16. Its no morethan 4 in this protocol.

    APN 20 (This function is not available at present) Such ascmnet. Add blank space if less then 20 bytes.

    IP 20 Such as 119.75.217.56. Add blank space if less then 20bytes.

    PROT 5 Such as 2000.Add blank space if less then 5 bytes.New ver. length 1 Transmission format: HEX

    Range: 1

  • Xiamen Four-Faith Communication Technology Co., Ltd.

    Xiamen Four-Faith Communication Technology Co.,Ltd.Add J1-J3,3rdFloor,No.44,GuanRiRoad,SoftWare Park,XiaMen .361008.Chinahttp//en.four-faith.com Tel +86 13178273589 E-mail:[email protected]

    13

    Reply manner 1 Reply type:00H failure01H success02H not the latest version

    2.5RTU transparent transmission function

    2.5.23Send data from DSC to serial port of RTU transparently.

    The command is 0xD0FE.

    Field Length(byte) NoteData content length 2 The total length of the

    parameters belowTransparent transmission data According to the data

    2.5.24Send data from serial port of RTU to DSC transparently.

    The command is 0x50FF

    Field Length(byte) NoteData content length 2 The total length of the

    parameters belowTransparent transmission data According to the data

    FormatdescriptionTCPformatDownlinkdataUplinkdata

    UDPformatDataSMSformat

    RTUextendedprotocolRegisterstringandheartbeatstringinfoRTUsendsregisterstring.Thecommandis0x5000.DSCrepliestotheregisterstring.ThecommandisRTUsendsheartbeatstring.Thecommandis0x5001.DSCrepliestoheartbeatstring.Thecommandis0x

    DIOandADCcontrol.RTUreportsIOacquisitioninfoactivelyandregulDSCrepliestotheIOacquisitioninfo.ThecommanDSCcontrolsIOport.Thecommandis0xD011.RTUrepliestothecontrolfromDSC.ThecommandiDSCqueriestheADCacquisitioninfo.ThecommandRTUrepliestoqueriesfromDSC.Thecommandis0DSCqueriespulscounter.Thecommandis0xD013.RTUrepliestocounterqueryfromDSC.ThecommanRTUsendsalarminfo.Thecommandis0x5014.DSCrepliestoalarminfo.Thecommandis0xD014.

    RTUparametersconfigurationRemoteconfigurationwithATcommandsinDSC.TheRTUrepliestoATcommandsfromDSC.ThecommandiRestartRTUfromDSC.Thecommandis0xD024.RTUrepliestorebootcommand.Thecommandis0x50

    RemoteupgradecommandQueryfirmwareversionofRTUfromDSC.ThecommanRTUrepliestofirmwareversionqueryfromDSC.ThRemotedownloadfromDSC.Thecommandis0xD030.RTUrepliestoremotedownloadconfiguration.The

    RTUtransparenttransmissionfunctionSenddatafromDSCtoserialportofRTUtranspareSenddatafromserialportofRTUtoDSCtranspare