| | |
| | | private MelsecMcNet melsecMcNet; |
| | | private CrnSlave slave; |
| | | private CrnProtocol crnProtocol; |
| | | private boolean resetFlag = false; |
| | | private boolean resetFlag = true; |
| | | |
| | | public CrnThread(CrnSlave slave) { |
| | | this.slave = slave; |
| | |
| | | } |
| | | |
| | | } else { |
| | | throw new CoolException("堆垛机plc状态信息失败"); |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】{1}堆垛机plc状态信息失败",DateUtils.convert(new Date()), slave.getId())); |
| | | throw new CoolException(MessageFormat.format( "堆垛机plc状态信息失败 ===>> [id:{0}] [ip:{1}] [port:{2}]", slave.getId(), slave.getIp(), slave.getPort())); |
| | | } |
| | | /* 方法2 */ |
| | | // crnProtocol.setMode(melsecMcNet.ReadInt16("D2231").Content); |
| | |
| | | |
| | | public CrnProtocol getCrnProtocol(){ |
| | | if (crnProtocol == null) { |
| | | readStatus(); |
| | | throw new CoolException(slave.getId() + "号堆垛机连接失败"); |
| | | } |
| | | return this.crnProtocol; |
| | | } |