| | |
| | | public static bool boDemo = false; |
| | | //滚筒反转 |
| | | public static bool boDrumReversal = false; |
| | | //出库锁定 |
| | | public static bool boOutLock = false; |
| | | //入库锁定 |
| | | public static bool boEnterLock = false; |
| | | |
| | | public static List<PlcPositionInfo> listPositionInfo = new List<PlcPositionInfo>(); |
| | | |
| | |
| | | boRefresh = _sysConfigService.GetConfigValue<bool>("sys_Refresh").Result; |
| | | boDemo = _sysConfigService.GetConfigValue<bool>("sys_demo").Result; |
| | | boDrumReversal = _sysConfigService.GetConfigValue<bool>("sys_DrumReversal").Result; |
| | | boOutLock = _sysConfigService.GetConfigValue<bool>("sys_BoOutLock").Result; |
| | | boEnterLock = _sysConfigService.GetConfigValue<bool>("sys_BoEnterLock").Result; |
| | | } |
| | | /// <summary> |
| | | /// 初始化PLC连接 |
| | |
| | | { |
| | | //Console.WriteLine($"{modPlc.IP}读取{modDevice.DbNumber}.{modDevice.PlcPos}的值为:{value}"); |
| | | //无流程跳出 |
| | | if (value == 0) |
| | | if (value == 0 )// && modPlc.Type!= PLCTypeEnum.BoxConveyorLine |
| | | continue; |
| | | var dto = modDevice.Adapt<WcsDeviceDto>(); |
| | | dto.Value = value; |
| | |
| | | if (modPlcUtil == null) |
| | | continue; |
| | | var plcIp = modPlcUtil.PlcIP; |
| | | var listDevice = listPlcDevice.Where(s => s.PlcId == modPlcUtil.PlcId ).ToList(); //&& s.DeviceType == DeviceTypeEnum.Show |
| | | var listDevice = listPlcDevice.Where(s => s.PlcId == modPlcUtil.PlcId && s.DeviceType == DeviceTypeEnum.Show).ToList(); |
| | | var modPlc = listPlc.FirstOrDefault(s => s.Id == modPlcUtil.PlcId); |
| | | var listaddress = new Dictionary<string, PLCDataTypeEnum>(); |
| | | foreach (var modDevice in listDevice) |
| | |
| | | { |
| | | var bl = false; |
| | | int value = Convert.ToInt32(item.Value); |
| | | if (value == 0 || value == 720) |
| | | if (value == 0) |
| | | { |
| | | bl = false; |
| | | } |
| | |
| | | { |
| | | bl = true; |
| | | } |
| | | |
| | | var modInfo = new PlcPositionInfo() { Type = modPlc.Type, StationNum = modDevice.StationNum.PadLeft(3, '0'), BoHaveItem = bl }; |
| | | HubUtil.PublicPosition(modInfo); |
| | | UpdatePosition(modInfo); |
| | | |
| | | if (bl != modDevice.BoHaveItem) |
| | | { |
| | | var modInfo = new PlcPositionInfo() { Type = modPlc.Type, StationNum = modDevice.StationNum.PadLeft(3, '0'), BoHaveItem = bl }; |
| | | HubUtil.PublicPosition(modInfo); |
| | | UpdatePosition(modInfo); |
| | | } |
| | | // liudl 注释:和电气工程师确认页面展示交互字后启用。 |
| | | //var value = Convert.ToBoolean(item.Value); |
| | | //if (!value == modDevice.BoHaveItem) |