This commit is contained in:
parent
3df79378b7
commit
a4e9300e63
|
@ -126,6 +126,7 @@ namespace DM_Weight.Port
|
||||||
DrawerNo = 0;
|
DrawerNo = 0;
|
||||||
ColNos = new int[] { };
|
ColNos = new int[] { };
|
||||||
Stocks = new int[] { };
|
Stocks = new int[] { };
|
||||||
|
logger.Info($"重新设置串口数据状态结束");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void Start()
|
public async void Start()
|
||||||
|
@ -146,6 +147,7 @@ namespace DM_Weight.Port
|
||||||
if (r[4] != 0)
|
if (r[4] != 0)
|
||||||
{
|
{
|
||||||
logger.Info($"储物箱使能成功");
|
logger.Info($"储物箱使能成功");
|
||||||
|
Thread.Sleep(50);
|
||||||
// 查询锁状态
|
// 查询锁状态
|
||||||
GetBackDoorState();
|
GetBackDoorState();
|
||||||
}
|
}
|
||||||
|
@ -696,6 +698,18 @@ namespace DM_Weight.Port
|
||||||
while (_length != length && end.Subtract(start).TotalMilliseconds < timeout)
|
while (_length != length && end.Subtract(start).TotalMilliseconds < timeout)
|
||||||
{
|
{
|
||||||
_length = serialPort.BytesToRead;
|
_length = serialPort.BytesToRead;
|
||||||
|
if (_length == 0&& operation.Equals("开储物箱"))
|
||||||
|
{
|
||||||
|
|
||||||
|
_length = serialPort.BytesToRead;
|
||||||
|
if (_length == 0)
|
||||||
|
{
|
||||||
|
Thread.Sleep(500);
|
||||||
|
byte[] bufferWrite = new byte[] { 0xaa, (byte)(_doorAddr), 0x01, (byte)_storageBoxAddr, 0x00, 0x00, 0x00, 0xee };
|
||||||
|
canBusSerial.Write(bufferWrite, 0, 8);
|
||||||
|
logger.Info($"再次发送OpenStorage:{Convert.ToHexString(bufferWrite)};{end}");
|
||||||
|
}
|
||||||
|
}
|
||||||
end = DateTime.Now;
|
end = DateTime.Now;
|
||||||
}
|
}
|
||||||
if (_length != length)
|
if (_length != length)
|
||||||
|
@ -812,6 +826,8 @@ namespace DM_Weight.Port
|
||||||
canBusSerial.Write(buffer, 0, 8);
|
canBusSerial.Write(buffer, 0, 8);
|
||||||
logger.Info($"OpenStorage:{Convert.ToHexString(buffer)}");
|
logger.Info($"OpenStorage:{Convert.ToHexString(buffer)}");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return await GetBufferByPort(canBusSerial, 8, "开储物箱");
|
return await GetBufferByPort(canBusSerial, 8, "开储物箱");
|
||||||
}
|
}
|
||||||
// 关闭电控门储物箱(有灯失能)
|
// 关闭电控门储物箱(有灯失能)
|
||||||
|
|
Loading…
Reference in New Issue