1. 数据库脚本添加启动大复位报警提示
2. 开放上传数据时间限制
3. 添加软件报警输出配置,目前提供连续NG报警和启动时大复位报警
| | |
| | | private SqlConnection connForUpload; |
| | | private string _standardCheckMode; |
| | | |
| | | int enableUploadMinutes = 10; |
| | | private static readonly object synObj = new object(); |
| | | public DetectionData() |
| | | { |
| | |
| | | catch (Exception) |
| | | { |
| | | CommonUtil.WriteLog(LogType.Err, "DataUploadè¿æ¥æ°æ®åºå¤±è´¥ï¼"); |
| | | } |
| | | |
| | | string enableUploadMinutesStr = ConfigurationManager.AppSettings["EnableUploadMinutes"]; |
| | | |
| | | int temp = 0; |
| | | if (int.TryParse(enableUploadMinutesStr, out temp)) |
| | | { |
| | | enableUploadMinutes = temp; |
| | | } |
| | | else |
| | | { |
| | | enableUploadMinutes = 10; |
| | | } |
| | | } |
| | | |
| | |
| | | AND ProductNoStatus = 'OK' |
| | | AND ProductStatus<>'NA' |
| | | AND (ISNULL(CarrierBarcode,'')<>'' OR ProductStatus = 'NG') |
| | | AND DATEDIFF(DAY,'{0}',DetectTime)>=-1 |
| | | ORDER BY DetectTime DESC", DateTime.Now.ToString("yyyy-MM-dd")); |
| | | AND DATEDIFF(MINUTE,DetectTime,'{0}')<={1} |
| | | ORDER BY DetectTime DESC", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), enableUploadMinutes.ToString()); |
| | | |
| | | SqlDataReader dr = null; |
| | | using (SqlCommand cmd = new SqlCommand(sql, connForUpload)) |
| | |
| | | insert into WarningConfigure |
| | | (Val,Type,Content,Solution) |
| | | values(2000,1,N'产åè¿ç»NGè¶
è¿è®¾å®æ¬¡æ°æ¥è¦',N'è¯·éæ¥ç¸å
³äººåï¼è®¾å¤å¤ä½å³å¯ç»§ç»') |
| | | |
| | | insert into WarningConfigure |
| | | (Val,Type,Content,Solution) |
| | | values(250,1,N'软件å¯å¨å¤§å¤ä½',N'请æ§è¡å¤§å¤ä½å¨ä½') |
| | |
| | | opc.Write(OPCOutputTag.DetectResult_NG, false); |
| | | CommonUtil.WriteLog(LogType.Inf, "åå§å䏿NA"); |
| | | |
| | | //250表示å¯å¨æ¶éè¦å¤§å¤ä½æ¥è¦ |
| | | opc.Write(OPCOutputTag.Alarm, 250); |
| | | CommonUtil.WriteLog(LogType.Inf, "软件å¯å¨å¤§å¤ä½"); |
| | | |
| | | string continuousNGStr = ConfigurationManager.AppSettings["ContinuousNGThreshold"]; |
| | | if (int.TryParse(continuousNGStr, out int temp)) |
| | | { |
| | |
| | | opc.Write(OPCOutputTag.DetectResult_OK, true); |
| | | opc.Write(OPCOutputTag.DetectResult_NG, false); |
| | | |
| | | CommonUtil.WriteLog(LogType.Inf, $"{x.DetectID}|{x.ProductNo}产ååºæ¾å
¥OK Tray"); |
| | | CommonUtil.WriteLog(LogType.Inf, $"{x?.DetectID}|{x?.ProductNo}产ååºæ¾å
¥OK Tray"); |
| | | |
| | | _continuousNG = 0; |
| | | break; |
| | |
| | | opc.Write(OPCOutputTag.DetectResult_OK, false); |
| | | opc.Write(OPCOutputTag.DetectResult_NG, true); |
| | | |
| | | CommonUtil.WriteLog(LogType.Inf, $"{x.DetectID}|{x.ProductNo}产ååºæ¾å
¥NG Tray"); |
| | | CommonUtil.WriteLog(LogType.Inf, $"{x?.DetectID}|{x?.ProductNo}产ååºæ¾å
¥NG Tray"); |
| | | CommonUtil.StepControl.RemoveById(detectID); |
| | | |
| | | _continuousNG++; |
| | |
| | | opc.Write(OPCOutputTag.DetectResult_OK, false); |
| | | opc.Write(OPCOutputTag.DetectResult_NG, false); |
| | | |
| | | CommonUtil.WriteLog(LogType.Inf, $"{x.DetectID}|{x.ProductNo}产ååºæ¾å
¥NA Tray"); |
| | | CommonUtil.WriteLog(LogType.Inf, $"{x?.DetectID}|{x?.ProductNo}产ååºæ¾å
¥NA Tray"); |
| | | CommonUtil.StepControl.RemoveById(detectID); |
| | | |
| | | _continuousNG = 0; |
| | |
| | | if (_continuousNG >= _continuousNGThreshold) |
| | | { |
| | | //èæ¬ä¸è®¾ç½®æ¥è¦ç 2000表示è¿ç»NG次æ°å°è¾¾è®¾å®æ¥è¦ä¸é |
| | | opc.Write(OPCInputTag.Alarm, 2000); |
| | | opc.Write(OPCOutputTag.Alarm, 2000); |
| | | |
| | | CommonUtil.WriteLog(LogType.Inf, $"产åè¿ç»NG{_continuousNG}æ¬¡ï¼æ¥è¦æç¤º"); |
| | | _continuousNG = 0; |
| | |
| | | /// æ¯å¦æ¯æ½æ£ |
| | | /// </summary> |
| | | public const string SpotCheck = "M423.Box.Output.SpotCheck"; |
| | | |
| | | public const string Alarm = "M423.Box.Output.Alarm"; |
| | | } |
| | | #endregion |
| | | } |
| | |
| | | <!--çµæ± æå¤§å°ºå¯¸ä¸é --> |
| | | <add key="MaxCellLength" value="10"/> |
| | | <add key="MaxCellWidth" value="10"/> |
| | | <!--çµæ± æå°å°ºå¯¸ä¸wqé --> |
| | | <!--çµæ± æå°å°ºå¯¸ä¸é --> |
| | | <add key="MinCellLength" value="0"/> |
| | | <add key="MinCellWidth" value="0"/> |
| | | <!--é«åº¦å·®è®¡ç®--> |
| | |
| | | <add key="ErrorBand" value="2.0"/> |
| | | |
| | | <add key="ContiousNGThreshold" value="3"/> |
| | | <add key="EnableUploadMinutes" value="10"/> |
| | | </appSettings> |
| | | <startup> |
| | | <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> |