| | |
| | | */ |
| | | private void readStatus(){ |
| | | try { |
| | | OperateResultExOne<byte[]> result = siemensS7Net.Read("DB101.0", (short) 27); |
| | | OperateResultExOne<byte[]> result = siemensS7Net.Read("DB101.0", (short) 28); |
| | | if (result.IsSuccess) { |
| | | if (null == steProtocol) { |
| | | steProtocol = new SteProtocol(); |
| | |
| | | |
| | | boolean[] status2 = siemensS7Net.getByteTransform().TransBool(result.Content, 27, 1); |
| | | |
| | | steProtocol.setChargeStatus(status[0]?(short)1:(short)0); |
| | | steProtocol.setTrack(status[1]?(short)1:(short)0); |
| | | steProtocol.setChargeStatus(status2[0]?(short)1:(short)0); |
| | | steProtocol.setTrack(status2[1]?(short)1:(short)0); |
| | | |
| | | // steProtocol.setLoad(status2[6]?(short)1:(short)0); |
| | | steProtocol.setLoad(status2[7]?(short)1:(short)0); |
| | |
| | | } |
| | | command.setSteNo(slave.getId()); |
| | | OperateResult result = null; |
| | | News.error("穿梭车写入命令"+JSON.toJSONString(command)); |
| | | |
| | | // 开始任务 |
| | | if (!command.getComplete()) { |
| | | //组织任务前,先清空写任务确认位,以及任务完成确认位 |
| | |
| | | siemensS7Net.Write("DB100.12", (short) 0);//起始点位 |
| | | siemensS7Net.Write("DB100.14", (short) 0);//目的点位 |
| | | siemensS7Net.Write("DB100.16.0", false);//任务开始确认位 |
| | | siemensS7Net.Write("DB100.16.1", false);//任务完成确认位 |
| | | // siemensS7Net.Write("DB100.18", (short) 0);//硫化罐号 |
| | | // 1.任务号 |
| | | OperateResult result0 = siemensS7Net.Write("DB100.2", command.getTaskNo().shortValue()); |