| | |
| | | { |
| | | "$type": "Bookmark", |
| | | "Name": "ST:129:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" |
| | | }, |
| | | { |
| | | "$type": "Bookmark", |
| | | "Name": "ST:0:0:{1c4feeaa-4718-4aa9-859d-94ce25d182ba}" |
| | | } |
| | | ] |
| | | }, |
| | |
| | | { |
| | | if (action) |
| | | { |
| | | int[] num = new int[3] {1,1,1}; |
| | | int[] num = new int[3] {1,0,1}; |
| | | var writeRes = OITcpHelper.RegisterWriteOutPutMulti(new OITcpHelper.RegisterWriteOutPutModelMulti |
| | | { |
| | | host = plc.ip, |
| | |
| | | { |
| | | //推送小车进入 |
| | | TSHelper.GoToAGV(taskNo, 10, 3); |
| | | writeRes = OITcpHelper.RegisterWriteOutPut(new OITcpHelper.RegisterWriteOutPutModel |
| | | |
| | | int[] num1 = new int[2] { 1, 2}; |
| | | writeRes = OITcpHelper.RegisterWriteOutPutMulti(new OITcpHelper.RegisterWriteOutPutModelMulti |
| | | { |
| | | host = plc.ip, |
| | | addr = plc.writeAddr + 2, |
| | | data = 2, |
| | | addr = plc.writeAddr + 1, |
| | | data = num1, |
| | | port = plc.port |
| | | }); |
| | | CMMLog.Debug($"写入设备{plc.location}通道{plc.writeAddr + 2}里面数据为2."); |
| | | |
| | | //writeRes = OITcpHelper.RegisterWriteOutPut(new OITcpHelper.RegisterWriteOutPutModel |
| | | //{ |
| | | // host = plc.ip, |
| | | // addr = plc.writeAddr + 2, |
| | | // data = 2, |
| | | // port = plc.port |
| | | //}); |
| | | CMMLog.Debug($"写入设备{plc.location}通道{plc.writeAddr + 1}里面数据为{JsonConvert.SerializeObject(num1)}."); |
| | | } |
| | | } |
| | | } |
| | |
| | | try |
| | | { |
| | | string endMachLoc = ""; |
| | | string endLoc = ""; |
| | | //1、判断上料平台是否空闲,若空闲更改终点到上料平台 |
| | | var plc = Settings.GetPlcInfo().Where(a => a.deviceType == "18" && a.enable == 1).ToList(); |
| | | var plc = Settings.GetPlcInfo().Where(a => a.deviceType == "51" && a.enable == 1).ToList(); |
| | | if (plc.Count > 0) |
| | | { |
| | | #region 判断输送线模式 变更注释 |
| | | bool action = true; |
| | | foreach(var a in plc) |
| | | { |
| | | bool action = false; |
| | | var modeResult = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel |
| | | { |
| | | dataNum = 1, |
| | |
| | | }); |
| | | if (modeResult != null && modeResult.errCode == 0) |
| | | { |
| | | CMMLog.Debug($"OutWareTask:读取滚筒机{a.ip}通道号为:{a.readAddr}的值为:{modeResult.result[0]}"); |
| | | CMMLog.Debug($"OutWareTask:读取滚筒机ip:{a.ip},端口:{a.port}通道号为:{a.readAddr}的值为:{modeResult.result[0]}"); |
| | | if (modeResult.result[0] == 2) |
| | | { |
| | | action = false; |
| | | CMMLog.Debug($"OutWareTask:输送线为 入库模式,输送线点位:{a.location}"); |
| | | break; |
| | | } |
| | |
| | | { |
| | | if (modelInfo.Mode == "入库模式") |
| | | { |
| | | action = false; |
| | | CMMLog.Debug($"OutWareTask:中间表 ModeList为 入库模式"); |
| | | |
| | | } |
| | | else |
| | | { |
| | | action = true; |
| | | int[] num = new int[1] { 1 }; |
| | | var writeRes = OITcpHelper.RegisterWriteOutPutMulti(new OITcpHelper.RegisterWriteOutPutModelMulti |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | action = false; |
| | | CMMLog.Debug("OutWareTask:中间表 ModeList 为空"); |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | if (!action) |
| | | { |
| | | return false; |
| | | } |
| | | }; |
| | | |
| | | #endregion |
| | | |
| | | CMMLog.Info($"OutWareTask 11111"); |
| | |
| | | } |
| | | } |
| | | } |
| | | mst = iCallTask.FindTask(action.CN_S_TASK_NO); |
| | | if (IsSendTask) ProcessHelper.SendTask(mst); |
| | | } |
| | | } |