Commit 1c633ffd LN

1

1 个父辈 b5cb8691
......@@ -588,29 +588,24 @@ namespace OnlineStore.ACPackingStore
{
if (BoxBean.AutoInout.autoNext)
{
BoxBean.AutoInout.autoNext = false;
BoxBean.AutoInout.StopAuto();
btnStartAuTo.Text = "开始自动出入库";
}
else
{
DialogResult res = MessageBox.Show("确定开始自动出入库?", "提示", MessageBoxButtons.YesNo);
if (res.Equals(DialogResult.Yes))
if (res.Equals(DialogResult.Yes) && cmbPosition.SelectedIndex >= 0)
{
BoxBean.AutoInout.autoNext = true;
int jiange = FormUtil.GetIntValue(txtJiange);
BoxBean.AutoInout.Jiange = jiange;
if (cmbPosition.SelectedIndex >= 0)
{
int currIndex = cmbPosition.SelectedIndex;
BoxBean.AutoInout.positionIndex = currIndex;
BoxBean.AutoInout.startIndex = currIndex;
BoxBean.AutoInout.shelfPosId = cmbShelfPosition.Text;
BoxBean.AutoInout.StartAuto(jiange, currIndex, cmbShelfPosition.Text);
string poText = cmbPosition.Text;
BoxBean.AutoInout.autoMsg = "自动出库:" + poText;
LogUtil.info(LOGGER, BoxBean.Name + "开启自动出入库模式,开始位置【" + poText + "】(索引=" + currIndex + "),间隔=" + jiange + ",入库开始!");
//BoxBean.StartOutStoreMove(new InOutStoreParam("", poText));
BoxBean.StartInStoreMove(new InOutParam("", poText, BoxBean.AutoInout.shelfPosId));
}
BoxBean.StartInStoreMove(new InOutParam("", poText, cmbShelfPosition.Text));
btnStartAuTo.Text = "停止自动出入库";
}
}
......
......@@ -121,6 +121,7 @@
this.chkDebug.TabIndex = 194;
this.chkDebug.Text = "开启DEBUG日志";
this.chkDebug.UseVisualStyleBackColor = true;
this.chkDebug.CheckedChanged += new System.EventHandler(this.chkDebug_CheckedChanged);
//
// chbAutoRun
//
......
......@@ -408,5 +408,11 @@ namespace OnlineStore.ACPackingStore
LogUtil.info("去掉:启用蜂鸣器");
}
}
private void chkDebug_CheckedChanged(object sender, EventArgs e)
{
LogUtil.debug_opened = chkDebug.Checked;
LogUtil.info("debug_opened:" + chkDebug.Checked);
}
}
}
......@@ -34,7 +34,7 @@ namespace OnlineStore.ACPackingStore
this.SlvAddr = slvAddr;
this.IoIp = ioIp;
this.IoIndex = ioIndex;
boxName = boxName.Trim().Replace("料仓", "");
boxName = text.Trim().Replace("料仓", "");
this.Text = boxName + "_升降轴位置调试";
LogName = boxName + "_升降轴调试:";
toolTimer.Enabled = false;
......
......@@ -7,6 +7,4 @@
//温湿度超限报警中超过30分钟 亮 闪 闪
//机器未启动 灭 灭 灭
//机器设备故障(非温湿度)报警 亮 灭 闪
在RC1246-ACPackingStore 项目基础上,
新建分支RC1250-ACPackingStore,作为佳世达流水线单台料仓软件
新建分支RC1250-ACPackingStore,作为佳世达流水线单台包装料料仓软件
......@@ -40,6 +40,12 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute;
EmprtShelfList = new Queue<string>();
//读取RFID
RFIDData data = RFIDManager.ReadData(Config.RFID_IP);
//TODO 判断料架是否正确
MoveInfo.NewMove(StoreMoveType.InStore, new InOutParam());
MoveInfo.MoveParam.MoveP = new LineMoveP();
......@@ -129,7 +135,8 @@ namespace OnlineStore.DeviceLibrary
}
else
{
//所有料盘已取料完成
//所有料盘已取料完成,送出料架
StartSendShelfOut();
}
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_11_InoutToP1))
......@@ -180,17 +187,6 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_17_InoutBack))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_18_ScanCode);
InOutStoreLog("料架取料:记录宽度,开始扫码");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitCode());
Task.Factory.StartNew(delegate
{
IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
LastScanCodes = CodeManager.CameraScan();
IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
});
if (IOValue(IO_Type.TrayCheck_3).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.TrayCheck_4).Equals(IO_VALUE.HIGH))
{
LastWidth = 13;
......@@ -203,6 +199,26 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.info("未检测到识别区料盘检测信号, 默认高度为7");
}
if (MoveInfo.SingleInstore)
{
//单盘入库,不需要扫码
StartMoveToBag();
}
else
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_18_ScanCode);
InOutStoreLog("料架取料:记录宽度,开始扫码");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitCode());
Task.Factory.StartNew(delegate
{
IOMove(IO_Type.Camera_Led, IO_VALUE.HIGH);
LastScanCodes = CodeManager.CameraScan();
IOMove(IO_Type.Camera_Led, IO_VALUE.LOW);
});
}
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_18_ScanCode))
{
......@@ -238,10 +254,7 @@ namespace OnlineStore.DeviceLibrary
#region 入库逻辑
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_20_SetInstoreParam))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_21_MoveToBag);
InOutStoreLog("入库:移动到库位点,轴1( 转盘) 至P2( 库位点)轴2(上下) 至P3(库位入库前点)");
ACAxisMove(Config.Middle_Axis, moveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
StartMoveToBag();
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_21_MoveToBag))
{
......@@ -262,7 +275,7 @@ namespace OnlineStore.DeviceLibrary
//手动发给服务器状态,防止没有手动
//SendLineStatus(StoreID, posId, StoreStatus.InStoreEnd);
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.Comp_Axis, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P4, Config.UpDownAxis_P4_Speed);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_23_PutWareToBag))
......@@ -275,7 +288,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_25_GoBack);
InOutStoreLog("入库:返回待机点,轴2/轴1/轴4动作至P1( 待机点))开始");
ComMoveToPosition(moveP.ComPress_P1, Config.CompAxis_P1_Speed);
ACAxisMove(Config.Comp_Axis, moveP.ComPress_P1, Config.CompAxis_P1_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
}
......@@ -326,12 +339,26 @@ namespace OnlineStore.DeviceLibrary
InOutStoreLog("料架入库:开始循环逐个取料盘,扫码入库");
}
#endregion
//料架送出逻辑
else if(MoveInfo.MoveStep>= StoreMoveStep.BS_01_TopCylinder_Down&&MoveInfo.MoveStep >= StoreMoveStep. BS_09_CloseDoor)
{
SendShelfProcess();
}
else
{
LogInfo(" 入库,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
}
}
private void StartMoveToBag()
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_21_MoveToBag);
InOutStoreLog("入库:移动到库位点,轴1( 转盘) 至P2( 库位点)轴2(上下) 至P3(库位入库前点)");
ACAxisMove(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
}
private void StartSendTray( string str="扫码失败")
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_31_ToNGDoor);
......@@ -353,44 +380,56 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_02_LocatinCylinder_Down);
InOutStoreLog("送出料架:定位气缸下降");
CylinderMove(MoveInfo, IO_Type.LocationCylinder_Up, IO_Type.LocationCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_02_LocatinCylinder_Down))
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_03_DoorOpen);
InOutStoreLog("送出料架:打开仓门");
CylinderMove(MoveInfo, IO_Type.EntranceDoor_Close, IO_Type.EntranceDoor_Open);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_03_DoorOpen))
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_04_LineBack);
InOutStoreLog("送出料架:线体反转");
IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
IOMove(IO_Type.Line_BackRun, IO_VALUE.HIGH);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_04_LineBack))
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_05_WaitInLineSingle);
InOutStoreLog("送出料架:等待取料工位无信号,入料口有信号");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineTake_Check, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineIn_Check, IO_VALUE.HIGH));
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_05_WaitInLineSingle))
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_06_WaitTime);
InOutStoreLog("送出料架:再转动300时间");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_06_WaitTime))
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_07_LineStop);
InOutStoreLog("送出料架:停止转动");
IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
IOMove(IO_Type.Line_BackRun, IO_VALUE.LOW);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_07_LineStop))
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_08_CallAGV);
InOutStoreLog("送出料架:通知调度系统拿走");
//TODO
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_08_CallAGV))
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_09_CloseDoor);
InOutStoreLog("送出料架:关闭仓门");
CylinderMove(MoveInfo, IO_Type.EntranceDoor_Open, IO_Type.EntranceDoor_Close);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_09_CloseDoor))
{
}
}
......
......@@ -52,6 +52,8 @@ namespace OnlineStore.DeviceLibrary
List<string> ioList = new List<string>();
AddDeviceName(ioList, Config.DIODeviceNameList);
List<string> rfidList = new List<string>();
foreach (AC_BOX_Config config in configList.Values)
{
AC_BOX_Bean equip = new AC_BOX_Bean(config);
......@@ -59,6 +61,8 @@ namespace OnlineStore.DeviceLibrary
AddDeviceName(ioList, config.DIODeviceNameList);
BoxMap.Add(config.DeviceID, equip);
BoxConfigMap.Add(config.DeviceID, config);
rfidList.Add(config.RFID_IP);
}
IOManager.Init();
......@@ -69,6 +73,7 @@ namespace OnlineStore.DeviceLibrary
Task.Factory.StartNew(delegate
{
RFIDManager.ConnectRFIOList(rfidList);
IOManager.instance.ConnectionIOList(ioList);
addLastDI(IO_Type.Airpressure_Check, IOValue(IO_Type.Airpressure_Check));
addLastDI(IO_Type.SuddenStop_BTN, IOValue(IO_Type.SuddenStop_BTN));
......
......@@ -44,8 +44,6 @@ AXIS,(轴三)进出轴,InOut_Axis,3,COM1,0,,,,,
AXIS,(轴四)压紧轴,Comp_Axis,4,COM1,0,,,,,
PRO,升降轴 进料口取料点 P1,UpDownAxis_P1,403000,,,,,,,
PRO,升降轴 进料口出料前点 P2,UpDownAxis_P2,415000,,,,,,,
PRO,升降轴 进料口取料缓冲点 P7,UpDownAxis_DoorOBPosition_P7,415000,,,,,,,
PRO,升降轴 进料口出料缓冲点 P8,UpDownAxis_DoorIBPosition_P8,403000,,,,,,,
PRO,旋转轴(轴1)P1 待机原位点,MiddleAxis_P1,268093,,,,,,,
PRO,进出轴(轴3)P1待机原位点,InOutAxis_P1_Position,1000,,,,,,,
PRO,压紧轴(轴4)P1待机原位点,CompAxis_P1_Position,10000,,,,,,,
......@@ -111,7 +109,6 @@ PRO,(轴三)进出轴停止时可误差的脉冲数的最大值,InoutAxis_ErrorCountMax,1000,,,,,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
PRO,出入库多少次,会自动重置所有轴操作,Box_ResetACount,100,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,是否使用料盘检测信号,IsUse_Tray_Check,0,,,,,, ,
PRO,(轴一)旋转轴最小限位,MiddleAxis_PositionMin,0,,,,,,,
PRO,(轴二)升降轴最小限位,UpdownAxis_PositionMin,0,,,,,,,
PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,,
......
......@@ -16,11 +16,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 自动出入库间隔
/// </summary>
public int Jiange = 3;
public int positionIndex = 0;
private int Jiange = 3;
private int positionIndex = 0;
public string autoMsg = "";
public int startIndex = -1;
public string shelfPosId = "";
private int startIndex = -1;
private string shelfPosId = "";
#region 出入库参数
/// <summary>
/// 当前出入库的次数,超过配置的数量时,需要自动重置一下,再进行出入库
......@@ -29,6 +29,21 @@ namespace OnlineStore.DeviceLibrary
internal int CurrInOutACount = 0;
#endregion
public void StartAuto(int jiange, int currIndex, string shelfPosId)
{
autoNext = true;
Jiange = jiange;
positionIndex = currIndex;
startIndex = currIndex;
this.shelfPosId = shelfPosId;
}
public void StopAuto()
{
autoNext = false;
}
internal void InOutEndProcess(AC_BOX_Bean boxBean, StoreMoveType storeMoveType)
{
try
......@@ -70,13 +85,6 @@ namespace OnlineStore.DeviceLibrary
autoMsg = "自动出库:" + posid;
boxBean.AddWaitOutInfo(new InOutParam("", posid, shelfPosId));
}
else if (CurrInOutCount >= boxBean.Config.Box_ResetMCount)
{
boxBean.LogInfo("自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中");
//ResetMiddleAxis(false);
autoMsg = "自动出库:" + posid;
boxBean.AddWaitOutInfo(new InOutParam("", posid, shelfPosId));
}
else
{
boxBean.LogInfo("自动进入下一个出库:posid=" + posid);
......@@ -113,13 +121,6 @@ namespace OnlineStore.DeviceLibrary
autoMsg = "自动入库:" + posid;
boxBean.AddWaitOutInfo(new InOutParam("AAAA", posid, shelfPosId));
}
else if (CurrInOutCount >= boxBean.Config.Box_ResetMCount)
{
boxBean.LogInfo("自动进入下一个出库:posid=" + posid + ",当时已经出入库" + CurrInOutCount + "次,需要重置BOX旋转轴,先把出库信息存入排队列表中");
//ResetMiddleAxis(false);
autoMsg = "自动入库:" + posid;
boxBean.AddWaitOutInfo(new InOutParam("AAAA", posid, shelfPosId));
}
else
{
boxBean.LogInfo("自动进入下一个入库:posid=" + posid);
......
......@@ -248,67 +248,67 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 料仓内部入库步骤 20500
/// <summary>
/// 入库检测
/// </summary>
SI_00_TrayCheck = 20500,
/// <summary>
/// 入库,。定位气缸下降
/// </summary>
SI_01_LocationCylinderDown =20501,
/// <summary>
/// 入库。。进出轴(叉子)先返回P1
/// </summary>
SI_02_InOutAxisHome =20502,
/// <summary>
/// 入库。。所有轴先回到待机点,轴2、轴1 动作到P1,,轴4动作至P3
/// </summary>
SI_03_ReturnHome =20503,
/// <summary>
/// 入库。。压紧物品(有压紧轴的才需要此步骤),轴4( 压紧) 至P3(压紧前点)
/// </summary>
SI_04_CompressWare =20504,
/// <summary>
/// 入库。。叉子进入入料口,轴3( 叉子) 至P2( 进料口取料点)
/// </summary>
SI_05_DeviceToDoor =20505,
/// <summary>
/// 入库。。把物品放入叉子上,轴2( 上下) 至P7( 进料口取料缓冲点),压紧物品(有压紧轴的才需要此步骤),轴4( 压紧) 至P2(压紧点)
/// </summary>
SI_06_DoorWarToDevice =20506,
///// <summary>
///// 入库检测
///// </summary>
//SI_00_TrayCheck = 20500,
///// <summary>
///// 入库,。定位气缸下降
///// </summary>
//SI_01_LocationCylinderDown =20501,
///// <summary>
///// 入库。。进出轴(叉子)先返回P1
///// </summary>
//SI_02_InOutAxisHome =20502,
///// <summary>
///// 入库。。所有轴先回到待机点,轴2、轴1 动作到P1,,轴4动作至P3
///// </summary>
//SI_03_ReturnHome =20503,
///// <summary>
///// 入库。。压紧物品(有压紧轴的才需要此步骤),轴4( 压紧) 至P3(压紧前点)
///// </summary>
//SI_04_CompressWare =20504,
///// <summary>
///// 入库。。叉子进入入料口,轴3( 叉子) 至P2( 进料口取料点)
///// </summary>
//SI_05_DeviceToDoor =20505,
///// <summary>
///// 入库。。把物品放入叉子上,轴2( 上下) 至P7( 进料口取料缓冲点),压紧物品(有压紧轴的才需要此步骤),轴4( 压紧) 至P2(压紧点)
///// </summary>
//SI_06_DoorWarToDevice =20506,
/// <summary>
/// 入库。。叉子 从入料口抽出,轴3( 叉子) 至P1( 待机点)
/// </summary>
SI_07_DeviceBackFromDoor =20507,
/// <summary>
/// 入库。。,定位气缸伸出 (有压紧轴的不需要此步骤)
/// </summary>
SI_08_LocationCylinder_Up =20508,
/// <summary>
/// 入库。。移动到库位点,轴1( 转盘) 至P2( 库位点)轴2(上下) 至P3(库位入库前点)
/// </summary>
SI_09_MoveToBag =20509,
/// <summary>
/// 入库。。定位气缸退回 (有压紧轴的不需要此步骤)
/// </summary>
SI_10_LocationCylinder_Down =20510,
/// <summary>
/// 入库。。叉子进入库位中,轴3( 叉子) 至P3(库位取放料点)
/// </summary>
SI_11_DeviceToBag =20511,
/// <summary>
/// 入库。。放下物品,轴2( 上下) 至P4( 库位入料缓冲点)轴4( 压紧) 至P3( 压紧前点)
/// </summary>
SI_12_PutWareToBag =20512,
/// <summary>
/// 入库。。叉子从库位中返回,轴3( 叉子) 动作至P1( 待机点)
/// </summary>
SI_13_DeviceBackFromBag =20513,
/// <summary>
/// 入库。。返回待机点,轴2/轴1/轴4动作至P1( 待机点))开始
/// </summary>
SI_14_GoBack =20514,
///// <summary>
///// 入库。。叉子 从入料口抽出,轴3( 叉子) 至P1( 待机点)
///// </summary>
//SI_07_DeviceBackFromDoor =20507,
///// <summary>
///// 入库。。,定位气缸伸出 (有压紧轴的不需要此步骤)
///// </summary>
//SI_08_LocationCylinder_Up =20508,
///// <summary>
///// 入库。。移动到库位点,轴1( 转盘) 至P2( 库位点)轴2(上下) 至P3(库位入库前点)
///// </summary>
//SI_09_MoveToBag =20509,
///// <summary>
///// 入库。。定位气缸退回 (有压紧轴的不需要此步骤)
///// </summary>
//SI_10_LocationCylinder_Down =20510,
///// <summary>
///// 入库。。叉子进入库位中,轴3( 叉子) 至P3(库位取放料点)
///// </summary>
//SI_11_DeviceToBag =20511,
///// <summary>
///// 入库。。放下物品,轴2( 上下) 至P4( 库位入料缓冲点)轴4( 压紧) 至P3( 压紧前点)
///// </summary>
//SI_12_PutWareToBag =20512,
///// <summary>
///// 入库。。叉子从库位中返回,轴3( 叉子) 动作至P1( 待机点)
///// </summary>
//SI_13_DeviceBackFromBag =20513,
///// <summary>
///// 入库。。返回待机点,轴2/轴1/轴4动作至P1( 待机点))开始
///// </summary>
//SI_14_GoBack =20514,
#endregion
......
......@@ -77,6 +77,8 @@ namespace OnlineStore.DeviceLibrary
get { return moveStep; }
}
public bool SingleInstore = false;
public void NextMoveStep(StoreMoveStep step)
{
// PreMoveStep = moveStep;
......@@ -132,8 +134,8 @@ namespace OnlineStore.DeviceLibrary
/// 入库时,需要循环料架的料盘取出
/// </summary>
public List<string> ShelfPositionList = new List<string>();
public string currShelfPosId = "";
public int currShelfIndex = -1;
private string currShelfPosId = "";
private int currShelfIndex = -1;
public bool NextShelfPos()
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!