|  |  | 
 |  |  |         midRs.rtuAddr = para.rtuAddr ;//Rtu地址 | 
 |  |  |         midRs.commandId = para.commandId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果 | 
 |  |  |         midRs.downCode = para.commandCode ;//下行命令功能码; | 
 |  |  |         midRs.downCodeName = CodeV1_0_1.getCodeName(para.commandCode) ;//下行命令功能码名称; | 
 |  |  |         midRs.downBuffer = bs ;//下行命令数据 | 
 |  |  |         midRs.downBufHex = ByteUtil.bytes2Hex(bs, true) ;//下行命令数据十六进制形式 | 
 |  |  |         midRs.hasResponse = true ;//是否有应答 | 
 |  |  | 
 |  |  |  | 
 |  |  |         ByteUtil.hex2Bytes(para.commandCode, bsHead, index) ; | 
 |  |  |  | 
 |  |  |         if(para.param == null){ | 
 |  |  |             throw new Exception("未提供命令参数数据,不能构造功能码为" + para.commandCode + "的下行命令") ; | 
 |  |  |         }else{ | 
 |  |  |             index = 0 ; | 
 |  |  |             byte[] bs = new byte[8] ; | 
 |  |  |             GlCreate.createPw(bs, index); | 
 |  |  |             index += 2 ; | 
 |  |  |             GlCreate.createTp(bs, index); | 
 |  |  |             bytes = ByteUtil.bytesMerge(bsHead, bs) ; | 
 |  |  |         } | 
 |  |  |         index = 0 ; | 
 |  |  |         byte[] bs = new byte[8] ; | 
 |  |  |         GlCreate.createPw(bs, index); | 
 |  |  |         index += 2 ; | 
 |  |  |         GlCreate.createTp(bs, index); | 
 |  |  |         bytes = ByteUtil.bytesMerge(bsHead, bs) ; | 
 |  |  |  | 
 |  |  |         GlCreate.createLen(bytes);//长度放字节数组中 | 
 |  |  |  |