| | |
| | | case 2: |
| | | write((LiftCommand) task.getData()); |
| | | break; |
| | | case 3: |
| | | writeIoMode((Integer) task.getData()); |
| | | default: |
| | | break; |
| | | } |
| | |
| | | liftProtocol.setDeviceStatus(siemensS7Net.getByteTransform().TransInt16(result3.Content, 2)); // 设备状态 |
| | | liftProtocol.setTaskStatus(siemensS7Net.getByteTransform().TransInt16(result3.Content, 4)); // 完成信号 |
| | | liftProtocol.setWorkNo((short) siemensS7Net.getByteTransform().TransInt32(result3.Content, 6)); // 工作号 |
| | | liftProtocol.setIoMode(siemensS7Net.getByteTransform().TransInt16(result3.Content, 10)); // 出入库模式 |
| | | } |
| | | |
| | | //温湿度信息反馈 |
| | |
| | | /** |
| | | * 写入命令 |
| | | */ |
| | | private void write(LiftCommand liftCommand) throws InterruptedException { |
| | | private void write(LiftCommand liftCommand) { |
| | | if (null == liftCommand) { |
| | | return; |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 写入命令 |
| | | */ |
| | | private void writeIoMode(Integer ioMode) { |
| | | if (null == ioMode) { |
| | | return; |
| | | } |
| | | short[] array = new short[1]; |
| | | array[0] = ioMode.shortValue(); |
| | | |
| | | OperateResult write = siemensS7Net.Write("DB100.12", array); |
| | | |
| | | if (!write.IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入出入库模式数据失败。输送线plc编号={1},站点数据={2}", DateUtils.convert(new Date()), slave.getId(), ioMode)); |
| | | News.error("SiemensDevp"+" - 4"+" - 写入出入库模式数据失败。输送线plc编号={},站点数据={}", slave.getId(), ioMode); |
| | | } else { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】 出入库模式命令下发 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), ioMode)); |
| | | News.info("SiemensDevp"+" - 5"+" - 出入库模式命令下发 [id:{}] >>>>> 命令下发: {}", slave.getId(), ioMode); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置入库标记 |
| | | */ |
| | | @Override |