• 大小: 128KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-07
  • 语言: 其他
  • 标签: DLT645  

资源简介

DLT645 协议解析 包含07 97 两种解析方式,注释齐全,适合新手了解

资源截图

代码片段和文件信息

package cn.usr.cloud.dlt645;

import cn.usr.cloud.dlt645.codec.DLT645ResponseDecoder;
import cn.usr.cloud.dlt645.exception.TransportException;
import cn.usr.cloud.dlt645.response.ExceptionResponse;
import cn.usr.cloud.dlt645.response.ReadResponse;
import cn.usr.cloud.dlt645.util.MessageUtils;

/**
 * 测试类
 * 传输次序:
 * 所有数据项均先传送低位字节,后传送高位字节。数据传输的举例:电能量值为123456.78kWh,其传输次序如图9所示
 * 78H 56H 34H 12H
 * 除特殊说明的数据项以ASCII码表示外,其它数据项均采用压缩BCD码表示。
 *
 * @version V1.0  李雷红  2017-12-28-10:19
 */
public class Test {

    //    static byte[] t07 = {(byte) 0xfe 0x68 0x61 0x01 0x00 0x00 0x00 0x00 0x68 (byte) 0x92 0x07 0x33 0x34 0x34 0x35 0x34 0x43 (byte) 0xC6 (byte) 0xD8 0x16};
//    static byte[] t07 = {(byte) 0xfe0x680x610x010x000x000x000x000x68 (byte) 0x910x080x330x330x370x330x560x330x340x33 (byte) 0x8B0x16};
//    static byte[] t07 = {(byte) 0xfe0x680x610x010x000x000x000x000x68 (byte) 0x910x070x330x330x360x350x450x580x330x6B0x16};
//    static byte[] t07 = {0x680x550x660x770x010x180x040x68 (byte) 0x910x070x330x330x370x35 (byte) 0x850x470x33 (byte) 0x880x16};
    static byte[] t07 = {0x68 0x52 0x66 0x77 0x01 0x18 0x04 0x68 (byte) 0x91 0x07 0x33 0x33 0x37 0x35 0x38 0x33 (byte) 0xb3 (byte) 0xa4 0x16};
    static byte[] t97 = {(byte) 0xfe 0x68 0x61 0x01 0x00 0x00 0x00 0x00 0x68 (byte) 0x81 0x05 0x43 (byte) 0xc3 0x33 0x55 0x33 (byte) 0x79 0x16};
    static byte[] t97_ERROR = {(byte) 0xfe 0x68 0x61 0x01 0x00 0x00 0x00 0x00 0x68 (byte) 0xC1 0x01 0x55 (byte) 0x49 0x16};

    public static void println(object o) {
        System.out.println(o);
    }

    public static void print(object o) {
        System.out.print(o);
    }

    public static void main(String ages[]) throws TransportException {
        //从站回应
//        DLT645ResponseDecoder dlt645ResponseDecoder = new DLT645ResponseDecoder();
//        ReadResponse decode = (ReadResponse) dlt645ResponseDecoder.decode07(t07);
//        if(decode.isException()){
//            ExceptionResponse exceptionResponse = (ExceptionResponse) decode;
//            println(exceptionResponse.getSlaverErrCode());
//        }
//        println(decode.toString());
        //发送:14:44:21 | FEFE6899999999999968 01 02 4A C3 76 16
        //发送:14:44:48 | FEFE6899999999999968 01 02 43 C3 6F 16
        //6899999999999968 08 06 33 33 33 33 33 33 A616
        //主站下发读命令
//        DLT645RequestEncoder dlt645RequestEncoder = new DLT645RequestEncoder();
////        byte[] bytes = dlt645RequestEncoder.broadcastTime();
//        byte[] bytes = dlt645RequestEncoder.readRequestEncode97(“999999999999“ “9010“);
//        for (int i = 0; i < bytes.length; i++) {
//            print(bytes[i] + “  “);
//        }

        DLT645ResponseDecoder dlt645ResponseDecoder = new DLT645ResponseDecoder();
        ReadResponse decode = (ReadResponse) dlt645ResponseDecoder.decode07(t07);
   

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        201  2018-01-02 18:26  Dlt645Analysis\.gitignore

     文件         14  2018-01-02 18:26  Dlt645Analysis\.idea\.name

     文件        317  2018-01-11 18:21  Dlt645Analysis\.idea\artifacts\Dlt645Analysis_jar.xml

     文件        686  2018-01-02 18:26  Dlt645Analysis\.idea\compiler.xml

     文件         76  2018-01-02 18:26  Dlt645Analysis\.idea\copyright\profiles_settings.xml

     文件        159  2018-01-02 18:26  Dlt645Analysis\.idea\encodings.xml

     文件        241  2018-04-26 12:08  Dlt645Analysis\.idea\inspectionProfiles\profiles_settings.xml

     文件       1479  2018-04-26 12:08  Dlt645Analysis\.idea\inspectionProfiles\Project_Default.xml

     文件        873  2018-01-11 18:20  Dlt645Analysis\.idea\misc.xml

     文件        268  2018-01-02 18:26  Dlt645Analysis\.idea\modules.xml

     文件       8792  2018-01-12 09:21  Dlt645Analysis\.idea\uiDesigner.xml

     文件        167  2018-01-02 18:26  Dlt645Analysis\.idea\vcs.xml

     文件      69303  2018-04-27 10:02  Dlt645Analysis\.idea\workspace.xml

     文件        423  2018-01-02 18:26  Dlt645Analysis\Dlt645Analysis.iml

     文件      20153  2018-01-12 11:17  Dlt645Analysis\out\artifacts\Dlt645Analysis_jar\Dlt645Analysis18-01-12-1.1.jar

     文件      20138  2018-01-12 11:21  Dlt645Analysis\out\artifacts\Dlt645Analysis_jar\Dlt645Analysis18-01-12-1.2.jar

     文件      20119  2018-01-12 11:33  Dlt645Analysis\out\artifacts\Dlt645Analysis_jar\Dlt645Analysis18-01-12-1.3.jar

     文件      20093  2018-01-12 12:07  Dlt645Analysis\out\artifacts\Dlt645Analysis_jar\Dlt645Analysis18-01-12-1.4.jar

     文件      20663  2018-04-27 09:03  Dlt645Analysis\out\artifacts\Dlt645Analysis_jar\Dlt645Analysis18-04-27-1.5.jar

     文件       3241  2018-04-27 09:02  Dlt645Analysis\out\production\Dlt645Analysis\cn\usr\cloud\dlt645\bean\DecoderState.class

     文件       2457  2018-04-27 09:02  Dlt645Analysis\out\production\Dlt645Analysis\cn\usr\cloud\dlt645\codec\DLT645RequestEncoder.class

     文件       5573  2018-04-27 09:02  Dlt645Analysis\out\production\Dlt645Analysis\cn\usr\cloud\dlt645\codec\DLT645ResponseDecoder.class

     文件        589  2018-04-27 09:02  Dlt645Analysis\out\production\Dlt645Analysis\cn\usr\cloud\dlt645\exception\CSCheckErrorException.class

     文件        838  2018-04-27 09:02  Dlt645Analysis\out\production\Dlt645Analysis\cn\usr\cloud\dlt645\exception\TransportException.class

     文件        284  2018-04-27 09:02  Dlt645Analysis\out\production\Dlt645Analysis\cn\usr\cloud\dlt645\impl\IDLT645Decoder.class

     文件        511  2018-04-27 09:02  Dlt645Analysis\out\production\Dlt645Analysis\cn\usr\cloud\dlt645\impl\IDLT645Encoder.class

     文件        166  2018-04-27 09:02  Dlt645Analysis\out\production\Dlt645Analysis\cn\usr\cloud\dlt645\impl\IDLT645Request.class

     文件       2734  2018-04-27 09:02  Dlt645Analysis\out\production\Dlt645Analysis\cn\usr\cloud\dlt645\request\AbstractDlt645Request.class

     文件       1273  2018-04-27 09:02  Dlt645Analysis\out\production\Dlt645Analysis\cn\usr\cloud\dlt645\request\BroadsastTimeRequest.class

     文件       1623  2018-04-27 09:02  Dlt645Analysis\out\production\Dlt645Analysis\cn\usr\cloud\dlt645\request\ReadRequest.class

............此处省略65个文件信息

评论

共有 条评论