|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 更新站点信息 且 下发plc命令 | 
|---|
|  |  |  | staProtocol.setWorkNo(wrkMast.getWrkNo()); | 
|---|
|  |  |  | staProtocol.setStaNo((short) 161); | 
|---|
|  |  |  | staProtocol.setStaNo(wrkMast.getStaNo().shortValue()); | 
|---|
|  |  |  | devpThread.setPakMk(staProtocol.getSiteId(), false); | 
|---|
|  |  |  | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); | 
|---|
|  |  |  | log.error("输送线下发5:"+wrkMast.getWrkNo()+","+wrkMast.getStaNo()); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (result.IsSuccess) { | 
|---|
|  |  |  | if (null == crnProtocol) { | 
|---|
|  |  |  | crnProtocol = new CrnProtocol(); | 
|---|
|  |  |  | crnProtocol.setCrnNo(slave.getId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | crnProtocol.setCrnNo(slave.getId()); | 
|---|
|  |  |  | crnProtocol.setMode(siemensNet.getByteTransform().TransInt16(result.Content, 0)); | 
|---|
|  |  |  | crnProtocol.setTaskNo(siemensNet.getByteTransform().TransInt16(result.Content, 2)); | 
|---|
|  |  |  | crnProtocol.setStatus(siemensNet.getByteTransform().TransInt16(result.Content, 4)); | 
|---|
|  |  |  | 
|---|
|  |  |  | StaProtocol staProtocol = station.get(siteId); | 
|---|
|  |  |  | if (null == staProtocol) { | 
|---|
|  |  |  | staProtocol = new StaProtocol(); | 
|---|
|  |  |  | staProtocol.setSiteId(siteId); | 
|---|
|  |  |  | station.put(siteId, staProtocol); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | staProtocol.setSiteId(siteId); | 
|---|
|  |  |  | staProtocol.setWorkNo(siemensS7Net.getByteTransform().TransInt32(result.Content, i*66 + 8));     // 工作号 | 
|---|
|  |  |  | staProtocol.setStaNo(siemensS7Net.getByteTransform().TransInt16(result.Content, i*66 + 12));   // 目标站 | 
|---|
|  |  |  | staProtocol.setState(siemensS7Net.getByteTransform().TransInt16(result.Content, i*66 + 14));  // 模式状态 0停机,=1手动,=2自动,=3故障 | 
|---|