StoreManager.cs
30.3 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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
using log4net;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using OnlineStore.LoadCSVLibrary;
using OnLineStore.Common;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary
{
/// <summary>
/// 料仓管理类(加载料仓配置)
/// </summary>
public class StoreManager
{
private static string api_communication = "service/store/communication"; //流水线状态通信接口
private static string api_nextFeeder = "service/store/nextFeeder"; // 出库站位列表切换接口
private static Color storeMoveColor = Color.Blue;
public static readonly ILog LOGGER = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static Dictionary<int, StoreConfig> storeConfigMap = new Dictionary<int, StoreConfig>();
//private static Dictionary<int, object> storeMap = new Dictionary<int, object>();
private static bool isInit = false;
public StoreManager()
{
}
public static void CheckEnum(Type type)
{
if (type.IsEnum)
{
List<int> valueList = new List<int>();
foreach (int item in Enum.GetValues(type))
{
if (valueList.Contains(item))
{
LogUtil.error(LOGGER, type.Name+"枚举值:"+item +"重复存在,请检查代码!");
Application.Exit();
break;
}
valueList.Add(item);
}
}
}
public static string GetPostApi(string host)
{
if (host == "")
{
host = ConfigAppSettings.GetValue(Setting_Init.http_server);
}
if (!host.StartsWith("http://"))
{
host = "http://" + host;
}
if (!host.EndsWith("/"))
{
host = host + "/";
}
return host + api_communication;
}
public static string GetNextFeederApi(string host)
{
if (host == "")
{
host = ConfigAppSettings.GetValue(Setting_Init.http_server);
}
if (!host.StartsWith("http://"))
{
host = "http://" + host;
}
if (!host.EndsWith("/"))
{
host = host + "/";
}
return host + api_nextFeeder;
}
public static void UpdateConfig(AC_SA_Config lineConfig)
{
try
{
//位置配置到文件中
string appPath = Application.StartupPath;
string configFile = appPath + ConfigAppSettings.GetValue(Setting_Init.Store_ConfigPath);
bool result = CSVConfigReader.SaveBoxPosition(configFile, lineConfig);
if (!result)
{
LOGGER.Error("保存配置文件失败:" + configFile);
}
}
catch (Exception ex)
{
LOGGER.Error("出错:", ex);
}
}
}
/// <summary>
/// 等待启动/已经停止,初始化完成, 正常运行中,可以进行新的处理,忙碌,重置
/// </summary>
public enum StoreRunStatus
{
/// <summary>
/// 等待启动/已经停止
/// </summary>
Wait = 0,
///// <summary>
///// 初始化 ,原点返回状态中,只有流水线使用
///// </summary>
HomeMoving = 1,
/// <summary>
/// 设备正在重置中,请稍后
/// </summary>
Reset = 2,
/// <summary>
/// 正常运行中,可以进行新的处理
/// </summary>
Runing = 3,
/// <summary>
/// 正在忙碌中,请稍后
/// </summary>
Busy = 4,
}
/// <summary>
///1=设备联机(正常就绪)(入库后,BOX恢复原始状态)(出库后,移载装置恢复原始状态),
///2=急停,3=故障,4=警告,5=调试
/// 6=入库执行中,7=入仓完成,8=入仓失败
/// 9=出库执行,10=出仓完成,11=出库失败
/// </summary>
public enum StoreStatus
{
/// <summary>
/// 1=设备联机(正常就绪)(入库后,BOX恢复原始状态)(出库后,移载装置恢复原始状态),
/// </summary>
StoreOnline = 1,
/// <summary>
///2=急停中
/// </summary>
SuddenStop = 2,
/// <summary>
/// 3=故障中
/// </summary>
InTrouble = 3,
/// <summary>
/// 4=警告
/// </summary>
Warning = 4,
/// <summary>
/// 5=设备调试中
/// </summary>
Debugging = 5,
/// <summary>
/// 6=入库执行中
/// </summary>
InStoreExecute = 6,
/// <summary>
/// 7= 入仓位完成(料仓Box把料盘放入对应的库位中,装置还未恢复原始状态)
/// </summary>
InStoreEnd = 7,
/// <summary>
/// 8=入库失败
/// </summary>
InStoreFaild = 8,
/// <summary>
/// 9=出库执行中",
/// </summary>
OutStoreExecute = 9,
/// <summary>
///10= 出仓位完成( 料盘已经放到Box门口)
/// </summary>
OutStoreBoxEnd = 10,
/// <summary>
/// 12=移栽出库移栽过程中(移栽完成后变成OnLine)
/// </summary>
OutMoveExecute = 12,
/// <summary>
///11=出库失败
/// </summary>
OutStoreFaild = 11,
/// <summary>
/// 重置中(原点返回和重置都发此状态)
/// </summary>
ResetMove=13,
}
/// <summary>
/// 料仓运动状态(当料仓状态=busy时,才会有此运动状态)
/// </summary>
public enum StoreMoveStep
{
/// <summary>
/// 无操作,等待状态
/// </summary>
Wait = 0,
#region 料仓原点返回和重置步骤
/// <summary>
/// 料仓原点返回和重置步骤,,定位气缸下降
/// </summary>
BOX_H_LocationCylinderBack=010,
/// <summary>
/// 料仓原点返回和重置步骤,轴三先相对走3000
/// </summary>
BOX_H_InOutMove=011,
/// <summary>
/// 料仓原点返回和重置步骤,,轴三进出轴先返回原点
/// </summary>
BOX_H_InOutBack = 012,
/// <summary>
/// 料仓原点返回和重置步骤,,轴三返回P1点
/// </summary>
BOX_H_InOutToP1 = 013,
/// <summary>
/// 料仓原点返回和重置步骤,,升降轴,旋转轴,压紧轴原点返回
/// </summary>
BOX_H_OtherAxisBack = 014,
///// <summary>
///// 清理轴位置
///// </summary>
//BOX_H_WaitAxisCountClear = 015,
/// <summary>
/// 旋转轴返回P1
/// </summary>
BOX_H_MiddleAxisToP1=016,
/// <summary>
/// 叉子先退回P1
/// </summary>
BOX_M_H_InOutToP1=018,
/// <summary>
/// 旋转轴回原点
/// </summary>
BOX_M_H_MiddleAxisHome = 019,
/// <summary>
/// 旋转轴等待清理位置
/// </summary>
BOX_M_H_MiddleWait = 020,
/// <summary>
/// 叉子走到P1
/// </summary>
BOX_M_H_TOP1_InOutToP1 = 030,
/// <summary>
/// 压紧轴回原点
/// </summary>
BOX_M_H_TOP1_CompressHome = 031,
/// <summary>
/// 关闭门,旋转轴到P1,升降轴到P1
/// </summary>
BOX_M_H_TOP1_OtherAxisToP1 = 032,
#endregion
#region 料仓内部出库步骤
/// <summary>
///料仓出库,,定位气缸下降
/// </summary>
SO_01_LocationCylinderDown=101,
/// <summary>
///料仓出库:叉子先运动到P1
/// </summary>
SO_02_DeviceBack = 102,
/// <summary>
/// 料仓出库,,所有轴运行到库位, 轴4( 压紧) 至P3(压紧前点) ,轴1( 转盘) 至P2( 库位点),轴2(上下) 至P5(库位出库前点)
/// </summary>
SO_03_ToBagPosition = 103,
/// <summary>
/// 料仓出库,,叉子进入库位中, 轴3( 叉子) 至P3(库位取放料点)
/// </summary>
SO_04_DeviceToBag = 104,
/// <summary>
///料仓出库,, 库位的物品放入叉子上,轴2( 上下) 至P6( 库位出料缓冲点),轴4( 压紧) 至P2(压紧点)
/// </summary>
SO_05_BagWareToDevice = 105,
/// <summary>
///料仓出库,,叉子从 库位返回,轴3( 叉子) 至P1( 待机点)
/// </summary>
SO_06_BagDeviceBack = 106,
/// <summary>
/// 料仓出库,定位气缸伸出(有压紧轴的不需要此步骤),,定位气缸伸出 Y103-1/PCI5O1-83) Y103-2/PCI5O1-90) Y103-3/PCI5O1-95) 伸出到位
/// </summary>
SO_07_LocationCylinder_Up = 107,
/// <summary>
/// 料仓出库,,所有设备运行到门,,轴1( 转盘) 至P1( 待机点)轴2( 上下) 至P2( 进料口出料前点)
/// </summary>
SO_08_ToDoorPosition = 108,
/// <summary>
/// 料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位
/// </summary>
SO_09_LocationCylinder_Down = 109,
/// <summary>
/// 料仓出库,,叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点)
/// /// </summary>
SO_10_DeviceToDoor = 110,
/// <summary>
/// 料仓出库,,把物品放下,,轴2( 上下) 至P8( 进料口出料缓冲点)轴4( 压紧) 至P1( 待机点)
/// </summary>
SO_11_DevicePutWare = 111,
/// <summary>
/// 料仓出库,,叉子从出料口返回,,轴3( 叉子) 动作至P1( 待机点)
/// </summary>
SO_12_DeviceOutFromDoor = 112,
/// <summary>
/// 料仓出库,,升降轴返回,, 轴2至P1( 待机点)
/// </summary>
SO_13_GoBack = 113,
/// <summary>
/// 等待拿走物品
/// </summary>
SO_14_WaitTake=114,
#endregion
#region 料仓内部入库步骤
/// <summary>
/// 入库检测
/// </summary>
SI_00_TrayCheck=200,
/// <summary>
/// 入库,。定位气缸下降
/// </summary>
SI_01_LocationCylinderDown=201,
/// <summary>
/// 入库。。进出轴(叉子)先返回P1
/// </summary>
SI_02_InOutAxisHome = 202,
/// <summary>
/// 入库。。所有轴先回到待机点,轴2、轴1 动作到P1,,轴4动作至P3
/// </summary>
SI_03_ReturnHome = 203,
/// <summary>
/// 入库。。压紧物品(有压紧轴的才需要此步骤),轴4( 压紧) 至P3(压紧前点)
/// </summary>
SI_04_CompressWare = 204,
/// <summary>
/// 入库。。叉子进入入料口,轴3( 叉子) 至P2( 进料口取料点)
/// </summary>
SI_05_DeviceToDoor = 205,
/// <summary>
/// 入库。。把物品放入叉子上,轴2( 上下) 至P7( 进料口取料缓冲点),压紧物品(有压紧轴的才需要此步骤),轴4( 压紧) 至P2(压紧点)
/// </summary>
SI_06_DoorWarToDevice = 206,
/// <summary>
/// 入库。。叉子 从入料口抽出,轴3( 叉子) 至P1( 待机点)
/// </summary>
SI_07_DeviceBackFromDoor = 207,
/// <summary>
/// 入库。。,定位气缸伸出 (有压紧轴的不需要此步骤)
/// </summary>
SI_08_LocationCylinder_Up = 208,
/// <summary>
/// 入库。。移动到库位点,轴1( 转盘) 至P2( 库位点)轴2(上下) 至P3(库位入库前点)
/// </summary>
SI_09_MoveToBag = 209,
/// <summary>
/// 入库。。定位气缸退回 (有压紧轴的不需要此步骤)
/// </summary>
SI_10_LocationCylinder_Down = 210,
/// <summary>
/// 入库。。叉子进入库位中,轴3( 叉子) 至P3(库位取放料点)
/// </summary>
SI_11_DeviceToBag = 211,
/// <summary>
/// 入库。。放下物品,轴2( 上下) 至P4( 库位入料缓冲点)轴4( 压紧) 至P3( 压紧前点)
/// </summary>
SI_12_PutWareToBag = 212,
/// <summary>
/// 入库。。叉子从库位中返回,轴3( 叉子) 动作至P1( 待机点)
/// </summary>
SI_13_DeviceBackFromBag = 213,
/// <summary>
/// 入库。。返回待机点,轴2/轴1/轴4动作至P1( 待机点))开始
/// </summary>
SI_14_GoBack = 214,
#endregion
#region 手动料仓出入库步骤
/// <summary>
/// 手动料仓,已经写入开门IO
/// </summary>
M_Begin_OpenDoor = 1000,
/// <summary>
/// 手动料仓,已经收到开门信号
/// </summary>
M_End_OpenDoor = 1001,
/// <summary>
/// 手动料仓,已经收到关门信号
/// </summary>
M_CloseDoor = 1002,
#endregion
#region 移栽装置原点返回和重置步骤
/// <summary>
/// 料仓移栽装置,,上下气缸上升端
/// </summary>
H_UpDownCylinder_Up = 2001,
/// <summary>
/// 料仓移载装置,其他气缸运行到初始状态( 顶升气缸下降端,前后气缸后退端,夹料气缸放松端,阻挡气缸输入=0 )
/// </summary>
H_OtherCylinder_Back = 2002,
#endregion
#region 流水线入仓操作
/// <summary>
/// 流水线入仓,开始扫码 扫描枪触发,数据处理
/// </summary>
LI_Scannering = 10001,
/// <summary>
/// 流水线入仓,料仓号及库位号发送, 夹具号编码记忆(X5,X6.X7)数据接收
/// </summary>
LI_WaitServerResult = 10002,
/// <summary>
/// 等待100毫秒后再放行
/// </summary>
LI_00_Wait100 = 10003,
/// <summary>
/// 阻挡气缸0-2下降
/// </summary>
LI_01_StopCylinder2Down = 10004,
/// <summary>
/// 检测夹具检测1=0 ) 开始
/// </summary>
LI_02_FixtureCheck = 10005,
/// <summary>
/// 阻挡气缸0-2上升
/// </summary>
LI_03_StopCylinder2Up = 10006,
/// <summary>
/// 阻挡气缸0-1下降
/// </summary>
LI_04_StopCylinder1Down = 10007,
#endregion
#region 流水线出库操作
/// <summary>
/// 流水线出库,等待100毫秒之后在放行
/// </summary>
LO_00_Wait100 = 11000,
/// <summary>
/// 流水线出库,阻挡气缸0-2下降
/// </summary>
LO_01_StopCylinder2Down = 11001,
/// <summary>
/// 流水线出库, 检测夹具检测1=0
/// </summary>
LO_02_FixtureCheck = 11002,
/// <summary>
/// 流水线出库,阻挡气缸0-2上升( Y13=0)
/// </summary>
LO_03_StopCylinder2Up = 11003,
/// <summary>
/// 阻挡气缸0-1下降(Y12=1)
/// </summary>
LO_04_StopCylinder1Up = 11004,
#endregion
#region 移栽装置出入库共同模块
/// <summary>
///移载(流水线)装置出入库处理,, 阻挡气缸1-1下降( Y14=1)
/// </summary>
MIO_01_StopCylinder1Down = 3081,
/// <summary>
///移载(流水线)装置出入库处理,,夹具检测1-4=1
/// </summary>
MIO_02_FixtureCheck = 3082,
/// <summary>
///移载(流水线)装置出入库处理,,阻挡气缸1-1上升( Y14=0)
/// </summary>
MIO_03_StopCylinder2Down = 3083,
/// <summary>
/// 检测夹具检测IO1=1
/// </summary>
MIO_04_Check1High = 3084,
/// <summary>
/// 等待一秒钟
/// </summary>
MIO_05_WaitTime = 3085,
/// <summary>
///移载(流水线)装置出入库处理,,顶 升 气缸 上 升 (Y17 =0/Y1 16 =1 )检测X17=0X16=1
/// </summary>
MIO_06_TopCylinderUp = 3086,
/// <summary>
/// 此处 顶升气缸上升时等待一秒钟,再下降,现在看起来没有升到位就下降
/// </summary>
MIO_07_TopCylinderUpWait = 3087,
/// <summary>
/// 等待StoreMove完成当前操作开始入库
/// </summary>
MIO_08_WaitInStore=3088,
/// <summary>
/// 等待StoreMove移走料盘开始放托盘通过
/// </summary>
MIO_09_WaitLetFixtureGo=3089,
#endregion
#region 移栽装置出库处理
/// <summary>
/// 移载(流水线)装置出库处理, 检测夹具编码并记忆,托盘 是空盘,并且BOX在出库等待中,开始移栽料盘
/// </summary>
MO_05_CodeRember = 3105,
/// <summary>
/// 移载(流水线)装置出库处理,, ,顶升气缸1下降(Y16=0/Y17=1)
/// </summary>
MO_09_TopCylinder_Down = 3109,
/// <summary>
/// 移载(流水线)装置出库处理,, 阻挡气缸1-2下降( Y15=1)
/// </summary>
MO_10_StopCylinder2_Down = 3110,
/// <summary>
/// 移载(流水线)装置出库处理,, 夹具检测1-4=0,
/// </summary>
MO_11_Tray_Check = 3111,
/// <summary>
/// 移载(流水线)装置出库处理,,阻挡气缸1-1下降( Y14=1)阻挡气缸1-2上升( Y15=0)
/// </summary>
MO_12_StopCylinder_Back = 3112,
/// <summary>
/// 移栽装置出库处理。。前后气缸1前进
/// </summary>
MO_51_BeforeAfterCylinderBefore = 3151,
/// <summary>
/// 移栽装置出库处理。。 上下气缸1下降(Y22=0/Y23=1)
/// </summary>
MO_52_UpDownCylinderDown = 3152,
/// <summary>
/// 移栽装置出库处理。。 上下气缸1下降后,等待0.3秒再夹紧,防止没有下降到位就夹紧操作
/// </summary>
MO_53_UpDownCylinderDownWait = 3153,
/// <summary>
/// 移栽装置出库处理。 夹料气缸1夹紧( Y25=0/Y24=1)
/// </summary>
MO_54_ClampCylinderSlack = 3154,
/// <summary>
/// 移栽装置出库处理。。 上下气缸1上升(Y22=1/Y23=0)
/// </summary>
MO_55_UpDownCylinderUp = 3155,
/// <summary>
/// 移栽装置出库处理。。 前后气缸1后退( Y20=0/Y21=1)
/// </summary>
MO_56_BeforeAfterCylinderAfter = 3156,
/// <summary>
/// 移载(流水线)装置出库处理,,, 上下气缸1下降(Y22=0/Y23=1)
/// </summary>
MO_58_UpDownCylinderDown = 3158,
/// <summary>
/// 移载(流水线)装置出库处理,, 夹料气缸1放松( Y25=1/Y24=0)
/// </summary>
MO_59_ClampCylinderTighten = 3159,
/// <summary>
/// 移载(流水线)装置出库处理,, ,上下气缸1上升(Y22=1/Y23=0)
/// </summary>
MO_60_UpDownCylinderUp = 3160,
#endregion
#region 移载装置入库处理
/// <summary>
///移载装置入库处理,,检测 夹具编码( X1 3,X14,X15)
/// </summary>
MI_05_CodeCheck = 3005,
/// <summary>
/// 移载装置入库处理,,等待box等待状态才能继续操作
/// </summary>
MI_10_WaitBox=3006,
/// <summary>
///移载装置入库处理,,编码与仓位一致,,上下气缸1下降(Y22=0/Y23=1)
/// </summary>
MI_07_UpDownCylinderDown = 3007,
/// <summary>
///移载装置入库处理,,编码与仓位一致,,上下气缸1下降后,等待0.3秒,防止没有 下降到位就夹紧
/// </summary>
MI_07_UpDownCylinderDownWait = 3024,
/// <summary>
///移载装置入库处理,, 夹料气缸1夹紧( Y25=0/Y24=1)
/// </summary>
MI_08_ClampCylinderSlack = 3008,
/// <summary>
///移载装置入库处理,, 上下气缸1上升(Y22=1/Y23=0)
/// </summary>
MI_09_UpDownCylinderUp = 3009,
/// <summary>
///移载装置入库处理,, ,前后气缸1前进( Y20=1/Y21=0)
/// </summary>
MI_10_BeforeAfterCylinderBefore = 3010,
/// <summary>
///移载装置入库处理,, 上下气缸1下降(Y22=0/Y23=1)
/// </summary>
MI_11_UpDownCylinderDown = 3011,
/// <summary>
///移载装置入库处理,, ,夹料气缸1放松( Y25=1/Y24=0)
/// </summary>
MI_12_ClampCylinderTighten = 3012,
/// <summary>
///移载装置入库处理,, 上下气缸1上升(Y22=1/Y23=0)
/// </summary>
MI_13_UpdownCylinderUp = 3013,
/// <summary>
///移载装置入库处理,, ,前后气缸1后退( Y20=0/Y21=1)
/// </summary>
MI_14_BeforeAfterCylinderAfter = 3014,
/// <summary>
///移载装置入库处理,, 检测到X102-1=1送料流程完成
/// </summary>
MI_15_SendEnd = 3015,
/// <summary>
///移载装置入库处理,,编码不一致,,顶升气缸1下降(Y16=0/Y17=1)
/// </summary>
MI_20_TopCylinderDown = 3020,
/// <summary>
///移载装置入库处理,,阻挡气缸1-2下降( Y15=1),
/// </summary>
MI_21_StopCylinderDown = 3021,
/// <summary>
///移载装置入库处理,检测Check4=0,
/// </summary>
MI_22_FixtureCheck_Low = 3022,
/// <summary>
///移载装置入库处理,,,阻挡气缸1-2 上升( Y15=0),等待200毫秒
/// </summary>
MI_23_StopCylinderReset = 3023,
#endregion
//后面的是双层料仓的类型 值从20000开始
#region 双层流水线调宽和处理
/// <summary>
/// 双层料仓流水线模块 。检测到板子进入,打开流水线
/// </summary>
LINEIN_OpenLine = 20000,
/// <summary>
/// 双层料仓流水线模块 。等待下位机要料信号=High
/// </summary>
LINEIN_WaitOutSingle = 20001,
/// <summary>
/// 双层料仓流水线模块 。检测到出料口信号=Low
/// </summary>
LINEIN_WaitOutSingleLow = 20002,
/// <summary>
/// 关闭皮带
/// </summary>
LINEIN_CloseLine=20003,
/// <summary>
/// 等待下位机要料信号
/// </summary>
LINEIN_WatiMachineSingle=20004,
/// <summary>
/// 双层料仓流水线模块 。线体调宽回原点
/// </summary>
LINECW_LineReturnHome = 20010,
/// <summary>
/// 双层料仓流水线模块 。线体调宽回原点
/// </summary>
LINECW_LineChangeWidth = 20011,
/// <summary>
/// 流水线原点返回,设置速度
/// </summary>
LINEH_SetSpeed_001 = 20020,
/// <summary>
/// 流水线原点返回,反反向走到20000
/// </summary>
LINEH_RevertMove_002 = 20021,
/// <summary>
/// 流水线原点返回,开始原点返回
/// </summary>
LINEH_LineHome_003= 20022,
#endregion
#region 在线料仓入库处理
/// <summary>
///在线双层料仓:入仓: 等待料盘进入
/// </summary>
DB_SI_00_WaitIO = 20100,
/// <summary>
///在线双层料仓:入仓:扫描二维码中
/// </summary>
DB_SI_01_Scanning = 20101,
/// <summary>
/// 在线双层料仓:入仓:根据二维码从服务器获取仓位号
/// </summary>
DB_SI_02_GetBoxNum = 20102,
/// <summary>
///在线双层料仓: 同时动作
/// 电缸运行到入料口下方的位置 , 料仓旋转到对应的位置
/// </summary>
DB_SI_03_InStoreReadyMove = 20103,
/// <summary>
/// 在线双层料仓:入仓:(取料叉子进入料口)、
/// </summary>
DB_SI_04_TakeDeviceToDoor = 20104,
/// <summary>
/// 在线双层料仓:入仓:(电缸稍微移动到料口上端位置),
/// </summary>
DB_SI_05_ModbusUpToDoor = 20105,
/// <summary>
///在线双层料仓: 取出料盘
/// </summary>
DB_SI_06_TakeSITray = 20106,
/// <summary>
/// 在线双层料仓:入仓(电缸运行到对应仓位的下方,,旋转电机2正转)
/// </summary>
DB_SI_07_MoveToRoom = 20107,
/// <summary>
/// 在线双层料仓:入仓(取料叉子进入仓位)
/// </summary>
DB_SI_08_TakeDeviceToRoom = 20108,
/// <summary>
///在线双层料仓: 入仓(电缸微动至对应料仓的下端位置)
/// </summary>
DB_SI_09_PutToRoom = 20109,
/// <summary>
/// 在线双层料仓:从仓位出来
/// </summary>
DB_SI_10_SIFromRoom = 20110,
/// <summary>
///在线双层料仓: 旋转电机2反转,回到中间等待位置
/// </summary>
DB_SI_11_MoveSIFromRoom = 20111,
/// <summary>
/// 在线双层料仓:关闭仓门
/// </summary>
DB_SI_12_CloseDoor = 20112,
#endregion
#region 在线料仓出库处理
/// <summary>
///在线双层料仓:: 出库处理:等待执行出库
/// </summary>
DB_SO_00_WaitStart = 20200,
/// <summary>
///在线双层料仓:
/// </summary>
DB_SO_01_Scanning = 20201,
/// <summary>
/// 在线双层料仓:
/// </summary>
DB_SO_02_GetBoxNum = 20202,
/// <summary>
///在线双层料仓:出库执行 同时动作
/// 电缸运行到入料口下方的位置 ,料仓旋转到对应的位置,旋转电机2正传
/// </summary>
DB_SO_03_ReadyMove = 20203,
/// <summary>
/// 在线双层料仓: 出仓:(取料叉子进入料仓)叉子前进
/// </summary>
DB_SO_04_TakeDeviceToDoor = 20204,
/// <summary>
/// 在线双层料仓: 出仓:(电缸稍微移动到料仓上端位置)
/// </summary>
DB_SO_05_ModbusUpToDoor = 20205,
/// <summary>
///在线双层料仓: 取出料盘,叉子后退
/// </summary>
DB_SO_06_TakeOutTray = 20206,
/// <summary>
/// 在线双层料仓: 出库执行(电缸移动至入料口的上端位置 旋转电机2正转)
/// </summary>
DB_SO_07_MoveToRoom = 20207,
/// <summary>
/// 在线双层料仓:出库执行 (叉子前进)
/// </summary>
DB_SO_08_TakeDeviceToRoom = 20208,
/// <summary>
///在线双层料仓: 出库执行 (电缸微动至对应料口的下端位置)
/// </summary>
DB_SO_09_PutToRoom = 20209,
/// <summary>
/// 在线双层料仓:出库执行 叉子后退
/// </summary>
DB_SO_10_OutFromRoom = 20210,
/// <summary>
/// 在线双层料仓:等待物料到达
/// </summary>
DB_SO_11_WaitTrayToDoor= 20211,
/// <summary>
/// 在线双层料仓:等待拿走料盘
/// </summary>
DB_SO_12_WaitTrayLeave = 20212,
///// <summary>
/////在线双层料仓:出库执行 旋转电机2反转,回到中间等待位置
///// </summary>
//DB_SO_11_MoveOutFromRoom = 20211,
///// <summary>
///// 在线双层料仓:出库执行(关闭仓门
///// </summary>
//DB_SO_CloseDoor = 20213,
#endregion
/// <summary>
/// 在线双层料仓:回原点:叉子退回
/// </summary>
DB_H_01_ForkBack = 20301,
/// <summary>
/// 在线双层料仓:回原点:同时动作:转盘低速旋转 , 电缸回到原位 ,( I/O点控制) 旋转气缸旋回
/// </summary>
DB_H_02_BackHome= 20302,
/// <summary>
/// 在线双层料仓:回原点:旋回完成
/// </summary>
DB_H_03_BackEnd = 20303,
/// <summary>
/// 在线双层料仓:回原点:原点开关点亮,原点开关点亮,旋回端开关点亮,,转盘停止 ,电缸停止, 清理电钢和转盘的位置信息
/// </summary>
DB_H_04_ClearPosition = 20304,
}
public enum StoreAlarmType
{
/// <summary>
/// 没有报警
/// </summary>
None = 0,
/// <summary>
/// 轴报警
/// </summary>
AxisAlarm = 1,
/// <summary>
/// 收到急停
/// </summary>
SuddenStop = 10,
/// <summary>
/// 没有气压信号
/// </summary>
NoAirCheck = 11,
/// <summary>
/// 轴运动错误,没有达到指定脉冲,但是io判断已停止运动
/// </summary>
AxisMoveError = 20,
/// <summary>
/// io信号超时未收到
/// </summary>
IoSingleTimeOut = 30,
/// <summary>
/// 电钢报警
/// </summary>
StellAlarm=50,
}
}