Fix reset counters

This commit is contained in:
Nicola Carminati
2019-04-04 08:38:40 +00:00
parent 16cf7e21f8
commit 49ba5b0ce3
3 changed files with 12 additions and 6 deletions
+4 -2
View File
@@ -892,9 +892,11 @@ namespace CMS_CORE_Library.Fanuc
bool bitValue = true;
int nTry = 0;
for (int i = 0; i < 4; i++)
for (int i = 0; i <= 4; i++)
{
//Scrivo il bit
bitValue = true;
nTry = 0;
cmsError = MEM_RWBoolean(W, 0, MACHINE_RESET_WORKED_TIME.MemType, MACHINE_RESET_WORKED_TIME.Address, 0, ref bitValue);
if (cmsError.IsError())
return cmsError;
@@ -908,7 +910,7 @@ namespace CMS_CORE_Library.Fanuc
if (cmsError.IsError())
return cmsError;
} while (!bitValue || nTry > 10);
} while (bitValue && nTry <= 10);
//se il valore è rimasto a 1 il plc non l'ha preso in carico, e abortisco
if (bitValue)
+4 -2
View File
@@ -861,9 +861,11 @@ namespace CMS_CORE_Library.Osai
bool bitValue = true;
int nTry = 0;
for (int i = 0; i<4; i++)
for (int i = 0; i<=4; i++)
{
//Scrivo il bit
bitValue = true;
nTry = 0;
cmsError = MEM_RWBoolean(W, 0, MACHINE_RESET_WORKED_TIME.MemType, MACHINE_RESET_WORKED_TIME.Address,0, ref bitValue);
if (cmsError.IsError())
return cmsError;
@@ -877,7 +879,7 @@ namespace CMS_CORE_Library.Osai
if (cmsError.IsError())
return cmsError;
} while (!bitValue || nTry > 10);
} while (bitValue && nTry <= 10);
//se il valore è rimasto a 1 il plc non l'ha preso in carico, e abortisco
if (bitValue)
+4 -2
View File
@@ -1094,9 +1094,11 @@ namespace CMS_CORE_Library.Siemens
bool bitValue = true;
int nTry = 0;
for (int i = 0; i < 4; i++)
for (int i = 0; i <= 4; i++)
{
//Scrivo il bit
bitValue = true;
nTry = 0;
cmsError = MEM_RWBoolean(W, 0, MACHINE_RESET_WORKED_TIME.MemType, MACHINE_RESET_WORKED_TIME.Address, MACHINE_RESET_WORKED_TIME.SubAddress, 0, ref bitValue);
if (cmsError.IsError())
return cmsError;
@@ -1110,7 +1112,7 @@ namespace CMS_CORE_Library.Siemens
if (cmsError.IsError())
return cmsError;
} while (!bitValue || nTry > 10);
} while (bitValue && nTry <= 10);
//se il valore è rimasto a 1 il plc non l'ha preso in carico, e abortisco
if (bitValue)