| | |
| | | |
| | | if (!string.IsNullOrEmpty(boxcode)) |
| | | { |
| | | string sc = device.Communicator.Read<string>("DB900.598.0"); |
| | | string sc = device.Communicator.Read<string>("DB900.578.0"); |
| | | WriteError(device.DeviceName, $"读åå¼ï¼{boxcode},对æ¯{sc}"); |
| | | string boxEndCode = ""; |
| | | if (boxcode.LastIndexOf(",SC:") >= 0) |
| | | if (boxcode.LastIndexOf(",PO:") >= 0) |
| | | { |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC:")) + sc.Substring(sc.IndexOf(",SC:")).Replace("\0", ""); |
| | | } |
| | | else if (boxcode.LastIndexOf(",SC") > 0) |
| | | { |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); |
| | | } |
| | | else if (boxcode.LastIndexOf(",S") > 0) |
| | | { |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",S")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",PO:")) + sc.Substring(sc.IndexOf(",PO:")).Replace("\0", ""); |
| | | } |
| | | |
| | | //å
¥åºç³è¯·ä»»å¡ |
| | |
| | | } |
| | | else if (!conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && conveyorLineSignalWrite.ACK) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && x.PalletCode == conveyorLineInfoRead.Barcode && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt()); |
| | | string boxcode = device.GetValue<R_ConveyorLineDB, string>(R_ConveyorLineDB.Boxcode, item.StationCode); |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && boxcode.Contains(x.PalletCode) && x.DeviceCode == item.StationDeviceCode && x.TaskState == TaskStatusEnum.New.ObjToInt()); |
| | | if (task != null) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, currentAddress: item.StackerCraneStationCode, deviceCode: task.Roadway, nextAddress: task.TargetAddress); |
| | |
| | | { |
| | | WriteInfo(device.DeviceName, $"æªæ¾å°è®¾å¤åç¼å·{item.StationCode}çå议信æ¯"); |
| | | } |
| | | R_ConveyorLineInfo conveyorLineInfoRead1 = device.Communicator.ReadCustomer<R_ConveyorLineInfo>(deviceProRead.DeviceProAddress); |
| | | W_ConveyorLineInfo conveyorLineInfoWrite1 = device.Communicator.ReadCustomer<W_ConveyorLineInfo>(deviceProWrite.DeviceProAddress); |
| | | R_ConveyorLineStatus conveyorLineStatus1 = conveyorLineInfoRead1.Status.ByteToBoolObject<R_ConveyorLineStatus>(); |
| | | ConveyorLineSignal conveyorLineSignalRead1 = conveyorLineInfoRead1.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | ConveyorLineSignal conveyorLineSignalWrite1 = conveyorLineInfoWrite1.Signal.ByteToBoolObject<ConveyorLineSignal>(); |
| | | if (item.StationCode == "2004") |
| | | { |
| | | if (conveyorLineSignalRead1.STB && conveyorLineStatus1.Online && conveyorLineStatus1.Goods && !conveyorLineStatus1.Alarm && !conveyorLineSignalWrite1.ACK) |
| | | { |
| | | StackerCraneJob_PP.pPReadData.R_PP_Boxcode = device.Communicator.Read<string>("DB900.578.0"); |
| | | } |
| | | StackerCraneJob_PP.pPReadData.R_PP_HandShake4 = conveyorLineStatus1.HandShake; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Online4 = conveyorLineStatus1.Online; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Free4 = conveyorLineStatus1.Free; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Goods4 = conveyorLineStatus1.Goods; |
| | | StackerCraneJob_PP.pPReadData.R_PP_Alarm4 = conveyorLineStatus1.Alarm; |
| | | StackerCraneJob_PP.pPReadData.R_PP_STB4 = conveyorLineSignalRead1.STB; |
| | | StackerCraneJob_PP.pPReadData.R_PP_ACK4 = conveyorLineSignalRead1.ACK; |
| | | StackerCraneJob_PP.pPReadData.W_PP_STB4 = conveyorLineSignalWrite1.STB; |
| | | StackerCraneJob_PP.pPReadData.W_PP_ACK4 = conveyorLineSignalWrite1.ACK; |
| | | } |
| | | } |
| | | } |
| | | |