MoveType.cs
8.9 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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
using URSoldering.DeviceLibrary;
using URSoldering.LoadCSVLibrary;
using System;
namespace URSoldering.DeviceLibrary
{
public class WaitResultInfo
{
private WaitResultInfo()
{
}
public static WaitResultInfo WaitIO(string IoType, IO_VALUE value)
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 1;
wait.IoType = IoType;
wait.IoValue = value;
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitTime(int MScends)
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 2;
wait.TimeMSeconds = MScends;
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitRobotPoint(URPointValue point)
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 3;
wait.UrPoint = point;
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitTemperature(int temper, int maxTemper, int minTemper)
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 4;
wait.Temperature = temper;
wait.TemperatureMax = maxTemper;
wait.TemperatureMin = minTemper;
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitSendWire(int MScends, bool isR)
{
WaitResultInfo wait = new WaitResultInfo();
wait.ShuoKeISReverse = isR;
wait.WaitType = 5;
wait.TimeMSeconds = MScends;
wait.IsEnd = false;
return wait;
}
public static WaitResultInfo WaitRobotRun()
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 6;
wait.IsEnd = false;
return wait;
}
public string ToStr()
{
if (WaitType == 1)
{
return "IO信号等待,IO类型【" + IoType + "】,等待值【" + IoValue + "】";
}
else if (WaitType == 2)
{
return "时间等待:【" + TimeMSeconds + "】毫秒";
}
else if (WaitType == 3)
{
return "等待机器人运动结束";
}
else if (WaitType == 4)
{
return "等待温度设置结束";
}
else if (WaitType == 5)
{
return "等待送丝";
}
else
{
return "Wait位置类型:WaitType=【" + WaitType + "】";
}
}
/// <summary>
/// 等待结果,1=IO运动,2=时间 ,3=机器人运动OK,4=温度设置结束,5=送丝结束,6=等待机器人连接完成。
/// 11=等待IAI压机伺服ON,12=等待IAI伺服到待机点,13=等待IAI伺服程序运行OK,14=等待IAI压机原点返回完成
/// </summary>
public int WaitType { get; set; }
/// IO类型
/// </summary>
public String IoType { get; set; }
/// <summary>
/// IO值
/// </summary>
public IO_VALUE IoValue { get; set; }
/// <summary>
/// 等待的毫秒
/// </summary>
public int TimeMSeconds { get; set; }
/// <summary>
/// 需要达到温度上限
/// </summary>
public int TemperatureMax { get; set; }
/// <summary>
/// 需要达到温度下限
/// </summary>
public int TemperatureMin { get; set; }
/// <summary>
/// 需要达到温度
/// </summary>
public int Temperature { get; set; }
/// <summary>
/// 硕科驱动器地址
/// </summary>
public byte SlvAddr { get; set; }
/// <summary>
/// 是否 是硕科反转,即报警时的倒转
/// </summary>
public bool ShuoKeISReverse { get; set; }
/// <summary>
/// 是否已经完成
/// </summary>
public bool IsEnd { get; set; }
/// <summary>
/// 机器人坐标
/// </summary>
public URPointValue UrPoint { get; set; }
}
public enum MoveType
{
/// <summary>
/// 没有任何操作
/// </summary>
None = 0,
/// <summary>
/// 焊接中
/// </summary>
Weld = 1,
/// <summary>
/// 原点返回
/// </summary>
GoHome = 2,
/// <summary>
/// 流水线收到启动信号之前的转动
/// </summary>
LineMove = 10,
/// <summary>
///焊接完成达流水线动作
/// </summary>
WeldEndMove=100,
}
public enum MoveStep
{
Wait = 0,
/// <summary>
/// 机器人走到对应的焊点,送丝下降,烙铁加温
/// </summary>
W01_RobotMoveToPoint = 1,
/// <summary>
/// 慢速送丝
/// </summary>
W02_SlowSendWire = 2,
/// <summary>
/// 送丝
/// </summary>
W03_SendWire = 3,
/// <summary>
/// 焊接加温等待
/// </summary>
W04_WeldWait = 4,
/// <summary>
/// 清洗烙铁
/// </summary>
W11_ToClear1 = 11,
/// <summary>
/// 清洗烙铁
/// </summary>
W12_ToClear2 = 12,
/// <summary>
/// 移动到待机点
/// </summary>
W13_GoOrg = 13,
/// <summary>
/// AOI检测
/// </summary>
W14_AOICheck=14,
/// <summary>
/// 清洗完成
/// </summary>
W15_ClearEnd=15,
///// <summary>
///// 送丝下降
///// </summary>
//W14_SendWireDown = 14,
/// <summary>
/// 焊点完成,需要清洗烙铁,移动到原点
/// </summary>
W20_MoveToClear1 = 20,
/// <summary>
/// 走到第二个清洗点
/// </summary>
W21_MoveToClear2 = 21,
/// <summary>
/// 移动到原点
/// </summary>
W22_MoveToOrg = 22,
/// <summary>
/// 送丝下降
/// </summary>
W23_SendWireDown = 23,
Home_Reset = 100,
/// <summary>
/// 机器人移动到原点
/// </summary>
Home_1_RobotMove = 101,
/// <summary>
/// 需要清洗,开始预热,走到第一个清洗点
/// </summary>
Home_3_StartClear = 103,
/// <summary>
/// 走到第二个清洗点
/// </summary>
Home_4_ToClear2 = 104,
Home_5_ToOrg = 105,
/// <summary>
/// 阻挡气缸上升
/// </summary>
L00_CylinderUp = 1000,
/// <summary>
/// 收到启动信号开始转动流水线
/// </summary>
L01_StartLineMove =1001,
/// <summary>
/// 收到焊接信号,等待3秒后停止流水线
/// </summary>
L02_GetWeldSingle=1002,
/// <summary>
/// 扫码
/// </summary>
L03_GetCode=1003,
/// <summary>
/// 开始焊接
/// </summary>
L04_BeginWeld=1004,
/// <summary>
/// 焊接结束处理:焊接中
/// </summary>
BUSY01_Weld = 1101,
/// <summary>
/// AOI检测
/// </summary>
BUSY02_AOICheck=1102,
/// <summary>
/// 焊接结束处理:阻挡气缸下降
/// </summary>
BUSY03_CylinderDown = 1103,
/// <summary>
/// 焊接结束处理:焊接完成,转动流水线
/// </summary>
BUSY04_LineMove = 1104,
/// <summary>
/// 焊接结束处理:收到流水线出口信号,等待5秒钟
/// </summary>
BUSY05_Wait = 1105,
/// <summary>
///焊接结束处理: 流水线倒转,等待流水线入料口信号
/// </summary>
BUSY06_WaitInSingle = 1106,
}
/// <summary>
/// 焊接点的时间记录
/// </summary>
public class PointWeldTime
{
public PointWeldTime()
{
PreStartTime = DateTime.Now;
PreEndTime = DateTime.Now;
WeldStartTime = DateTime.Now;
WeldEndTime = DateTime.Now;
}
/// <summary>
/// 预热开始时间
/// </summary>
public DateTime PreStartTime { get; set; }
/// <summary>
/// 预热结束时间
/// </summary>
public DateTime PreEndTime { get; set; }
/// <summary>
/// 焊接开始时间
/// </summary>
public DateTime WeldStartTime { get; set; }
/// <summary>
/// 焊接结束时间
/// </summary>
public DateTime WeldEndTime { get; set; }
}
}