| | |
| | | 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) |
| | | { |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | devices.Value.left.Communicator.Write<int>("D1001", ext);//å·¦PLCèªå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.left.Communicator.Write<bool>("M102", true);//ä¼¸åºæé® |
| | | Thread.Sleep(100); // çå¾
100msï¼æ¨¡ææé®æä¸ï¼ |
| | | devices.Value.left.Communicator.Write<bool>("M102", false); // éæ¾æé® |
| | | devices.Value.left.Communicator.Write<int>("D1002", liftPosition);//左伸åºä½ç½® |
| | | } |
| | | catch (Exception) |
| | |
| | | { |
| | | devices.Value.right.Communicator.Write<int>("D1001", ret); //å³PLCèªå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.right.Communicator.Write<bool>("M102", true); |
| | | Thread.Sleep(100); // çå¾
100msï¼æ¨¡ææé®æä¸ï¼ |
| | | devices.Value.right.Communicator.Write<bool>("M102", false); // éæ¾æé® |
| | | devices.Value.right.Communicator.Write<int>("D1002", rigtpostition);//å³ä¼¸åºä½ç½® |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | throw; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | devices.Value.left.Communicator.Write<int>("D1001", ext);//缩åé度 |
| | | devices.Value.left.Communicator.Write<bool>("M103", true);//缩åæé® |
| | | Thread.Sleep(100); // çå¾
100msï¼æ¨¡ææé®æä¸ï¼ |
| | | devices.Value.left.Communicator.Write<bool>("M103", false); // éæ¾æé® |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | throw; |
| | | |
| | | } |
| | | |
| | | try |
| | | { |
| | | devices.Value.right.Communicator.Write<int>("D1001", ret); |
| | | devices.Value.right.Communicator.Write<bool>("M103", true); |
| | | Thread.Sleep(100); // çå¾
100msï¼æ¨¡ææé®æä¸ï¼ |
| | | devices.Value.right.Communicator.Write<bool>("M103", false); // éæ¾æé® |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | throw; |
| | | |
| | | } |
| | | Console.WriteLine($"DeptId={deptId} 缩åæä½ï¼å·¦é度={ext}ï¼å³é度={ret}"); |
| | | } |
| | |
| | | |
| | | 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å°è¾¾ç®æ ä½ç½® |
| | | int liftPosition = (int)para.LeftPosition;//左伸åºä½ç½® |
| | | int rigtpostition = (int)para.RightPosition;//å³ä¼¸åºä½ç½® |
| | | try |
| | | { |
| | | 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 = "å·²å°åå§ç¹" }; |
| | | } |
| | | } |
| | | catch (Exception) |
| | | { |
| | | |
| | | if (leftorigin == true || rightorigin == true) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "å·²å°åå§ç¹" }; |
| | | |
| | | } |
| | | if (lefttarget == true || righttarget == true) |
| | | try |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "已尿大å¼" }; |
| | | 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 == "伸åº") |
| | | { |
| | | devices.Value.left.Communicator.Write<int>("D1000", ext);//å·¦PLCæå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.left.Communicator.Write<bool>("M100", true);//ä¼¸åºæé® |
| | | Console.WriteLine($"{position}å·¦PLCèªå¨ä¼¸åºç¼©åé度{ext}"); |
| | | Thread.Sleep(100); // çå¾
100msï¼æ¨¡ææé®æä¸ï¼ |
| | | devices.Value.left.Communicator.Write<bool>("M100", false); // éæ¾æé® |
| | | devices.Value.left.Communicator.Write<int>("D1002", liftPosition);//左伸åºä½ç½® |
| | | Console.WriteLine($"{position}伸缩ææå¨ä¼¸åº{ext}"); |
| | | } |
| | | else if (position == "å·¦" && ExtendedState == "缩å") |
| | | { |
| | | devices.Value.left.Communicator.Write<int>("D1000", ext);//å·¦PLCæå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.left.Communicator.Write<bool>("M101", true); |
| | | Console.WriteLine($"{position}å·¦PLCèªå¨ä¼¸åºç¼©åé度{ext}"); |
| | | Thread.Sleep(100); // çå¾
100msï¼æ¨¡ææé®æä¸ï¼ |
| | | devices.Value.left.Communicator.Write<bool>("M101", false); // éæ¾æé® |
| | | Console.WriteLine($"{position}伸缩ææå¨ç¼©å{ext}"); |
| | | } |
| | | else if (position == "å³" && ExtendedState == "伸åº") |
| | | { |
| | | devices.Value.right.Communicator.Write<int>("D1000", ret);//å³PLCæå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.right.Communicator.Write<bool>("M100", true); |
| | | Console.WriteLine($"{position}å³PLCèªå¨ä¼¸åºç¼©åé度{ext}"); |
| | | Thread.Sleep(100); // çå¾
100msï¼æ¨¡ææé®æä¸ï¼ |
| | | devices.Value.right.Communicator.Write<bool>("M100", false); // éæ¾æé® |
| | | devices.Value.right.Communicator.Write<int>("D1002", liftPosition);//左伸åºä½ç½® |
| | | Console.WriteLine($"{position}伸缩ææå¨ä¼¸åº{ret}"); |
| | | } |
| | | else if (position == "å³" && ExtendedState == "缩å") |
| | | { |
| | | devices.Value.right.Communicator.Write<int>("D1000", ret);//å³PLCæå¨ä¼¸åºç¼©åé度 |
| | | devices.Value.right.Communicator.Write<bool>("M101", true); |
| | | Console.WriteLine($"{position}å³PLCèªå¨ä¼¸åºç¼©åé度{ret}"); |
| | | Thread.Sleep(100); // çå¾
100msï¼æ¨¡ææé®æä¸ï¼ |
| | | devices.Value.right.Communicator.Write<bool>("M101", false); // éæ¾æé® |
| | | Console.WriteLine($"{position}伸缩ææå¨ç¼©å{ret}"); |
| | | } |
| | | |
| | | else |