Commit e1ba4c05 几米阳光

增加DI28信号,作为门口料盘检测信号

1 个父辈 7865aff4
......@@ -1511,10 +1511,14 @@ namespace OnlineStore.AutoInOutStore
private void btnWaitTrgGo_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show(ResourceControl.GetString(ResourceControl.TakeTrayOut, "已确认料盘已手动拿出"), ResourceCulture.GetString(ResourceCulture.MsgTitle,"提示"), MessageBoxButtons.YesNo, MessageBoxIcon.Question);
DialogResult result = MessageBox.Show(ResourceControl.GetString(ResourceControl.TakeTrayOut, "已确认料盘已手动拿出"), ResourceCulture.GetString(ResourceCulture.MsgTitle, "提示"), MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result.Equals(DialogResult.Yes))
{
AutomaticBaiting.doConfirmReelGo();
string r = AutomaticBaiting.doConfirmReelGo();
if (!String.IsNullOrEmpty(r))
{
MessageBox.Show(r, ResourceCulture.GetString(ResourceCulture.MsgTitle, "提示"));
}
}
}
......
......@@ -731,7 +731,7 @@
<value>Door lock Error: Close feeding device</value>
</data>
<data name="TakeTrayOut" xml:space="preserve">
<value>Take out reel manually</value>
<value>Close the doors</value>
</data>
<data name="NoAIr" xml:space="preserve">
<value>Pressure signal undetected</value>
......
......@@ -727,7 +727,7 @@
<value>锁门失败:请先关闭上料机构</value>
</data>
<data name="TakeTrayOut" xml:space="preserve">
<value>已确认料盘已手动拿出</value>
<value>关闭仓门</value>
</data>
<data name="NoAIr" xml:space="preserve">
<value>未检测到气压信号</value>
......
......@@ -603,6 +603,8 @@ namespace Asa.IOModule
{
if (_receive.TryDequeue(out byte[] buff))
{
if (buff.Length >= 8)
{
if (buff[7] == 1)
ReadDO(buff);
else if (buff[7] == 2)
......@@ -610,6 +612,16 @@ namespace Asa.IOModule
else if (buff[7] == 5)
ReadSingle(buff);
}
else
{
string s = "";
foreach(byte b in buff)
{
s += b + " ";
}
LogUtil.error("AIOBOX2 Receive长度不足:" + s);
}
}
}catch(Exception ex)
{
LogUtil.error("AIOBOX2 Receive出错:" + ex.ToString());
......
......@@ -38,7 +38,7 @@ DI,左侧门关闭,DoorColse_Single,3,192.168.200.12,0,左侧门关闭,X24,DI-24,0,
DI,门锁气缸打开端2,BatchDoor_Open2,4,192.168.200.12,0,门锁气缸打开端2,X25,DI-25,0,
DI,门锁气缸关闭端2,BatchDoor_Close2,5,192.168.200.12,0,门锁气缸关闭端2,X26,DI-26,0,
DI,批量轴极限信号,BatchAxis_Limit,6,192.168.200.12,0,批量轴极限信号,X27,DI-27,0,
,,,7,192.168.200.12,0,,X28,DI-28,0,
DI,仓门料盘检测信号,TrayCheck_Door,7,192.168.200.12,0,仓门料盘检测信号,X28,DI-28,0,
,,,16,192.168.200.12,0,,Y21,DO-21,0,
,,,17,192.168.200.12,0,,Y22,DO-22,0,
,,,18,192.168.200.12,0,,Y23,DO-23,0,
......
......@@ -482,6 +482,8 @@ namespace OnlineStore.DeviceLibrary
AutomaticBaiting.IsWaitTragGo = true;
AutomaticBaiting.IsGetTrayGo = false;
StoreMove.WaitList.Add(WaitResultInfo.WaitTakeTray());
AutomaticBaiting.WaitIoValue = IO_VALUE.LOW;
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
break;
case StoreMoveStep.BOX_R43_WaitTrayGo:
if (IOManager.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
......@@ -1838,7 +1840,7 @@ namespace OnlineStore.DeviceLibrary
else if (dataMap.ContainsKey(ParamDefine.confirmReelOut) && dataMap[ParamDefine.confirmReelOut].Equals(ParamDefine.doit))
{
LogUtil.info(StoreName + "收到服务器命令:confirmReelOut=doit");
AutomaticBaiting.doConfirmReelGo();
result = AutomaticBaiting.doConfirmReelGo();
} else if (dataMap.ContainsKey(ParamDefine.singleReelIn) && dataMap[ParamDefine.singleReelIn].Equals(ParamDefine.doit))
{
LogUtil.info(StoreName + "收到服务器命令:SingleReelIn=doit");
......
......@@ -596,7 +596,8 @@ namespace OnlineStore.DeviceLibrary
AutomaticBaiting.IsGetTrayGo = false;
AutomaticBaiting.IsWaitTragGo = true;
StoreMove.WaitList.Add(WaitResultInfo.WaitTakeTray());
AutomaticBaiting.WaitIoValue = IO_VALUE.LOW;
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_25_WaitTrayGo)
{
......@@ -640,6 +641,8 @@ namespace OnlineStore.DeviceLibrary
AutomaticBaiting.IsGetTrayGo = false;
AutomaticBaiting.IsWaitTragGo = true;
StoreMove.WaitList.Add(WaitResultInfo.WaitTakeTray());
AutomaticBaiting.WaitIoValue = IO_VALUE.HIGH;
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.HIGH));
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SIS_33_WaitTray))
{
......@@ -988,6 +991,9 @@ namespace OnlineStore.DeviceLibrary
AutomaticBaiting.IsWaitTragGo = true;
AutomaticBaiting.IsGetTrayGo = false;
StoreMove.WaitList.Add(WaitResultInfo.WaitTakeTray());
//需要检测是否已拿走
AutomaticBaiting.WaitIoValue = IO_VALUE.LOW;
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
}
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_22_WaitTrayGo))
{
......
......@@ -16,6 +16,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public static bool IsGetTrayGo = false;
public static bool IsWaitTragGo = false;
public static IO_VALUE WaitIoValue = IO_VALUE.LOW;
/// <summary>
/// 0=未知。1=门打开,2=门关闭
/// </summary>
......
......@@ -657,12 +657,25 @@ namespace OnlineStore.DeviceLibrary
return "";
}
public static bool doConfirmReelGo()
public static string doConfirmReelGo()
{
LogUtil.info(ResourceControl.GetString(ResourceControl.TakeTrayOut, "Take out reel manually"));
//判断IO是否正确
if (!IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(WaitIoValue))
{
if (WaitIoValue.Equals(IO_VALUE.LOW))
{
return ResourceControl.GetString(ResourceControl.TakeTrayOut, "Take out reel manually") + " 失败,请先拿走料盘" ;
}
else
{
return ResourceControl.GetString(ResourceControl.TakeTrayOut, "Take out reel manually") + " 失败,请先放入料盘";
}
}
IsWaitTragGo = false;
IsGetTrayGo = true;
return true;
return "";
}
public static string doSingleReelIn()
......
......@@ -205,5 +205,12 @@ namespace OnlineStore.LoadCSVLibrary
/// DI 批量轴极限信号 BatchAxis_Limit
/// </summary>
public static string BatchAxis_Limit = "BatchAxis_Limit";
/// <summary>
/// DI 仓门料盘检测信号 TrayCheck_Door
/// </summary>
public static string TrayCheck_Door = "TrayCheck_Door";
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!