| | |
| | | } |
| | | else |
| | | { |
| | | var value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | object value; |
| | | //判断DBNumber不同 【Editby shaocx,2024-06-07】 |
| | | if (_dataCaptureConfig.DbNumber.ToUpper() == "M") |
| | | { |
| | | value = plcService.ReadValuePointV2(_dataCaptureConfig.DbNumber + _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | } |
| | | else |
| | | { |
| | | value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | } |
| | | |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}测量完成【{value_02}】【{value.ToString()}】【{_dataCaptureConfig.PLCIP}】【{_dataCaptureConfig.DbNumber}】【{_dataCaptureConfig.Offset}】[{_dataCaptureConfig.DataCapturePLCType}][{plcService.IsConnected.ToString()}]"); |
| | | if (value_02.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//当上一标记位0,当前获取标记为1时, |
| | |
| | | } |
| | | else if(WorkingProcedure.Equals("OP60")) |
| | | { |
| | | //增加OP60 质量信息读取校验 【Editby shaocx,2024-06-07】 |
| | | if (wplog.Op60_Place_Flag == false) continue; |
| | | |
| | | var time = DateTimeHelper.GetDateTime(); |
| | | if (fileFindTime == null) |
| | |
| | | {//取倒序匹配的文件名为工件号的文件 |
| | | if (file.Name.Contains("SP-" + DataCapturePointCode.Substring(DataCapturePointCode.Length - 1, 1))) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}下线完成读取到文件{file.Name},是指定的工件"); |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}下线完成读取到文件{file.Name},是指定的工件{wplog.WorkPieceID},上次获取尼伯丁文件里的时间值:{(op60QualityTime == null ? "" : op60QualityTime.ToString())}"); |
| | | |
| | | var datatable = CSVHelper.ReadCSVList(file.FullName); |
| | | if (datatable.Count < 106) |
| | |
| | | } |
| | | else if (WorkingProcedure.Equals("OP20")) |
| | | { |
| | | //记录公用变量,保存点位M88的信息 【Editby shaocx,2024-06-07】 |
| | | if (DataCapturePointCode.Contains("OP2002C")) |
| | | {//从OP2002C读取,因为顺序是 CBA,而不是ABC |
| | | string sideValue = GetSideForOP20(plcService); |
| | | SystemValue.OP20_Side_Value = sideValue; |
| | | } |
| | | wplog.MonitoringPoint += SystemValue.OP20_Side_Value; |
| | | wplog.CreatedUserName = wplog.MonitoringPoint; |
| | | |
| | | var time = DateTimeHelper.GetDateTime(); |
| | | if (fileFindTime == null) |
| | |
| | | {//取倒序匹配的文件名为工件号的文件 |
| | | if (file.Name.Contains("SP-" + DataCapturePointCode.Substring(DataCapturePointCode.Length - 1, 1))) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}下线完成读取到文件{file.Name},是指定的工件"); |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"{DataCapturePointCode}下线完成读取到文件{file.Name},是指定的工件{wplog.WorkPieceID},上次获取尼伯丁文件里的时间值:{(op60QualityTime == null ? "" : op60QualityTime.ToString())}"); |
| | | |
| | | var datatable = CSVHelper.ReadCSVList(file.FullName); |
| | | if (datatable.Count < 57) |
| | |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读{DataCapturePointCode}工序监控测量标记 不做校验,请确认是否配置异常"); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取OP20的哪个面 |
| | | /// </summary> |
| | | /// <param name="plcService"></param> |
| | | /// <returns></returns> |
| | | private string GetSideForOP20(PLCService plcService) |
| | | { |
| | | try |
| | | { |
| | | object value_M88 = plcService.ReadValuePointV2("M88", PLCManger.GetTypeForString("int")); |
| | | int i_value_M88 = 0; |
| | | var isRight = int.TryParse(value_M88.ToString(), out i_value_M88); |
| | | Log4NetHelper.WriteInfoLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读取 {DataCapturePointCode}工序监控测量标记数据时异常,获取OP20的哪个面,i_value_M88:{i_value_M88}"); |
| | | if (isRight) |
| | | { |
| | | if (i_value_M88 == 64) |
| | | { |
| | | return "1"; |
| | | } |
| | | else if (i_value_M88 == 256) |
| | | { |
| | | return "2"; |
| | | } |
| | | else if (i_value_M88 == 1024) |
| | | { |
| | | return "3"; |
| | | } |
| | | else if (i_value_M88 == 4096) |
| | | { |
| | | return "4"; |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Log4NetHelper.WriteErrorLog(PLCManger.GetLogTypeForWorkingProcedure(WorkingProcedure), $"读取 {DataCapturePointCode}工序监控测量标记数据时异常,获取OP20的哪个面,:", ex); |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | public WorkPieceLogMiddle GetCH4Info(string FullName, WorkPieceLogMiddle wplog) |
| | | { |
| | | try |