Merge branch 'develop' of https://bitbucket.org/ncarminati/cms_core_library into develop
This commit is contained in:
@@ -1255,9 +1255,22 @@ namespace CMS_CORE_Library.S7Net
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
|
||||
// If PLC it's performing another request then return
|
||||
// se è true
|
||||
int n = 200;
|
||||
do
|
||||
{
|
||||
// Check Strobe
|
||||
libraryError = MEM_RWBoolean(R, fixEndian, 0, strobeCell.MemType, strobeCell.Address, strobeByte, alarmBitId, ref readValue);
|
||||
Thread.Sleep(20);
|
||||
n--;
|
||||
} while (n > 0 && readValue);
|
||||
|
||||
// If PLC is true --> reset
|
||||
if (readValue)
|
||||
return NO_ERROR;
|
||||
{
|
||||
bool forceVal =false;
|
||||
libraryError = MEM_RWBoolean(W, fixEndian, 0, strobeCell.MemType, strobeCell.Address, strobeByte, alarmBitId, ref forceVal);
|
||||
}
|
||||
|
||||
// Check ACK
|
||||
libraryError = MEM_RWBoolean(R, fixEndian, 0, ackCell.MemType, ackCell.Address, ackByte, alarmBitId, ref readValue);
|
||||
@@ -1341,7 +1354,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
|
||||
private CmsError ResetStrobe(int bitId, int strobeByte, int ackByte, MEMORY_TYPE memType, bool fixEndian)
|
||||
{
|
||||
int n = 600;
|
||||
int n = 200;
|
||||
bool readValue = false;
|
||||
bool writeValue = false;
|
||||
bool ok = false;
|
||||
@@ -1376,6 +1389,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
writeValue = false;
|
||||
// Reset strobe
|
||||
libraryError = MEM_RWBoolean(W, fixEndian, 0, memType, TABLE, strobeByte, bitId, ref writeValue);
|
||||
if (libraryError.IsError())
|
||||
@@ -4677,7 +4691,6 @@ namespace CMS_CORE_Library.S7Net
|
||||
|
||||
#endregion Subordinate Private Functions
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user