FeedingEquip_OutStore.cs
12.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
partial class FeedingEquip
{
#region 出料流程
private InOutParam lastOutParam = null;
public override bool StartOutStoreMove(InOutParam param)
{
runStatus = LineRunStatus.Busy;
lineStatus = LineStatus.OutStoreExecute;
MoveInfo.NewMove(LineMoveType.OutStore);
MoveInfo.MoveParam = new InOutParam();
MoveInfo.NextMoveStep(LineMoveStep.FO_01_TrayLocation_After);
TrayLCylinderAfter(MoveInfo);
OutLog("检测到料架, FO_01_TrayLocation_After :升降盘定位气缸后退");
return true;
}
private void LineOutStoreProcess()
{
IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW);
//判断是哪个工位有料架
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH))
{
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FO_07_LocationCylinder_Up);
OutLog("定位工位检测到料架" + MoveInfo.MoveStep + ":缓冲阻挡上升, 定位气缸上升");
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
}
//阻挡工位有料架,流水线转动一个工位
else if (IOValue(IO_Type.SL_Stop_Check).Equals(IO_VALUE.HIGH))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_03_LineStart);
IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.LOW);//进料阻挡上升
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.HIGH);//缓冲阻挡下降
IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH);
//等待指定时间
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
OutLog("出料检测" + MoveInfo.SLog + ":阻挡工位有料架,进料阻挡上升,缓冲阻挡下降,流水线转动2000");
}
else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_03_LineStart);
IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.HIGH);//进料阻挡下降
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡上升
IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH);
//等待指定时间
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
OutLog("出料检测" + MoveInfo.SLog + ":入料工位有料架,进料阻挡下降,缓冲阻挡上升,流水线转动2000");
}
else
{
MoveInfo.EndMove();
runStatus = LineRunStatus.Runing;
LogUtil.info(" 未检测到料架,出料结束");
}
}
protected override void OutStoreProcess()
{
if (MoveInfo.IsInWait)
{
CheckWait(MoveInfo);
}
if (MoveInfo.IsInWait)
{
return;
}
if (MoveInfo.MoveStep.Equals(LineMoveStep.Wait))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_01_TrayLocation_After);
TrayLCylinderAfter(MoveInfo);
OutLog("出料检测" + MoveInfo.SLog + ":升降盘定位气缸后退");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_01_TrayLocation_After))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_02_LocationCylinder_Down);
OutLog("出库: " + MoveInfo.SLog + " 开始:定位气缸下降,提升轴移动到P1");
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_02_LocationCylinder_Down))
{
LineOutStoreProcess();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_03_LineStart))
{
LineOutStoreProcess();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_07_LocationCylinder_Up))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_08_BatchAxisToP2);
OutLog("出库移栽 " + MoveInfo.SLog + " :提升轴下降到位P2");
IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW);
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_08_BatchAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_09_TrayLocation_Before);
OutLog("出库移栽 " + MoveInfo.SLog + " :升降盘定位气缸前进");
TrayLCylinderBefore(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_09_TrayLocation_Before))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_10_AxisUpMove);
OutLog("出库移栽 " + MoveInfo.SLog + " :上料轴开始慢速上升到P3点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP3, Config.BatchAxis_TargetSpeed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_10_AxisUpMove))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_11_AxisDownMove);
OutLog("出库移栽 " + MoveInfo.SLog + " :提升伺服下降指定的高度");
int targetPosition = Config.BatchAxisP3 + lastOutParam.PlateH * Config.Height_ChangeValue;
BatchAxis.AbsMove(MoveInfo, targetPosition, Config.BatchAxis_TargetSpeed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_11_AxisDownMove))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_12_MoveCylinder_Down);
OutLog("出库移栽 " + MoveInfo.SLog + ":出料横移机构下降");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_12_MoveCylinder_Down))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_13_MoveCylinder_Slack);
OutLog("出库移栽 " + MoveInfo.SLog + ":出料横移机构放松");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_13_MoveCylinder_Slack))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_14_MoveCylinder_Up);
OutLog("出库移栽 " + MoveInfo.SLog + ":上料横移机构上升");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_14_MoveCylinder_Up))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_31_BatchAxisToP2);
OutLog("出库移栽 " + MoveInfo.SLog + ":未检测到料盘,提升伺服到P2点");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_31_BatchAxisToP2))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_32_TrayLocationCylinder_After);
OutLog("出料完成 " + MoveInfo.SLog + ": 升降盘定位气缸后退");
TrayLCylinderAfter(MoveInfo);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_32_TrayLocationCylinder_After))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_33_BatchAxisToP1);
OutLog("出料完成 " + MoveInfo.SLog + ":提升伺服到P1点,定位气缸下降");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP1, Config.BatchAxis_P1Speed);
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_33_BatchAxisToP1))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_34_OutTopCylinder_Up);
OutLog("出料完成 " + MoveInfo.SLog + ",出口顶升气缸上升,出料缓冲阻挡上升");
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Down, IO_Type.SL_OutTopCylinder_Up);
IOMove(IO_Type.SL_Out_StopDown, IO_VALUE.LOW);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_34_OutTopCylinder_Up))
{
//TODO
MoveInfo.NextMoveStep(LineMoveStep.FO_36_SideWayLineRun);
OutLog("出料完成 " + MoveInfo.SLog + ", 线体横移电机运转,等待料架离开定位工位");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.HIGH);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.HIGH);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_Location_Check, IO_VALUE.LOW));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_35_WaitLocationNoShelf))
{
//TODO
MoveInfo.NextMoveStep(LineMoveStep.FO_36_SideWayLineRun);
OutLog("出料完成 " + MoveInfo.SLog + ", 线体横移电机运转,等待料架到达出口");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.HIGH);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.HIGH);
MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_Out_Check, IO_VALUE.HIGH));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_36_SideWayLineRun))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_37_LineStop);
OutLog("出料完成 " + MoveInfo.SLog + ", 料架到达出口,线体横移电机停止 ");
IOMove(IO_Type.SL_LocationSideWay_Run, IO_VALUE.LOW);
IOMove(IO_Type.SL_OutSideWay_Run, IO_VALUE.LOW);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_37_LineStop))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_38_TopCylinderDown);
OutLog("出料完成 " + MoveInfo.SLog + ", 料架到达出口,出口顶升下降,定位气缸下降, ");
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Up, IO_Type.SL_OutTopCylinder_Down);
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Up, IO_Type.SL_LocationCylinder_Down);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_38_TopCylinderDown))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_39_OutLineRun);
OutLog("出料完成 " + MoveInfo.SLog + ", 出口线体运转,料架到达出口处, 通知AGV取空料架, ");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_40_OutLineRun))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_40_OutLineRun);
OutLog("出料完成 " + MoveInfo.SLog + ", AGV到达,继续转动出口线体,送走出料料架, ");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_40_OutLineRun))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_41_OutLineRun);
OutLog("上料完成 " + MoveInfo.SLog + ", 料架送出, ");
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_41_OutLineRun))
{
MoveInfo.EndMove();
runStatus = LineRunStatus.Runing;
lastOutParam = null;
LogUtil.info("空料架已送出,出料结束");
}
}
#endregion
}
}