Commit 44258610 几米阳光

报警时只红灯闪烁。出库时需要等待门口无料盘

1 个父辈 a213ccc2
...@@ -28,6 +28,12 @@ ...@@ -28,6 +28,12 @@
20190108
报警时只需要红灯闪烁。
出库时修改:出料口有料时,出料仍继续。
......
...@@ -424,7 +424,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -424,7 +424,7 @@ namespace OnlineStore.DeviceLibrary
{ {
if (socketClient == null) if (socketClient == null)
{ {
LOGGER.Error("发送数据时发现socketClient=null"); LOGGER.Error("AITcpClient发送数据时发现socketClient=null");
return; return;
} }
IPEndPoint clientipe = (IPEndPoint)socketClient.RemoteEndPoint; IPEndPoint clientipe = (IPEndPoint)socketClient.RemoteEndPoint;
......
...@@ -72,7 +72,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -72,7 +72,7 @@ namespace OnlineStore.DeviceLibrary
WriteAIScope(ioIp, 1); WriteAIScope(ioIp, 1);
Thread.Sleep(10); Thread.Sleep(10);
ReadAll(ioIp); ReadAll(ioIp);
LogUtil.info(LOGGER, "连接AI模块[" + ioIp + "]"); LogUtil.info(LOGGER, "连接AI模块[" + ioIp + "]成功");
} }
catch (Exception error) catch (Exception error)
{ {
......
...@@ -77,7 +77,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -77,7 +77,7 @@ namespace OnlineStore.DeviceLibrary
mastMap.Add(ioIp, MBmaster); mastMap.Add(ioIp, MBmaster);
Thread.Sleep(10); Thread.Sleep(10);
LogUtil.info("连接IO模块[" + ioIp + "]成功");
//读取所有的DO //读取所有的DO
ReadMultipleDO(ioIp, DefualtSlaveID, DoStartAddress, DefualtLength); ReadMultipleDO(ioIp, DefualtSlaveID, DoStartAddress, DefualtLength);
} }
...@@ -123,8 +123,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -123,8 +123,8 @@ namespace OnlineStore.DeviceLibrary
if (!clinet.ISConnection()) if (!clinet.ISConnection())
{ {
ushort port = 502; ushort port = 502;
//ConnectionIP(io, port);
LogUtil.error(LOGGER, io + "当前没有连上,重连" + io); LogUtil.error(LOGGER, io + "当前没有连上,重连" + io);
ConnectionIP(io, port);
} }
} }
} }
...@@ -229,14 +229,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -229,14 +229,22 @@ namespace OnlineStore.DeviceLibrary
if (mastMap.ContainsKey(ioIp)) if (mastMap.ContainsKey(ioIp))
{ {
MBmaster = mastMap[ioIp]; MBmaster = mastMap[ioIp];
MBmaster.WriteSingleCoils(ID, StartAddress, onOff, slaveId); bool result = MBmaster.WriteSingleCoils(ID, StartAddress, onOff, slaveId);
if (!result)
{
LogUtil.error(LOGGER, "WriteSingleDO[" + ioIp + "][" + slaveId + "][" + StartAddress + "]失败,尝试重新写一次");
result = MBmaster.WriteSingleCoils(ID, StartAddress, onOff, slaveId);
}
if (!result)
{
LogUtil.error(LOGGER, "WriteSingleDO[" + ioIp + "][" + slaveId + "][" + StartAddress + "]失败,重新尝试仍失败");
}
KNDIO io = new KNDIO(ioIp, slaveId, StartAddress, onOff); KNDIO io = new KNDIO(ioIp, slaveId, StartAddress, onOff);
SaveDOValue(io, ioIp); SaveDOValue(io, ioIp);
} }
else else
{ {
LogUtil.error(LOGGER, "ReadSingleDO出错没有连接IO模块:" + ioIp); LogUtil.error(LOGGER, "WriteSingleDO[" + ioIp + "][" + slaveId + "][" + StartAddress + "]出错没有连接IO模块:" + ioIp);
} }
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -379,14 +379,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -379,14 +379,14 @@ namespace OnlineStore.DeviceLibrary
{ {
WriteAsyncData(CreateReadHeader(id, startAddress, numInputs, fctReadInputRegister, SlaveID), id); WriteAsyncData(CreateReadHeader(id, startAddress, numInputs, fctReadInputRegister, SlaveID), id);
} }
public void WriteSingleCoils(ushort id, ushort startAddress, IO_VALUE ioValue, byte SlaveID) public bool WriteSingleCoils(ushort id, ushort startAddress, IO_VALUE ioValue, byte SlaveID)
{ {
byte[] data; byte[] data;
bool OnOff = ioValue.Equals(IO_VALUE.HIGH); bool OnOff = ioValue.Equals(IO_VALUE.HIGH);
data = CreateWriteHeader(id, startAddress, 1, 1, fctWriteSingleCoil, SlaveID); data = CreateWriteHeader(id, startAddress, 1, 1, fctWriteSingleCoil, SlaveID);
if (OnOff == true) data[10] = 255; if (OnOff == true) data[10] = 255;
else data[10] = 0; else data[10] = 0;
WriteAsyncData(data, id); return WriteAsyncData(data, id);
} }
public void WriteMultipleCoils(ushort id, ushort startAddress, ushort numBits, byte[] values, byte SlaveID) public void WriteMultipleCoils(ushort id, ushort startAddress, ushort numBits, byte[] values, byte SlaveID)
...@@ -511,12 +511,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -511,12 +511,12 @@ namespace OnlineStore.DeviceLibrary
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// Write asynchronous data // Write asynchronous data
private void WriteAsyncData(byte[] write_data, ushort id) private bool WriteAsyncData(byte[] write_data, ushort id)
{ {
if (socketClient == null) if (socketClient == null)
{ {
LOGGER.Error("发送数据时发现socketClient=null"); LOGGER.Error("MasterTcpClient发送数据时发现socketClient=null");
return; return false ;
} }
IPEndPoint clientipe = (IPEndPoint)socketClient.RemoteEndPoint; IPEndPoint clientipe = (IPEndPoint)socketClient.RemoteEndPoint;
if ((socketClient != null) && (socketClient.Connected)) if ((socketClient != null) && (socketClient.Connected))
...@@ -534,6 +534,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -534,6 +534,7 @@ namespace OnlineStore.DeviceLibrary
socketClient.BeginSend(write_data, 0, write_data.Length, SocketFlags.None, new AsyncCallback(OnSend), null); socketClient.BeginSend(write_data, 0, write_data.Length, SocketFlags.None, new AsyncCallback(OnSend), null);
//socketClient.BeginReceive(tcpSocketReviceBuffer, 0, tcpSocketReviceBuffer.Length, SocketFlags.None, new AsyncCallback(OnReceive), socketClient); //socketClient.BeginReceive(tcpSocketReviceBuffer, 0, tcpSocketReviceBuffer.Length, SocketFlags.None, new AsyncCallback(OnReceive), socketClient);
ReviceDataProcess(); ReviceDataProcess();
return true;
} }
catch (SystemException error) catch (SystemException error)
{ {
...@@ -542,6 +543,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -542,6 +543,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
else CallException(id, write_data[7], excExceptionConnectionLost, tcpSocketReviceBuffer); else CallException(id, write_data[7], excExceptionConnectionLost, tcpSocketReviceBuffer);
return false;
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
......
...@@ -476,6 +476,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -476,6 +476,7 @@ namespace OnlineStore.DeviceLibrary
} }
private void OpenDoorAndWait() private void OpenDoorAndWait()
{ {
Thread.Sleep(60);
KNDIOMove(IO_Type.Door_Down, IO_VALUE.LOW); KNDIOMove(IO_Type.Door_Down, IO_VALUE.LOW);
KNDIOMove(IO_Type.Door_Up, IO_VALUE.HIGH); KNDIOMove(IO_Type.Door_Up, IO_VALUE.HIGH);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Down, IO_VALUE.LOW)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Door_Down, IO_VALUE.LOW));
...@@ -804,6 +805,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -804,6 +805,8 @@ namespace OnlineStore.DeviceLibrary
//机器未启动 灭 灭 灭 //机器未启动 灭 灭 灭
//机器设备故障(非温湿度)报警 亮 灭 闪 //机器设备故障(非温湿度)报警 亮 灭 闪
//报警时只需要亮红灯
DateTime time = DateTime.Now; DateTime time = DateTime.Now;
bool isTemp30M = false; bool isTemp30M = false;
if (TempOrHumidityIsAlarm) if (TempOrHumidityIsAlarm)
...@@ -832,6 +835,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -832,6 +835,21 @@ namespace OnlineStore.DeviceLibrary
} }
} }
//报警时绿灯和黄灯灭
if (isNeedAlarmLed)
{
if (KNDIOValue(IO_Type.AutoRun_HddLed).Equals(IO_VALUE.HIGH))
{
KNDIOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
}
if (KNDIOValue(IO_Type.RunSign_HddLed).Equals(IO_VALUE.HIGH))
{
KNDIOMove(IO_Type.AutoRun_HddLed, IO_VALUE.LOW);
}
return;
}
//绿灯闪 //绿灯闪
if ((StoreMove.MoveType.Equals(StoreMoveType.InStore) || StoreMove.MoveType.Equals(StoreMoveType.OutStore) if ((StoreMove.MoveType.Equals(StoreMoveType.InStore) || StoreMove.MoveType.Equals(StoreMoveType.OutStore)
|| storeRunStatus.Equals(StoreRunStatus.HomeMoving) || storeRunStatus.Equals(StoreRunStatus.Reset)) || storeRunStatus.Equals(StoreRunStatus.HomeMoving) || storeRunStatus.Equals(StoreRunStatus.Reset))
......
...@@ -634,7 +634,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -634,7 +634,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
//打开舱门 //打开舱门
OpenDoorAndWait(); //OpenDoorAndWait();
} }
else else
{ {
...@@ -650,10 +650,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -650,10 +650,10 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
//此处需要等待box门口没有盘 //此处需要等待box门口没有盘
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW)); //StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0)); //StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
//打开舱门 //打开舱门
OpenDoorAndWait(); //OpenDoorAndWait();
//StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_2, IO_VALUE.LOW)); //StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_2, IO_VALUE.LOW));
} }
...@@ -661,7 +661,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -661,7 +661,12 @@ namespace OnlineStore.DeviceLibrary
{ {
if (IsHasCompress_Axis|| Config.IsHasLocationCylinder.Equals(0)) if (IsHasCompress_Axis|| Config.IsHasLocationCylinder.Equals(0))
{ {
SO_10_DeviceToDoorPro(); //SO_10_DeviceToDoorPro();
StoreMove.NextMoveStep(StoreMoveStep.SO_091_WaitNoTray);
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
OpenDoorAndWait();
} }
else else
{ {
...@@ -673,11 +678,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -673,11 +678,16 @@ namespace OnlineStore.DeviceLibrary
//此处需要等待移栽没有工作,才能把盘放入出料口 //此处需要等待移栽没有工作,才能把盘放入出料口
else if (StoreMove.MoveStep == StoreMoveStep.SO_09_LocationCylinder_Down) else if (StoreMove.MoveStep == StoreMoveStep.SO_09_LocationCylinder_Down)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_091_WaitNoTray);
OutStoreLog("出库:SO_091 打开仓门,等待门口无料盘 ");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
OpenDoorAndWait();
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_091_WaitNoTray)
{
SO_10_DeviceToDoorPro(); SO_10_DeviceToDoorPro();
//OutStoreLog("出库:SO_10 叉子进出料口,进出轴至P2(进料口取料点) ");
//StoreMove.NextMoveStep(StoreMoveStep.SO_10_DeviceToDoor);
//ACAxisMove(Config.InOut_Axis, moveP.InOut_P2, Config.InOutAxis_P2_Speed);
//NeedCheckSafetyLight = 1;
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_10_DeviceToDoor) else if (StoreMove.MoveStep == StoreMoveStep.SO_10_DeviceToDoor)
{ {
......
...@@ -218,6 +218,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -218,6 +218,10 @@ namespace OnlineStore.DeviceLibrary
/// 料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位 /// 料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位
/// </summary> /// </summary>
SO_09_LocationCylinder_Down = 109, SO_09_LocationCylinder_Down = 109,
/// <summary>
/// 等待门口无料盘
/// </summary>
SO_091_WaitNoTray=115,
/// <summary> /// <summary>
/// 料仓出库,,叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点) /// 料仓出库,,叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!