|
@@ -16,15 +16,15 @@ namespace ShakerService.OilSource
|
|
internal class OilSource
|
|
internal class OilSource
|
|
{
|
|
{
|
|
public event EventHandler<bool> StatusChanged;
|
|
public event EventHandler<bool> StatusChanged;
|
|
- private bool _IsEnabled = true;
|
|
|
|
|
|
|
|
- public bool IsEnabled => _IsEnabled;
|
|
|
|
|
|
+ public bool IsEnabled => OilSourceStatus.IsEnabled;
|
|
[AllowNull]
|
|
[AllowNull]
|
|
private IPLCConnect.IPLCConnect _PLCConnect;
|
|
private IPLCConnect.IPLCConnect _PLCConnect;
|
|
private static string PluginPath = System.AppDomain.CurrentDomain.BaseDirectory + "PLCConnect";
|
|
private static string PluginPath = System.AppDomain.CurrentDomain.BaseDirectory + "PLCConnect";
|
|
private OilSourceConfig oilSourceConfig = new OilSourceConfig();
|
|
private OilSourceConfig oilSourceConfig = new OilSourceConfig();
|
|
public OilSourceStatusModel OilSourceStatus { get; } = new OilSourceStatusModel();
|
|
public OilSourceStatusModel OilSourceStatus { get; } = new OilSourceStatusModel();
|
|
public static OilSource Default { get; } = new OilSource();
|
|
public static OilSource Default { get; } = new OilSource();
|
|
|
|
+ private object locker = new object();
|
|
/// <summary>
|
|
/// <summary>
|
|
/// PLC断开连接后定时重连PLC计时器
|
|
/// PLC断开连接后定时重连PLC计时器
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -75,26 +75,26 @@ namespace ShakerService.OilSource
|
|
{
|
|
{
|
|
OilSourceStatus.OilErrors.AddRange(Enumerable.Repeat(new ErrorInfoModel(), oilSourceConfig.ErrorAddress.Count));
|
|
OilSourceStatus.OilErrors.AddRange(Enumerable.Repeat(new ErrorInfoModel(), oilSourceConfig.ErrorAddress.Count));
|
|
}
|
|
}
|
|
- _IsEnabled = oilSourceConfig.IsEnabled;
|
|
|
|
- if (!_IsEnabled) return;
|
|
|
|
|
|
+ OilSourceStatus.IsEnabled = oilSourceConfig.IsEnabled;
|
|
|
|
+ if (!IsEnabled) return;
|
|
var plcs = Tools.PluginsLoader.Defalut.Load<IPLCConnect.IPLCConnect>(PluginPath);
|
|
var plcs = Tools.PluginsLoader.Defalut.Load<IPLCConnect.IPLCConnect>(PluginPath);
|
|
_PLCConnect = plcs.FirstOrDefault(x => x.Protocol == oilSourceConfig.Protocol);
|
|
_PLCConnect = plcs.FirstOrDefault(x => x.Protocol == oilSourceConfig.Protocol);
|
|
if (_PLCConnect == null)
|
|
if (_PLCConnect == null)
|
|
{
|
|
{
|
|
OilSourceStatus.IsEnabled = false;
|
|
OilSourceStatus.IsEnabled = false;
|
|
- _IsEnabled = false;
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
try
|
|
try
|
|
{
|
|
{
|
|
_PLCConnect.Init(oilSourceConfig.IP, oilSourceConfig.Port);
|
|
_PLCConnect.Init(oilSourceConfig.IP, oilSourceConfig.Port);
|
|
- _PLCConnect.Connect();
|
|
|
|
_PLCConnect.StatusChanged += PLCConnect_StatusChanged;
|
|
_PLCConnect.StatusChanged += PLCConnect_StatusChanged;
|
|
|
|
+ _PLCConnect.Connect();
|
|
}
|
|
}
|
|
catch
|
|
catch
|
|
{
|
|
{
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ OilSourceStatus.IsConnect = _PLCConnect.IsConnected;
|
|
if(!_PLCConnect.IsConnected)
|
|
if(!_PLCConnect.IsConnected)
|
|
{
|
|
{
|
|
RepeatConnectPLC();
|
|
RepeatConnectPLC();
|
|
@@ -112,7 +112,7 @@ namespace ShakerService.OilSource
|
|
_timer.Enabled = false;
|
|
_timer.Enabled = false;
|
|
_timer.AutoReset = true;
|
|
_timer.AutoReset = true;
|
|
_timer.Stop();
|
|
_timer.Stop();
|
|
- Communication.Instance.Context.GetEvent(nameof(OilSourceStatusModel.Circuit) + "_" + nameof(CircuitModel.Pressure)).Subscrip((sender, args) =>
|
|
|
|
|
|
+ Communication.Instance.Context.GetEvent(Topic.CircuitPressure).Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if(args.Data.Length>=2 && args.Data[0] is int index && args.Data[1] is float pressure)
|
|
if(args.Data.Length>=2 && args.Data[0] is int index && args.Data[1] is float pressure)
|
|
{
|
|
{
|
|
@@ -120,7 +120,7 @@ namespace ShakerService.OilSource
|
|
_PLCConnect?.Write(oilSourceConfig.MainPumpAddress[index].Address, pressure);
|
|
_PLCConnect?.Write(oilSourceConfig.MainPumpAddress[index].Address, pressure);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- Communication.Instance.Context.GetEvent(nameof(OilSourceStatusModel.Circuit) + "_Start").Subscrip((sender, args) =>
|
|
|
|
|
|
+ Communication.Instance.Context.GetEvent(Topic.CircuitStart).Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 2 && args.Data[0] is int index && args.Data[1] is bool state)
|
|
if (args.Data.Length >= 2 && args.Data[0] is int index && args.Data[1] is bool state)
|
|
{
|
|
{
|
|
@@ -135,7 +135,7 @@ namespace ShakerService.OilSource
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- Communication.Instance.Context.GetEvent(nameof(OilSourceStatusModel.Circuit) + "_Load").Subscrip((sender, args) =>
|
|
|
|
|
|
+ Communication.Instance.Context.GetEvent(Topic.CircuitLoad).Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 2 && args.Data[0] is int index && args.Data[1] is bool state)
|
|
if (args.Data.Length >= 2 && args.Data[0] is int index && args.Data[1] is bool state)
|
|
{
|
|
{
|
|
@@ -151,7 +151,7 @@ namespace ShakerService.OilSource
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- Communication.Instance.Context.GetEvent(nameof(OilSourceStatusModel.Forerunner) + "_" + nameof(CircuitModel.Pressure)).Subscrip((sender, args) =>
|
|
|
|
|
|
+ Communication.Instance.Context.GetEvent(Topic.ForerunnerPressure).Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is float pressure)
|
|
if (args.Data.Length >= 1 && args.Data[0] is float pressure)
|
|
{
|
|
{
|
|
@@ -159,7 +159,7 @@ namespace ShakerService.OilSource
|
|
_PLCConnect?.Write(oilSourceConfig.ForerunnerAddress.Address, pressure);
|
|
_PLCConnect?.Write(oilSourceConfig.ForerunnerAddress.Address, pressure);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- Communication.Instance.Context.GetEvent(nameof(OilSourceStatusModel.Forerunner) + "_Start").Subscrip((sender, args) =>
|
|
|
|
|
|
+ Communication.Instance.Context.GetEvent(Topic.ForerunnerStart).Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
@@ -174,7 +174,7 @@ namespace ShakerService.OilSource
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- Communication.Instance.Context.GetEvent(nameof(OilSourceStatusModel.Forerunner) + "_Load").Subscrip((sender, args) =>
|
|
|
|
|
|
+ Communication.Instance.Context.GetEvent(Topic.ForerunnerLoad).Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
@@ -190,7 +190,7 @@ namespace ShakerService.OilSource
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- Communication.Instance.Context.GetEvent(nameof(OilSourceStatusModel.Assistant) + "_" + nameof(CircuitModel.Pressure)).Subscrip((sender, args) =>
|
|
|
|
|
|
+ Communication.Instance.Context.GetEvent(Topic.AssistantPressure).Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is float pressure)
|
|
if (args.Data.Length >= 1 && args.Data[0] is float pressure)
|
|
{
|
|
{
|
|
@@ -198,7 +198,7 @@ namespace ShakerService.OilSource
|
|
_PLCConnect?.Write(oilSourceConfig.AssistantAddress.Address, pressure);
|
|
_PLCConnect?.Write(oilSourceConfig.AssistantAddress.Address, pressure);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- Communication.Instance.Context.GetEvent(nameof(OilSourceStatusModel.Assistant) + "_Start").Subscrip((sender, args) =>
|
|
|
|
|
|
+ Communication.Instance.Context.GetEvent(Topic.AssistantStart).Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
@@ -213,7 +213,7 @@ namespace ShakerService.OilSource
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- Communication.Instance.Context.GetEvent(nameof(OilSourceStatusModel.Assistant) + "_Load").Subscrip((sender, args) =>
|
|
|
|
|
|
+ Communication.Instance.Context.GetEvent(Topic.AssistantLoad).Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
@@ -229,7 +229,7 @@ namespace ShakerService.OilSource
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- Communication.Instance.Context.GetEvent(nameof(OilSourceStatusModel.Circulate) + "_" + nameof(CircuitModel.Pressure)).Subscrip((sender, args) =>
|
|
|
|
|
|
+ Communication.Instance.Context.GetEvent(Topic.CirculatePressure).Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is float pressure)
|
|
if (args.Data.Length >= 1 && args.Data[0] is float pressure)
|
|
{
|
|
{
|
|
@@ -237,7 +237,7 @@ namespace ShakerService.OilSource
|
|
_PLCConnect?.Write(oilSourceConfig.CirculateAddress.Address, pressure);
|
|
_PLCConnect?.Write(oilSourceConfig.CirculateAddress.Address, pressure);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- Communication.Instance.Context.GetEvent(nameof(OilSourceStatusModel.Circulate) + "_Start").Subscrip((sender, args) =>
|
|
|
|
|
|
+ Communication.Instance.Context.GetEvent(Topic.CirculateStart).Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
@@ -252,7 +252,7 @@ namespace ShakerService.OilSource
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- Communication.Instance.Context.GetEvent(nameof(OilSourceStatusModel.Circulate) + "_Load").Subscrip((sender, args) =>
|
|
|
|
|
|
+ Communication.Instance.Context.GetEvent(Topic.CirculateLoad).Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
@@ -268,7 +268,7 @@ namespace ShakerService.OilSource
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- Communication.Instance.Context.GetEvent("EmergencyStop").Subscrip((sender, args) =>
|
|
|
|
|
|
+ Communication.Instance.Context.GetEvent(Topic.OilEmergencyStop).Subscrip((sender, args) =>
|
|
{
|
|
{
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
if (args.Data.Length >= 1 && args.Data[0] is bool state)
|
|
{
|
|
{
|
|
@@ -292,8 +292,11 @@ namespace ShakerService.OilSource
|
|
Ping ping = new Ping();
|
|
Ping ping = new Ping();
|
|
if(ping.Send(oilSourceConfig.IP).Status == IPStatus.Success)
|
|
if(ping.Send(oilSourceConfig.IP).Status == IPStatus.Success)
|
|
{
|
|
{
|
|
- _PLCConnect.Init(oilSourceConfig.IP, oilSourceConfig.Port);
|
|
|
|
- _PLCConnect.Connect();
|
|
|
|
|
|
+ //_PLCConnect.Init(oilSourceConfig.IP, oilSourceConfig.Port);
|
|
|
|
+ lock (locker)
|
|
|
|
+ {
|
|
|
|
+ _PLCConnect.Connect();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch
|
|
catch
|
|
@@ -318,61 +321,65 @@ namespace ShakerService.OilSource
|
|
public bool IsConnected => _PLCConnect == null ? false : _PLCConnect.IsConnected;
|
|
public bool IsConnected => _PLCConnect == null ? false : _PLCConnect.IsConnected;
|
|
public void Connect()
|
|
public void Connect()
|
|
{
|
|
{
|
|
- if (!_IsEnabled) return;
|
|
|
|
|
|
+ if (!IsEnabled) return;
|
|
_PLCConnect?.Connect();
|
|
_PLCConnect?.Connect();
|
|
}
|
|
}
|
|
public void Disconnect()
|
|
public void Disconnect()
|
|
{
|
|
{
|
|
- if (!_IsEnabled) return;
|
|
|
|
|
|
+ if (!IsEnabled) return;
|
|
_PLCConnect?.DisConnect();
|
|
_PLCConnect?.DisConnect();
|
|
}
|
|
}
|
|
private void PLCConnect_StatusChanged(object? sender, bool e)
|
|
private void PLCConnect_StatusChanged(object? sender, bool e)
|
|
{
|
|
{
|
|
- _IsEnabled = e;
|
|
|
|
|
|
+ OilSourceStatus.IsConnect = e;
|
|
StatusChanged?.Invoke(this, e);
|
|
StatusChanged?.Invoke(this, e);
|
|
|
|
+ Log.Default.Debug("油源状态改变:" + e);
|
|
if(e)
|
|
if(e)
|
|
{
|
|
{
|
|
_timer.Stop();
|
|
_timer.Stop();
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- ReadOilSourceData();
|
|
|
|
|
|
+ RepeatConnectPLC();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public void ReadOilSourceData()
|
|
public void ReadOilSourceData()
|
|
{
|
|
{
|
|
- if(!_IsEnabled || _PLCConnect ==null)
|
|
|
|
|
|
+ lock (locker)
|
|
{
|
|
{
|
|
- OilSourceStatus.IsEnabled = false;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- for(int i=0;i<OilSourceStatus.Circuit.Count;i++)
|
|
|
|
- {
|
|
|
|
- OilSourceStatus.Circuit[i].IsStart = _PLCConnect.ReadBit(oilSourceConfig.MainPumpAddress[i].IsStartAddress, oilSourceConfig.MainPumpAddress[i].IsStartBitIndex);
|
|
|
|
- //OilSourceStatus.Circuit[i].Pressure = _PLCConnect.Read<float>(oilSourceConfig.MainPumpAddress[i].Address);
|
|
|
|
- OilSourceStatus.Circuit[i].IsLoadPressure = _PLCConnect.ReadBit(oilSourceConfig.MainPumpAddress[i].IsLoadAddress, oilSourceConfig.MainPumpAddress[i].IsLoadBitIndex);
|
|
|
|
- }
|
|
|
|
|
|
+ if (!IsEnabled || _PLCConnect == null || !_PLCConnect.IsConnected)
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ for (int i = 0; i < OilSourceStatus.Circuit.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ OilSourceStatus.Circuit[i].IsStart = _PLCConnect.ReadBit(oilSourceConfig.MainPumpAddress[i].IsStartAddress, oilSourceConfig.MainPumpAddress[i].IsStartBitIndex);
|
|
|
|
+ //OilSourceStatus.Circuit[i].Pressure = _PLCConnect.Read<float>(oilSourceConfig.MainPumpAddress[i].Address);
|
|
|
|
+ OilSourceStatus.Circuit[i].IsLoadPressure = _PLCConnect.ReadBit(oilSourceConfig.MainPumpAddress[i].IsLoadAddress, oilSourceConfig.MainPumpAddress[i].IsLoadBitIndex);
|
|
|
|
+ }
|
|
|
|
|
|
- OilSourceStatus.Circulate.IsLoadPressure = _PLCConnect.ReadBit(oilSourceConfig.CirculateAddress.IsLoadAddress, oilSourceConfig.CirculateAddress.IsLoadBitIndex);
|
|
|
|
|
|
+ OilSourceStatus.Circulate.IsLoadPressure = _PLCConnect.ReadBit(oilSourceConfig.CirculateAddress.IsLoadAddress, oilSourceConfig.CirculateAddress.IsLoadBitIndex);
|
|
|
|
|
|
- OilSourceStatus.Circulate.IsStart = _PLCConnect.ReadBit(oilSourceConfig.CirculateAddress.IsStartAddress, oilSourceConfig.CirculateAddress.IsStartBitIndex);
|
|
|
|
-
|
|
|
|
|
|
+ OilSourceStatus.Circulate.IsStart = _PLCConnect.ReadBit(oilSourceConfig.CirculateAddress.IsStartAddress, oilSourceConfig.CirculateAddress.IsStartBitIndex);
|
|
|
|
|
|
- OilSourceStatus.Forerunner.IsStart = _PLCConnect.ReadBit(oilSourceConfig.ForerunnerAddress.IsStartAddress, oilSourceConfig.ForerunnerAddress.IsStartBitIndex);
|
|
|
|
- OilSourceStatus.Forerunner.IsLoadPressure = _PLCConnect.ReadBit(oilSourceConfig.ForerunnerAddress.IsLoadAddress, oilSourceConfig.ForerunnerAddress.IsLoadBitIndex);
|
|
|
|
- for(int i=0;i<OilSourceStatus.OilErrors.Count;i++)
|
|
|
|
- {
|
|
|
|
- OilSourceStatus.OilErrors[i].Status = _PLCConnect.ReadBit(oilSourceConfig.ErrorAddress[i].Address, oilSourceConfig.ErrorAddress[i].BitIndex);
|
|
|
|
- }
|
|
|
|
- OilSourceStatus.IsRemote = _PLCConnect.ReadBit(oilSourceConfig.IsRemoteAddress.Address, oilSourceConfig.IsRemoteAddress.BitIndex);
|
|
|
|
- for(int i=0;i<OilSourceStatus.OilSourceAnalogs.Count;i++)
|
|
|
|
- {
|
|
|
|
- OilSourceStatus.OilSourceAnalogs[i].Value = _PLCConnect.Read<float>(oilSourceConfig.AnalogAddress[i].ValueAddress);
|
|
|
|
- OilSourceStatus.OilSourceAnalogs[i].IsLowerError = _PLCConnect.ReadBit(oilSourceConfig.AnalogAddress[i].LowerErrorAddress, oilSourceConfig.AnalogAddress[i].LowerErrorBitIndex);
|
|
|
|
- OilSourceStatus.OilSourceAnalogs[i].IsLowerWarn = _PLCConnect.ReadBit(oilSourceConfig.AnalogAddress[i].LowerWarnAddress, oilSourceConfig.AnalogAddress[i].LowerWarnBitIndex);
|
|
|
|
- OilSourceStatus.OilSourceAnalogs[i].IsUpperError = _PLCConnect.ReadBit(oilSourceConfig.AnalogAddress[i].UpperErrorAddress, oilSourceConfig.AnalogAddress[i].UpperErrorBitIndex);
|
|
|
|
- OilSourceStatus.OilSourceAnalogs[i].IsUpperWarn = _PLCConnect.ReadBit(oilSourceConfig.AnalogAddress[i].UpperWarnAddress, oilSourceConfig.AnalogAddress[i].UpperWarnBitIndex);
|
|
|
|
|
|
+
|
|
|
|
+ OilSourceStatus.Forerunner.IsStart = _PLCConnect.ReadBit(oilSourceConfig.ForerunnerAddress.IsStartAddress, oilSourceConfig.ForerunnerAddress.IsStartBitIndex);
|
|
|
|
+ OilSourceStatus.Forerunner.IsLoadPressure = _PLCConnect.ReadBit(oilSourceConfig.ForerunnerAddress.IsLoadAddress, oilSourceConfig.ForerunnerAddress.IsLoadBitIndex);
|
|
|
|
+ for (int i = 0; i < OilSourceStatus.OilErrors.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ OilSourceStatus.OilErrors[i].Status = _PLCConnect.ReadBit(oilSourceConfig.ErrorAddress[i].Address, oilSourceConfig.ErrorAddress[i].BitIndex);
|
|
|
|
+ }
|
|
|
|
+ OilSourceStatus.IsRemote = _PLCConnect.ReadBit(oilSourceConfig.IsRemoteAddress.Address, oilSourceConfig.IsRemoteAddress.BitIndex);
|
|
|
|
+ for (int i = 0; i < OilSourceStatus.OilSourceAnalogs.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ OilSourceStatus.OilSourceAnalogs[i].Value = _PLCConnect.Read<float>(oilSourceConfig.AnalogAddress[i].ValueAddress);
|
|
|
|
+ OilSourceStatus.OilSourceAnalogs[i].IsLowerError = _PLCConnect.ReadBit(oilSourceConfig.AnalogAddress[i].LowerErrorAddress, oilSourceConfig.AnalogAddress[i].LowerErrorBitIndex);
|
|
|
|
+ OilSourceStatus.OilSourceAnalogs[i].IsLowerWarn = _PLCConnect.ReadBit(oilSourceConfig.AnalogAddress[i].LowerWarnAddress, oilSourceConfig.AnalogAddress[i].LowerWarnBitIndex);
|
|
|
|
+ OilSourceStatus.OilSourceAnalogs[i].IsUpperError = _PLCConnect.ReadBit(oilSourceConfig.AnalogAddress[i].UpperErrorAddress, oilSourceConfig.AnalogAddress[i].UpperErrorBitIndex);
|
|
|
|
+ OilSourceStatus.OilSourceAnalogs[i].IsUpperWarn = _PLCConnect.ReadBit(oilSourceConfig.AnalogAddress[i].UpperWarnAddress, oilSourceConfig.AnalogAddress[i].UpperWarnBitIndex);
|
|
|
|
+ }
|
|
|
|
+ Communication.Instance.Context.GetEvent<OilSourceStatusModel>().Publish(this, OilSourceStatus);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
static OilSource()
|
|
static OilSource()
|