| | |
| | | int ret = (int)para.RetractionSpeed;//右PLC自动伸出缩回速度 |
| | | int liftPosition= (int)para.LeftPosition;//左伸出位置 |
| | | int rigtpostition= (int)para.RightPosition;//右伸出位置 |
| | | var leftorigin = devices.Value.left.Communicator.Read<bool>("M115");//左plc到原点位置信号 |
| | | var rightorigin = devices.Value.right.Communicator.Read<bool>("M115");//右plc到达原点位置信号 |
| | | var lefttarget = devices.Value.left.Communicator.Read<bool>("M116");//左plc到达目标位置 |
| | | var righttarget = devices.Value.right.Communicator.Read<bool>("M116");//右plc到达目标位置 |
| | | |
| | | if (leftorigin == true || rightorigin == true) |
| | | try |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "已到原始点" }; |
| | | var leftorigin = devices.Value.left.Communicator.Read<bool>("M115");//左plc到原点位置信号 |
| | | var rightorigin = devices.Value.right.Communicator.Read<bool>("M115");//右plc到达原点位置信号 |
| | | if (leftorigin == true || rightorigin == true) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "已到原始点" }; |
| | | } |
| | | } |
| | | if (lefttarget == true || righttarget == true) |
| | | catch (Exception) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "已到最大值" }; |
| | | } |
| | | |
| | | |
| | | } |
| | | try |
| | | { |
| | | var lefttarget = devices.Value.left.Communicator.Read<bool>("M116");//左plc到达目标位置 |
| | | var righttarget = devices.Value.right.Communicator.Read<bool>("M116");//右plc到达目标位置 |
| | | if (lefttarget == true || righttarget == true) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "已到最大值" }; |
| | | } |
| | | |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | |
| | | } |
| | | if (ExtendedState == "伸出") |
| | | { |
| | | try |
| | |
| | | var para = BaseDal.QueryData().Where(x => x.Deptid == deid).OrderByDescending(x => x.CreateDate).FirstOrDefault(); |
| | | int ext = (int)para.ManualExtend;//左PLC手动伸出缩回速度 |
| | | int ret = (int)para.ManualRetraction;//右PLC手动伸出缩回速度 |
| | | |
| | | var leftorigin = devices.Value.left.Communicator.Read<bool>("M115");//左plc到原点位置信号 |
| | | var rightorigin = devices.Value.right.Communicator.Read<bool>("M115");//右plc到达原点位置信号 |
| | | var lefttarget = devices.Value.left.Communicator.Read<bool>("M116");//左plc到达目标位置 |
| | | var righttarget = devices.Value.right.Communicator.Read<bool>("M116");//右plc到达目标位置 |
| | | |
| | | if (leftorigin==true|| rightorigin==true) |
| | | try |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "已到原始点" }; |
| | | var leftorigin = devices.Value.left.Communicator.Read<bool>("M115");//左plc到原点位置信号 |
| | | var rightorigin = devices.Value.right.Communicator.Read<bool>("M115");//右plc到达原点位置信号 |
| | | if (leftorigin == true || rightorigin == true) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "已到原始点" }; |
| | | } |
| | | } |
| | | if(lefttarget==true|| righttarget == true) |
| | | catch (Exception) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "已到最大值" }; |
| | | } |
| | | |
| | | |
| | | } |
| | | try |
| | | { |
| | | var lefttarget = devices.Value.left.Communicator.Read<bool>("M116");//左plc到达目标位置 |
| | | var righttarget = devices.Value.right.Communicator.Read<bool>("M116");//右plc到达目标位置 |
| | | if (lefttarget == true || righttarget == true) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "已到最大值" }; |
| | | } |
| | | |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | if (position == "左" && ExtendedState == "伸出") |
| | | { |