| | |
| | | //plcService.Close(); |
| | | //plcService.OpenService(); |
| | | } |
| | | string value_01 = ""; |
| | | string value_01 = "";//注意:默认是FALSE 【Editby shaocx,2024-09-05】 |
| | | while (true) |
| | | { |
| | | threadStatusMonitor.ErrorMsg = ""; |
| | |
| | | |
| | | object value = plcService.ReadValuePoint(_dataCaptureConfig.DbNumber, _dataCaptureConfig.Offset, PLCManger.GetTypeForString(_dataCaptureConfig.DataCaptureColumnType)); |
| | | WorkPieceLog wplog = null; |
| | | if (value.ToString().ToUpper().Equals("TRUE")) |
| | | |
| | | var value_bool = value.ToString().ToUpper().Equals("TRUE"); |
| | | if (value_bool) |
| | | { |
| | | wplog = new WorkPieceLog(); |
| | | wplog.Id = Yitter.IdGenerator.YitIdHelper.NextId(); |
| | |
| | | //监控上线 |
| | | MonitorHelper.MonitorTestForLine(_dataCaptureConfig, value, colConfig, wplog.WorkPieceID); |
| | | } |
| | | //if (wplog != null) |
| | | //{ |
| | | // var isRight = SystemBussinessHelper.ValidateIsRightWorkPieceID(wplog.WorkPieceID); |
| | | // if (isRight) |
| | | // { |
| | | #region 处理业务 |
| | | |
| | | if (value_01.ToUpper().Equals("FALSE") && value.ToString().ToUpper().Equals("TRUE")) |
| | | {//当上一标记位0,当前获取标记为1时, |
| | |
| | | } |
| | | value_01 = value.ToString(); |
| | | |
| | | #endregion |
| | | // } |
| | | //} |
| | | } |
| | | threadStatusMonitor.Remarks = $"abcdefg:{RandomHelper.GenerateRandomCode(4)}"; |
| | | if (!_dataCaptureConfig.DataCaptureFrequency.HasValue || _dataCaptureConfig.DataCaptureFrequency < 10) |
| | | { |
| | | threadStatusMonitor.ThreadFrequency = 1000; |
| | | Thread.Sleep(1000); |
| | | threadStatusMonitor.ThreadFrequency = 700; |
| | | Thread.Sleep(700); |
| | | } |
| | | else |
| | | { |