GEstione bypass emergenza x robotservice

This commit is contained in:
Samuele Locatelli
2021-09-30 14:45:42 +02:00
parent 08fcb1d098
commit c63e59b187
2 changed files with 21 additions and 0 deletions
+2
View File
@@ -59,6 +59,8 @@ ENABLE_DYN_DATA=TRUE
FORCE_DYN_DATA=TRUE
; gestione scrittura string/char[]: true = string / false = char[]
WRITE_PRE=TRUE
; gestione emergenza forzata (ignora valore letto, mette sempre ARMED)
EMERGENCY_BYPASS=true
; conf parametri memoria READ/WRITE
PARAM_CONF=1033.json
+19
View File
@@ -29,6 +29,7 @@ namespace IOB_WIN_NEXT
* B0.4 Bit Manuale
* B0.5 Bit MagOutPieno
* B0.6 Bit MagInVuoto
* B0.7 Bit EmergenzaArmata (0=triggered,premuta)
* Contapezzi DInt 2
* PezziRiman DInt 6
*
@@ -45,6 +46,12 @@ namespace IOB_WIN_NEXT
*
* -------------------------------------------------------------------------------- */
#region Protected Fields
protected bool EmergencyBypass = false;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -55,6 +62,12 @@ namespace IOB_WIN_NEXT
public IobSiemensRobotService(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
{
lgInfo("NEW IOB SIEMENS versione RobotService");
if (IOBConf.optPar.ContainsKey("EMERGENCY_BYPASS"))
{
bool.TryParse(IOBConf.optPar["EMERGENCY_BYPASS"], out EmergencyBypass);
lgInfo($"Override EmergencyBypass da conf: {IOBConf.optPar["EMERGENCY_BYPASS"]} --> {EmergencyBypass}");
}
}
#endregion Public Constructors
@@ -95,6 +108,12 @@ namespace IOB_WIN_NEXT
byteSignals &= ~(1 << 0);
}
// se bypass emergenza attivo --> forzo a ARMED...
if (EmergencyBypass)
{
byteSignals |= (1 << 7);
}
// salvo!
B_input = byteSignals;