Fix gesitone strobe x S7Net (era cablato su TABLE)
This commit is contained in:
@@ -764,7 +764,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
Thread.Sleep(50);
|
||||
|
||||
// Reset wait ack = 1 and reset the strobe
|
||||
libraryError = ResetAck(alarmBitId, strobeByte, ackByte, ackCell.MemType, fixEndian);
|
||||
libraryError = ResetAck(alarmBitId, strobeByte, ackByte, ackCell.MemType, ackCell.Address, fixEndian);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
|
||||
@@ -828,7 +828,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
return libraryError;
|
||||
|
||||
// Reset wait ack = 1 and reset the strobe
|
||||
libraryError = ResetStrobe(alarmBitId, strobeByte, ackByte, ackCell.MemType, fixEndian);
|
||||
libraryError = ResetStrobe(alarmBitId, strobeByte, ackByte, ackCell.MemType, ackCell.Address, fixEndian);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
|
||||
@@ -1314,7 +1314,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
}
|
||||
}
|
||||
|
||||
private CmsError ResetAck(int bitId, int strobeByte, int ackByte, MEMORY_TYPE memType, bool fixEndian)
|
||||
private CmsError ResetAck(int bitId, int strobeByte, int ackByte, MEMORY_TYPE memType, int address, bool fixEndian)
|
||||
{
|
||||
int n = 600;
|
||||
bool readValue = false;
|
||||
@@ -1328,7 +1328,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
do
|
||||
{
|
||||
// Check Strobe
|
||||
libraryError = MEM_RWBoolean(R, fixEndian, 0, memType, TABLE, strobeByte, bitId, ref readValue);
|
||||
libraryError = MEM_RWBoolean(R, fixEndian, 0, memType, address, strobeByte, bitId, ref readValue);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
|
||||
@@ -1336,7 +1336,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
if (readValue == false)
|
||||
{
|
||||
// Reset strobe
|
||||
libraryError = MEM_RWBoolean(W, fixEndian, 0, memType, TABLE, ackByte, bitId, ref writeValue);
|
||||
libraryError = MEM_RWBoolean(W, fixEndian, 0, memType, address, ackByte, bitId, ref writeValue);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
// Exit from cycle
|
||||
@@ -1356,7 +1356,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
{
|
||||
// Reset ack (forced)
|
||||
writeValue = false;
|
||||
libraryError = MEM_RWBoolean(W, fixEndian, 0, memType, TABLE, ackByte, bitId, ref writeValue);
|
||||
libraryError = MEM_RWBoolean(W, fixEndian, 0, memType, address, ackByte, bitId, ref writeValue);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
}
|
||||
@@ -1364,7 +1364,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
return libraryError;
|
||||
}
|
||||
|
||||
private CmsError ResetStrobe(int bitId, int strobeByte, int ackByte, MEMORY_TYPE memType, bool fixEndian)
|
||||
private CmsError ResetStrobe(int bitId, int strobeByte, int ackByte, MEMORY_TYPE memType, int address, bool fixEndian)
|
||||
{
|
||||
int n = 200;
|
||||
bool readValue = false;
|
||||
@@ -1375,7 +1375,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
do
|
||||
{
|
||||
// Check ACK
|
||||
libraryError = MEM_RWBoolean(R, fixEndian, 0, memType, TABLE, ackByte, bitId, ref readValue);
|
||||
libraryError = MEM_RWBoolean(R, fixEndian, 0, memType, address, ackByte, bitId, ref readValue);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
|
||||
@@ -1383,7 +1383,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
if (readValue == true)
|
||||
{
|
||||
// Reset strobe
|
||||
libraryError = MEM_RWBoolean(W, fixEndian, 0, memType, TABLE, strobeByte, bitId, ref writeValue);
|
||||
libraryError = MEM_RWBoolean(W, fixEndian, 0, memType, address, strobeByte, bitId, ref writeValue);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
// Exit from cycle
|
||||
@@ -1403,7 +1403,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
{
|
||||
writeValue = false;
|
||||
// Reset strobe
|
||||
libraryError = MEM_RWBoolean(W, fixEndian, 0, memType, TABLE, strobeByte, bitId, ref writeValue);
|
||||
libraryError = MEM_RWBoolean(W, fixEndian, 0, memType, address, strobeByte, bitId, ref writeValue);
|
||||
if (libraryError.IsError())
|
||||
return libraryError;
|
||||
}
|
||||
@@ -4648,7 +4648,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
}
|
||||
|
||||
// ...è permesso solo 0..7
|
||||
if (CommandBit >= 0 && CommandBit < 7)
|
||||
if (CommandBit >=1 && CommandBit < 8)
|
||||
{
|
||||
// posizione: è da array assi 0..n-1, 8byte ogni asse
|
||||
MEMORY_CELL currAxAck = new MEMORY_CELL(AXES_COMMAND.MemType, AXES_COMMAND.Address, AXES_COMMAND.SubAddress + ((AxisNum - 1) * 8), 2);
|
||||
|
||||
Reference in New Issue
Block a user