More RFID comm. logging, 'Set active mode' executed also when wm.CommFailed == true, version 1.5.114.
This commit is contained in:
+23
-6
@@ -143,10 +143,21 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
retv = 0;
|
||||
}
|
||||
|
||||
rfidDataLogger.InfoFormat("{0}, ReadRequestPort({1}, {2}, {3}, ...) returned {4} {5}", wm.Name, messageID, offset, lenght, retv, (retv != 0) ? "!" : "");
|
||||
|
||||
buffer = new byte[lenght];
|
||||
for (int i = 0; i < lenght; i++) buffer[i] = buf[i];
|
||||
|
||||
if ((messageID == MessageID.Configuration) && (offset == 0) && (lenght == WaterMeters.iPerl.ConfigStruct.Length))
|
||||
{
|
||||
rfidDataLogger.InfoFormat("{0}, ReadRequestPort({1},...) returned {2} {3}", wm.Name, messageID, retv, (retv != 0) ? "!" : WaterMeters.iPerl.ConfigStruct.FromByteArray(buffer).ToString());
|
||||
}
|
||||
else if ((messageID == MessageID.Calibration) && (offset == 0) && (lenght == WaterMeters.iPerl.CalibrationStruct.Length))
|
||||
{
|
||||
rfidDataLogger.InfoFormat("{0}, ReadRequestPort({1},...) returned {2} {3}", wm.Name, messageID, retv, (retv != 0) ? "!" : WaterMeters.iPerl.CalibrationStruct.FromByteArray(buffer).ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
rfidDataLogger.InfoFormat("{0}, ReadRequestPort({1}, {2}, {3}, ...) returned {4} {5}", wm.Name, messageID, offset, lenght, retv, (retv != 0) ? "!" : "");
|
||||
}
|
||||
}
|
||||
|
||||
return retv;
|
||||
@@ -194,7 +205,15 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
}
|
||||
else if (lenght == 2)
|
||||
{
|
||||
rfidDataLogger.InfoFormat("{0}, WriteRequestPort({2}, {3}, {4}, {5} {6}) returned {1} {7}", wm.Name, retv, messageID, offset, lenght, pBuf[0].ToString("X2"), pBuf[1].ToString("X2"), (retv != 0) ? "!" : "");
|
||||
if (messageID == MessageID.Calibration && offset == 2)
|
||||
{
|
||||
UInt16 calibFactor = (UInt16)(pBuf[0] + 256 * pBuf[1]);
|
||||
rfidDataLogger.InfoFormat("{0}, WriteRequestPort(calibFactor={1}) returned {2} {3}", wm.Name, calibFactor, retv, (retv != 0) ? "!" : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
rfidDataLogger.InfoFormat("{0}, WriteRequestPort({2}, {3}, {4}, {5} {6}) returned {1} {7}", wm.Name, retv, messageID, offset, lenght, pBuf[0].ToString("X2"), pBuf[1].ToString("X2"), (retv != 0) ? "!" : "");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -775,8 +794,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
/// <returns>true on success</returns>
|
||||
static CommErr SetActiveMode(WaterMeters.iPerl.WaterMeter wm, ref string resultStr)
|
||||
{
|
||||
if (wm.CommFailed) return CommErr.CommFailed;
|
||||
|
||||
if (OpenPort(wm) != 0) return CommErr.OpenPort; /// Open RFID port
|
||||
|
||||
CommErr error = CommErr.CmdActive;
|
||||
@@ -863,7 +880,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
|
||||
CommErr error = CommErr.Write;
|
||||
|
||||
UInt16 newCalibFactor = 3000; /// Default value
|
||||
UInt16 newCalibFactor = 2600; /// Default value
|
||||
///
|
||||
if (multiTestParams[currentActivityStep].Activity.Length > WriteCalibrationFactorStr.Length)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user