|
|
|
|
@ -71,6 +71,8 @@ public class MyProtocolDecoder extends FixedLengthFrameDecoder {
|
|
|
|
|
byte b7 = in.readByte();
|
|
|
|
|
byte b8 = in.readByte();
|
|
|
|
|
byte[] bytes = new byte[]{b1, b2, b3, b4, b5, b6, b7, b8};
|
|
|
|
|
String signal = "pl43"+plcId+type+String.valueOf(taskId)+short1+short2+short3+short4+short5+short6+short7+short8+":"+code+b1+b2+b3+b4+b5+b6+b7+b8;
|
|
|
|
|
log.info("plcId:{},原始信号:{}", plcId, signal);
|
|
|
|
|
if (type.equals("0A")) {
|
|
|
|
|
//心跳
|
|
|
|
|
log.debug("receive heart plcId:{}", plcId);
|
|
|
|
|
@ -86,12 +88,15 @@ public class MyProtocolDecoder extends FixedLengthFrameDecoder {
|
|
|
|
|
|
|
|
|
|
} else if (type.equals("0C")) {
|
|
|
|
|
log.info("action code,{} plcId:{},orderInfo:{}", code, plcId, plcOrderInfo.toString());
|
|
|
|
|
Integer times = 1;
|
|
|
|
|
|
|
|
|
|
if(!code.equals("C6")){
|
|
|
|
|
times = OrderAction.put(plcOrderInfo.getOrderNum());
|
|
|
|
|
Integer times = OrderAction.put(plcOrderInfo.getOrderNum());
|
|
|
|
|
//执行动作
|
|
|
|
|
plcService.action(plcOrderInfo, plcId, times, code);
|
|
|
|
|
}else {
|
|
|
|
|
plcService.action(plcOrderInfo, plcId, 1, code);
|
|
|
|
|
}
|
|
|
|
|
//执行动作
|
|
|
|
|
plcService.action(plcOrderInfo, plcId, times, code);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (type.equals("0D")) {
|
|
|
|
|
|