| | |
| | | Thread.Sleep(500); |
| | | device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDReceiveDone.ToString()).DeviceProDataBlock, 0); |
| | | } |
| | | if (R_MDQtys2==18) |
| | | { |
| | | device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDSend2.ToString()).DeviceProDataBlock, 2); |
| | | } |
| | | if (R_MDStatus2 == 2) |
| | | { |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDSend2.ToString()).DeviceProDataBlock, 0); |
| | | } |
| | | //鑾峰彇褰撳墠浠诲姟 |
| | | Dt_Task task = _taskRepository.QueryData(x => x.NextAddress == item.StationCode && _taskService.TaskInboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.MD_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode).OrderBy(x=>x.TaskNum).First(); |
| | | if (task!=null) //鐮佸灈鐢宠 |
| | | { |
| | | if ((Allow==3 || Allow == 7)&& item.StackerCraneStationCode == "1") |
| | | if ((Allow==3 || Allow == 7)) |
| | | { |
| | | if ( R_MDQtys1 / 6 ==1) |
| | | { |
| | |
| | | { |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDZ.ToString()).DeviceProDataBlock, 0); |
| | | } |
| | | device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x=>x.DeviceProParamName== W_MDDB.W_MDSend1.ToString()).DeviceProDataBlock,1); |
| | | device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDSendID.ToString()).DeviceProDataBlock, 1); |
| | | if (item.StackerCraneStationCode == "1") |
| | | { |
| | | device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDSend1.ToString()).DeviceProDataBlock, 1); |
| | | } |
| | | else if (item.StackerCraneStationCode == "2") |
| | | { |
| | | device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDSend2.ToString()).DeviceProDataBlock, 1); |
| | | } |
| | | device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDSendID.ToString()).DeviceProDataBlock, Convert.ToInt16(item.StackerCraneStationCode)); |
| | | if (R_MDQtys1 % 6==0) |
| | | { |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, 1675); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, 1137); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, 1670); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, -1140); |
| | | } |
| | | else if (R_MDQtys1 % 6 == 1) |
| | | { |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, 1675); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, 1462); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, 1670); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, -1480); |
| | | } |
| | | else if (R_MDQtys1 % 6 == 2) |
| | | { |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, 1675); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, 1787); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, 1670); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, -1820); |
| | | } |
| | | else if (R_MDQtys1 % 6 == 3) |
| | | { |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, 1250); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, 1137); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, 1243); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, -1140); |
| | | } |
| | | else if (R_MDQtys1 % 6 == 4) |
| | | { |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, 1250); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, 1462); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, 1243); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, -1480); |
| | | } |
| | | else if (R_MDQtys1 % 6 == 5) |
| | | { |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, 1250); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, 1787); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDX.ToString()).DeviceProDataBlock, 1243); |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDY.ToString()).DeviceProDataBlock, -1820); |
| | | } |
| | | device.Communicator.Write<float>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDA.ToString()).DeviceProDataBlock, 1); |
| | | device.Communicator.Write<short>(device.DeviceProDTOs.FirstOrDefault(x => x.DeviceProParamName == W_MDDB.W_MDReceiveDone.ToString()).DeviceProDataBlock, 3); |