Explorar o código

开料输送增加平移

陈子杰 hai 2 meses
pai
achega
6aa9cd9740

+ 59 - 1
SCADA_DAQ/Customer/Machines/SortingDeliveryMachine.cs

@@ -1,4 +1,6 @@
-using SCADA.Drive;
+using Mysqlx.Session;
+using SCADA.Drive;
+using SCADA_DAQ.Customer.Models;
 using SCADA_DAQ.Customer.Models.BackOfSortingDelivery;
 using System;
 using System.Collections.Generic;
@@ -52,9 +54,45 @@ namespace SCADA_DAQ.Customer.Machines
         }
         private Queue<int> _LeftLoversOrAbnormal = new Queue<int>();
 
+
+        /// <summary>
+        /// 异型通道板件队列
+        /// </summary>
+        public Queue<BoardModel> AbnormalBoards
+        {
+            get { return _AbnormalBoards; }
+            set
+            {
+                if (value != _AbnormalBoards)
+                {
+                    _AbnormalBoards = value;
+                    OnPropertyChanged(nameof(AbnormalBoards));
+                }
+            }
+        }
+        private Queue<BoardModel> _AbnormalBoards = new Queue<BoardModel>();
+
+
         public string AlarmStr { get => string.Join(",", AlarmCollection.Select(t => t.Desc).ToList()); }
 
 
+        /// <summary>
+        /// 扫码状态
+        /// </summary>
+        public bool IsGetCode
+        {
+            get { return _IsGetCode; }
+            set
+            {
+                if (value != _IsGetCode)
+                {
+                    _IsGetCode = value;
+                    OnPropertyChanged(nameof(IsGetCode));
+                }
+            }
+        }
+        private bool _IsGetCode;
+
 
         public SortingDeliveryMachine(string machieID) : base(machieID)
         {
@@ -77,6 +115,26 @@ namespace SCADA_DAQ.Customer.Machines
                     log.Info("信号误触发!");
                 }
             }
+            else if (reg.Comment.Variable == Tag_PLCGetCode && reg.Value == 1)
+            {
+                if (!IsGetCode)
+                {
+                    GetListenReg(Tag_CodeMatch).WriteReg(2);
+                    LeftLoversOrAbnormal.Enqueue(1);
+                    log.Warn("板件已经经过扫码区域,但上位机没有收到读码器回复!");
+                }
+                IsGetCode = false;
+                reg.ResetBit();
+            }
+            else if (reg.Comment.Variable == Tag_AbnormalHadBoard && reg.Value == 1)
+            {
+                var board = AbnormalBoards.Dequeue();
+                //长度小于1500才平移
+                if (Math.Max(board.Width,board.Length) <= 1900)
+                {
+                    GetListenReg(Tag_AbnormalTranslateMove).SetBit();
+                }
+            }
         }
 
         protected override void AlarmReset(object sender, AlarmTriggedEventArgs e)

+ 9 - 2
SCADA_DAQ/Customer/Service/ScannerService.cs

@@ -109,6 +109,7 @@ namespace SCADA_DAQ.Customer.Service
         private void Sbr1_BarCodeReceived(object sender, SCADA.BarcodeReader.BarcodeReceivedEventArgs e)
         {
             var barcode = e.Barcode;
+            Plc1.IsGetCode = true;
 
             var barcodeTask = BoardTasks.Where(t => t.BoardID == barcode).FirstOrDefault();
             if (barcodeTask == null)
@@ -119,7 +120,7 @@ namespace SCADA_DAQ.Customer.Service
             var api = new WebApiHelper(_ScannerServiceConfig.Url);
             if ((DateTime.Now - LastScanTime).TotalSeconds > 3)
             {
-                Plc1.GetListenReg(SortingDeliveryMachine.Tag_CodeMatch).WriteReg(0);
+                //Plc1.GetListenReg(SortingDeliveryMachine.Tag_CodeMatch).WriteReg(0);
 
                 if (barcode != "NoRead" && barcodeTask != null)
                 {
@@ -138,6 +139,13 @@ namespace SCADA_DAQ.Customer.Service
 
                         //Plc1.GetListenReg(SortingDeliveryMachine.Tag_IsLeftovers).WriteReg(0);
                         Plc1.LeftLoversOrAbnormal.Enqueue(2);
+                        var board = new BoardModel
+                        {
+                            Width = (int)barcodeTask.Width,
+                            Length = (int)barcodeTask.Height,
+                            Thickness = (int)barcodeTask.Thickness,
+                        };
+                        Plc1.AbnormalBoards.Enqueue(board);
                         Log.Info("板件异型或尺寸或比例太小或尺寸超出2620mm!");
 
                     }
@@ -189,7 +197,6 @@ namespace SCADA_DAQ.Customer.Service
                 Log.Warn("扫码频率过高,已经屏蔽");
             }
             LastScanTime = DateTime.Now;
-           
             
             
             //if (barcodeTask != null )

+ 32 - 4
SCADA_DAQ/Machines/LongMen1_龙门移载1.cs

@@ -36,6 +36,13 @@ namespace SCADA_DAQ.Customer.Machines
 		/// </summary>
 		public const string @Tag_E_Stop="E-Stop";
 			
+		/// <summary>寄存器:M1004【ShieldedSignal】
+		/// <para>单位:</para> 
+		/// <para>缩放:1 类型: Default</para> 
+		/// <para>备注:停止进料</para> 
+		/// </summary>
+		public const string @Tag_ShieldedSignal="ShieldedSignal";
+			
 		/// <summary>寄存器:M4【M4】
 		/// <para>单位:</para> 
 		/// <para>缩放:1 类型: Default</para> 
@@ -155,12 +162,12 @@ namespace SCADA_DAQ.Customer.Machines
 		/// </summary>
 		public const string @Tag_M20="M20";
 			
-		/// <summary>寄存器:D100【WorkModel
+		/// <summary>寄存器:D100【D100
 		/// <para>单位:</para> 
 		/// <para>缩放:1 类型: Default</para> 
-		/// <para>备注:旋转角度</para> 
+		/// <para>备注:模式选择</para> 
 		/// </summary>
-		public const string @Tag_WorkModel="WorkModel";
+		public const string @Tag_D100="D100";
 			
 		/// <summary>寄存器:D101【D101】
 		/// <para>单位:</para> 
@@ -890,6 +897,13 @@ namespace SCADA_DAQ.Customer.Machines
 		/// </summary>
 		public const string @Tag_XAutoRunSpeed="XAutoRunSpeed";
 			
+		/// <summary>寄存器:D1050【FeedatockTime】
+		/// <para>单位:</para> 
+		/// <para>缩放:1 类型: Default</para> 
+		/// <para>备注:放料节拍</para> 
+		/// </summary>
+		public const string @Tag_FeedatockTime="FeedatockTime";
+			
 		/// <summary>寄存器:D1024【ZAutoRunSpeed】
 		/// <para>单位:</para> 
 		/// <para>缩放:1 类型: Float</para> 
@@ -907,7 +921,7 @@ namespace SCADA_DAQ.Customer.Machines
 		/// <summary>寄存器:D1022【XAutoRunAccTime】
 		/// <para>单位:</para> 
 		/// <para>缩放:1 类型: Float</para> 
-		/// <para>备注:X轴自动加速</para> 
+		/// <para>备注:X轴加速</para> 
 		/// </summary>
 		public const string @Tag_XAutoRunAccTime="XAutoRunAccTime";
 			
@@ -1471,6 +1485,20 @@ namespace SCADA_DAQ.Customer.Machines
 		/// </summary>
 		public const string @Tag_M820="M820";
 			
+		/// <summary>寄存器:M821【M821】
+		/// <para>单位:</para> 
+		/// <para>缩放:1 类型: Default</para> 
+		/// <para>备注:A斜滚感应异常</para> 
+		/// </summary>
+		public const string @Tag_M821="M821";
+			
+		/// <summary>寄存器:M822【M822】
+		/// <para>单位:</para> 
+		/// <para>缩放:1 类型: Default</para> 
+		/// <para>备注:B斜滚感应异常</para> 
+		/// </summary>
+		public const string @Tag_M822="M822";
+			
 		/// <summary>寄存器:M832【M832】
 		/// <para>单位:</para> 
 		/// <para>缩放:1 类型: Default</para> 

+ 7 - 0
SCADA_DAQ/Machines/SampleMachine_真封边机.cs

@@ -84,6 +84,13 @@ namespace SCADA_DAQ.Customer.Machines
 		/// <para>备注:</para> 
 		/// </summary>
 		public const string @Tag_D40="D40";
+			
+		/// <summary>寄存器:D640【D640】
+		/// <para>单位:</para> 
+		/// <para>缩放:1 类型: Default</para> 
+		/// <para>备注:压梁定位位置</para> 
+		/// </summary>
+		public const string @Tag_D640="D640";
 						
 	}
 }

+ 21 - 0
SCADA_DAQ/Machines/SortingDeliveryMachine_开料分拣输送.cs

@@ -1442,6 +1442,27 @@ namespace SCADA_DAQ.Customer.Machines
 		/// <para>备注:平移2低速</para> 
 		/// </summary>
 		public const string @Tag_2_TranslateLowSpeed="2#TranslateLowSpeed";
+			
+		/// <summary>寄存器:M632【PLCGetCode】
+		/// <para>单位:</para> 
+		/// <para>缩放:1 类型: Default</para> 
+		/// <para>备注:相机扫码输出</para> 
+		/// </summary>
+		public const string @Tag_PLCGetCode="PLCGetCode";
+			
+		/// <summary>寄存器:M80【AbnormalHadBoard】
+		/// <para>单位:</para> 
+		/// <para>缩放:1 类型: Default</para> 
+		/// <para>备注:异型滚筒上有板</para> 
+		/// </summary>
+		public const string @Tag_AbnormalHadBoard="AbnormalHadBoard";
+			
+		/// <summary>寄存器:M101【AbnormalTranslateMove】
+		/// <para>单位:</para> 
+		/// <para>缩放:1 类型: Default</para> 
+		/// <para>备注:异型滚筒平移板件</para> 
+		/// </summary>
+		public const string @Tag_AbnormalTranslateMove="AbnormalTranslateMove";
 						
 	}
 }