系统配置中删除BypassEnableTable项。

修改IoValue中对BypassEnableTable的调用,改为BypassInterlock。
This commit is contained in:
DESKTOP-GPE37UV\THINKAPD 2023-01-09 11:30:04 +08:00
parent ab3c600461
commit 3bb0321c52
2 changed files with 20 additions and 12 deletions

View File

@ -118,7 +118,7 @@ namespace Aitex.Core.RT.Device.Unit
R_TRIG _mutexSignalTrigger = new R_TRIG(); R_TRIG _mutexSignalTrigger = new R_TRIG();
DeviceTimer _timer = new DeviceTimer(); DeviceTimer _timer = new DeviceTimer();
DeviceTimer _mutexSignalTimer = new DeviceTimer(); DeviceTimer _mutexSignalTimer = new DeviceTimer();
private SCConfigItem _scBypassEnableTable; //private SCConfigItem _scBypassEnableTable;
private string _uniqueName; private string _uniqueName;
@ -140,7 +140,7 @@ namespace Aitex.Core.RT.Device.Unit
_doClose = ParseDoNode("doClose", node, ioModule); _doClose = ParseDoNode("doClose", node, ioModule);
_uniqueName = $"{Module}.{Name}"; _uniqueName = $"{Module}.{Name}";
_scBypassEnableTable = ParseScNode("BypassEnableTable", node, module, "System.BypassEnableTable"); //_scBypassEnableTable = ParseScNode("BypassEnableTable", node, module, "System.BypassEnableTable");
} }
public bool Initialize() public bool Initialize()
@ -283,16 +283,21 @@ namespace Aitex.Core.RT.Device.Unit
} }
//达到一定条件,强制打开阀门 //达到一定条件,强制打开阀门
if(FuncForceOpen!= null && !_scBypassEnableTable.BoolValue) if(FuncForceOpen!= null)
{
var scBypassEnableTable = SC.GetValue<bool>("System.BypassInterlock");
if (!scBypassEnableTable)
{ {
forceOpenTrigger.CLK = FuncForceOpen(Status); forceOpenTrigger.CLK = FuncForceOpen(Status);
if (forceOpenTrigger.Q) if (forceOpenTrigger.Q)
{ {
EV.PostMessage(Module, EventEnum.SwInterlock, Module, $"Force Set {Name} to {!Status} for Interlock enable table!"); EV.PostMessage(Module, EventEnum.SwInterlock, Module,
$"Force Set {Name} to {!Status} for Interlock enable table!");
SetPoint = !Status; SetPoint = !Status;
} }
} }
} }
}
catch (Exception ex) catch (Exception ex)
{ {
LOG.Write(ex); LOG.Write(ex);
@ -316,7 +321,10 @@ namespace Aitex.Core.RT.Device.Unit
return false; return false;
} }
if (FuncCheckInterLock != null && !_scBypassEnableTable.BoolValue) if (FuncCheckInterLock != null)
{
var scBypassEnableTable = SC.GetValue<bool>("System.BypassInterlock");
if (!scBypassEnableTable)
{ {
if (!FuncCheckInterLock(isOn)) if (!FuncCheckInterLock(isOn))
{ {
@ -325,6 +333,7 @@ namespace Aitex.Core.RT.Device.Unit
} }
} }
} }
}
if (_doClose != null) if (_doClose != null)
{ {
if (!_doClose.Check(!bValue, out reason)) if (!_doClose.Check(!bValue, out reason))

View File

@ -20,7 +20,6 @@
<config default="true" name="IsIgnoreSaveDB" description="IO不存储到数据库" max="" min="" paramter="" tag="" unit="" type="Bool" /> <config default="true" name="IsIgnoreSaveDB" description="IO不存储到数据库" max="" min="" paramter="" tag="" unit="" type="Bool" />
<config default="false" name="BypassInterlock" description="Bypass Interlock" max="" min="" paramter="" tag="" unit="" type="Bool" /> <config default="false" name="BypassInterlock" description="Bypass Interlock" max="" min="" paramter="" tag="" unit="" type="Bool" />
<config default="600" name="BypassInterlockTimeout" description="旁路互锁的超时时间,超过此时间后互锁自动恢复" max="3600" min="5" paramter="" tag="" unit="s" type="Integer" /> <config default="600" name="BypassInterlockTimeout" description="旁路互锁的超时时间,超过此时间后互锁自动恢复" max="3600" min="5" paramter="" tag="" unit="s" type="Integer" />
<config default="false" name="BypassEnableTable" description="Bypass EnableTable" max="" min="" paramter="" tag="" unit="" type="Bool" />
<config default="true" name="RecipeCascadeLoading" description="启用瀑布流方式加载Recipe" max="" min="" paramter="" tag="" unit="" type="Bool" /> <config default="true" name="RecipeCascadeLoading" description="启用瀑布流方式加载Recipe" max="" min="" paramter="" tag="" unit="" type="Bool" />
<config default="false" name="RecipeSaveToDB" description="Recipe文件保存到数据库" max="" min="" paramter="" tag="" unit="" type="Bool" /> <config default="false" name="RecipeSaveToDB" description="Recipe文件保存到数据库" max="" min="" paramter="" tag="" unit="" type="Bool" />
<config default="300" name="ModuleOfflineTimeout" description="模块离线超过该指定时间后产生警告" max="100000" min="0" paramter="" tag="" unit="s" type="Integer" /> <config default="300" name="ModuleOfflineTimeout" description="模块离线超过该指定时间后产生警告" max="100000" min="0" paramter="" tag="" unit="s" type="Integer" />