1
czw
2025-06-21 e788601bc3a2028f1e573796e038f3d6cb9961b3
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
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
{
  "ProjectSn": "",
  "Directory": "",
  "Snippets": [
    {
      "ID": "20250226153120175",
      "Name": "业务逻辑",
      "Desc": "",
      "Content": "",
      "ContentCopy": "",
      "ParentID": "",
      "Children": [
        {
          "ID": "20250323111613779",
          "Name": "初始化配置",
          "Desc": "",
          "Content": " if (Tag.Global.SettingsOver == 0)\r\n                        {\r\n                            SettingInit();\r\n                            Tag.Global.SettingsOver = 1;\r\n                        }\r\n                        else if(Settings.deviceInfos.Count == 0)\r\n                        {\r\n                            Tag.Global.SettingsOver = 0;\r\n                        }\r\n",
          "ContentCopy": " if (Tag.Global.SettingsOver == 0)\r\n                        {\r\n                            SettingInit();\r\n                            Tag.Global.SettingsOver = 1;\r\n                        }\r\n                        else if(Settings.deviceInfos.Count == 0)\r\n                        {\r\n                            Tag.Global.SettingsOver = 0;\r\n                        }\r\n",
          "ParentID": "20250226153120175",
          "Children": [],
          "Type": "Program",
          "Property": {
            "SyncExec": "False",
            "RepeatExec": "Until",
            "ExceCount": 1,
            "ExceInternal": 10000,
            "StartCondition": {
              "Type": "View",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {
                "20250306140515428": [
                  "Open"
                ]
              }
            },
            "EndCondition": {
              "Type": "None",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {}
            }
          },
          "FullName": "业务逻辑.初始化配置",
          "ParentFullName": "业务逻辑",
          "Enabled": "Enabled"
        },
        {
          "ID": "20250323151832119",
          "Name": "Program4",
          "Desc": "",
          "Content": "//Conn.默认Redis.SetValue(\"西门子2.Param3\",\"300\",\"西门子2Queue\");\r\n//return;\r\nif(false){\r\n                    List<string> locs = new List<string>() { \"vxr1l\", \"vx1r\", \"vxr1c1\", \"vxr1c2\", \"vxr2l\", \"vxr2r\", \"vxr2c1\", \"vxr2c2\" };\r\n                    List<string> sites = new List<string>() { \"196365BB283162\", \"193841BB283149\", \"198756BB287300\", \"198767BB286133\", \"206987BB282931\", \"204460BB282975\", \"209405BB287057\", \"209377BB285899\" };\r\n\r\n                    LocRepository locservice = new LocRepository();\r\n                    for (int i = 0; i < locs.Count; i++)\r\n                    {\r\n                        string loccode = locs[i];\r\n                        string sitesss = sites[i];\r\n                        var loc = locservice.FindEntity(x => x.S_LOC_CODE == loccode);\r\n                        if (loc == null)\r\n                        {\r\n                            locservice.Insert(new LocEntity\r\n                            {\r\n                                S_ID = Guid.NewGuid().ToString(),\r\n                                S_STATE = \"编辑\",\r\n                                T_CREATE = DateTime.Now,\r\n                                T_MODIFY = DateTime.Now,\r\n                                S_DEEP = \"vxr\",\r\n\r\n                                S_LOC_CODE = loccode,\r\n                                S_AGV_SITE = sitesss,\r\n\r\n                                S_LOCK_STATE = \"无\",\r\n                                N_ROW = 1,\r\n                                N_COL = 1,\r\n                                N_AGV_CODE = 0,\r\n                                N_AGV_SITE_LAYER = 0,\r\n                                N_CAPACITY = 1,\r\n                                N_CURRENT_NUM = 0,\r\n                                S_TYPE = \"\",\r\n\r\n                            });\r\n                        }\r\n                    }\r\n                   // TaskProcess.CreateTask(\"\", locs[6], locs[7], \"test\", 9, new List<string> { \"test\" }, 1, 1, 1);\r\n                   }\r\n",
          "ContentCopy": "//Conn.默认Redis.SetValue(\"西门子2.Param3\",\"300\",\"西门子2Queue\");\r\n//return;\r\nif(false){\r\n                    List<string> locs = new List<string>() { \"vxr1l\", \"vx1r\", \"vxr1c1\", \"vxr1c2\", \"vxr2l\", \"vxr2r\", \"vxr2c1\", \"vxr2c2\" };\r\n                    List<string> sites = new List<string>() { \"196365BB283162\", \"193841BB283149\", \"198756BB287300\", \"198767BB286133\", \"206987BB282931\", \"204460BB282975\", \"209405BB287057\", \"209377BB285899\" };\r\n\r\n                    LocRepository locservice = new LocRepository();\r\n                    for (int i = 0; i < locs.Count; i++)\r\n                    {\r\n                        string loccode = locs[i];\r\n                        string sitesss = sites[i];\r\n                        var loc = locservice.FindEntity(x => x.S_LOC_CODE == loccode);\r\n                        if (loc == null)\r\n                        {\r\n                            locservice.Insert(new LocEntity\r\n                            {\r\n                                S_ID = Guid.NewGuid().ToString(),\r\n                                S_STATE = \"编辑\",\r\n                                T_CREATE = DateTime.Now,\r\n                                T_MODIFY = DateTime.Now,\r\n                                S_DEEP = \"vxr\",\r\n\r\n                                S_LOC_CODE = loccode,\r\n                                S_AGV_SITE = sitesss,\r\n\r\n                                S_LOCK_STATE = \"无\",\r\n                                N_ROW = 1,\r\n                                N_COL = 1,\r\n                                N_AGV_CODE = 0,\r\n                                N_AGV_SITE_LAYER = 0,\r\n                                N_CAPACITY = 1,\r\n                                N_CURRENT_NUM = 0,\r\n                                S_TYPE = \"\",\r\n\r\n                            });\r\n                        }\r\n                    }\r\n                   // TaskProcess.CreateTask(\"\", locs[6], locs[7], \"test\", 9, new List<string> { \"test\" }, 1, 1, 1);\r\n                   }\r\n",
          "ParentID": "20250226153120175",
          "Children": [],
          "Type": "Program",
          "Property": {
            "SyncExec": "True",
            "RepeatExec": "Count",
            "ExceCount": 1,
            "ExceInternal": 3000,
            "StartCondition": {
              "Type": "View",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {
                "20250306140515428": [
                  "Open"
                ]
              }
            },
            "EndCondition": {
              "Type": "None",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {}
            }
          },
          "FullName": "业务逻辑.Program4",
          "ParentFullName": "业务逻辑",
          "Enabled": "Enabled"
        },
        {
          "ID": "20250325083047245",
          "Name": "第三标段",
          "Desc": "",
          "Content": "",
          "ContentCopy": "",
          "ParentID": "20250226153120175",
          "Children": [
            {
              "ID": "20250325083325390",
              "Name": "捷瞬抓臂1",
              "Desc": "",
              "Content": "var VERX = Settings.deviceInfos?.Find(x =>x.deviceType==2&& x.deviceName == \"Js捷顺1\");\r\n\r\n if (VERX != null)\r\n                        {\r\n                            if (tag.Js1.D1212_LAST == 0 && TcpServer.GetBitdata(tag.Js1.D1212, 2) == 1)\r\n                            {\r\n                                var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                {\r\n                                    requestType = 4,\r\n                                    endBit = VERX.location[0]\r\n                                }));\r\n                                LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n                                if (str.Contains(\"true\"))\r\n                                {\r\n                                    tag.Js1.D1212_LAST = 1;\r\n                                }\r\n                            }\r\n                            if(tag.Js1.D1212_LAST == 1 &&TcpServer.GetBitdata(tag.Js1.D1212, 2) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js1.D1212_LAST = 0;\r\n                            }\r\n\t\t\t\t\t\t\tif (tag.Js1.D1213_LAST == 0 && TcpServer.GetBitdata(tag.Js1.D1212, 3) == 1)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tvar str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\trequestType = 4,\r\n\t\t\t\t\t\t\t\t\tendBit = VERX.location[1]\r\n\t\t\t\t\t\t\t\t}));\r\n\t\t\t\t\t\t\t\tLogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n\t\t\t\t\t\t\t\tif (str.Contains(\"true\"))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\ttag.Js1.D1213_LAST = 1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}if(tag.Js1.D1213_LAST == 1 &&TcpServer.GetBitdata(tag.Js1.D1212, 3) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js1.D1213_LAST = 0;\r\n                            }\r\n                        }",
              "ContentCopy": "var VERX = Settings.deviceInfos?.Find(x =>x.deviceType==2&& x.deviceName == \"Js捷顺1\");\r\n\r\n if (VERX != null)\r\n                        {\r\n                            if (tag.Js1.D1212_LAST == 0 && TcpServer.GetBitdata(tag.Js1.D1212, 2) == 1)\r\n                            {\r\n                                var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                {\r\n                                    requestType = 4,\r\n                                    endBit = VERX.location[0]\r\n                                }));\r\n                                LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n                                if (str.Contains(\"true\"))\r\n                                {\r\n                                    tag.Js1.D1212_LAST = 1;\r\n                                }\r\n                            }\r\n                            if(tag.Js1.D1212_LAST == 1 &&TcpServer.GetBitdata(tag.Js1.D1212, 2) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js1.D1212_LAST = 0;\r\n                            }\r\n\t\t\t\t\t\t\tif (tag.Js1.D1213_LAST == 0 && TcpServer.GetBitdata(tag.Js1.D1212, 3) == 1)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tvar str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\trequestType = 4,\r\n\t\t\t\t\t\t\t\t\tendBit = VERX.location[1]\r\n\t\t\t\t\t\t\t\t}));\r\n\t\t\t\t\t\t\t\tLogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n\t\t\t\t\t\t\t\tif (str.Contains(\"true\"))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\ttag.Js1.D1213_LAST = 1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}if(tag.Js1.D1213_LAST == 1 &&TcpServer.GetBitdata(tag.Js1.D1212, 3) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js1.D1213_LAST = 0;\r\n                            }\r\n                        }",
              "ParentID": "20250325083047245",
              "Children": [],
              "Type": "Program",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "Until",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "View",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {
                    "20250306140515428": [
                      "Open"
                    ]
                  }
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.第三标段.捷瞬抓臂1",
              "ParentFullName": "业务逻辑.第三标段",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250325083326611",
              "Name": "捷瞬抓臂2",
              "Desc": "",
              "Content": "//jsz2捷瞬抓臂2\r\n\r\n                       var VERX = Settings.deviceInfos?.Find(x =>x.deviceType==2&& x.deviceName == \"Js捷顺2\");\r\n\r\n                        if (VERX != null)\r\n                        {\r\n                            if (tag.Js2.D1212_LAST == 0 && TcpServer.GetBitdata(tag.Js2.D1212, 2) == 1)\r\n                            {\r\n                                var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                {\r\n                                    requestType = 4,\r\n                                    endBit = VERX.location[0]\r\n                                }));\r\n                                LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n                                if (str.Contains(\"true\"))\r\n                                {\r\n                                    tag.Js2.D1212_LAST = 1;\r\n                                }\r\n                            } if(tag.Js2.D1212_LAST == 1 &&TcpServer.GetBitdata(tag.Js2.D1212, 2) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js2.D1212_LAST = 0;\r\n                            }\r\n                            if (tag.Js2.D1213_LAST == 0 && TcpServer.GetBitdata(tag.Js2.D1212, 3) == 1)\r\n                            {\r\n                                var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                {\r\n                                    requestType = 4,\r\n                                    endBit = VERX.location[1]\r\n                                }));\r\n                                LogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n                                if (str.Contains(\"true\"))\r\n                                {\r\n                                    tag.Js2.D1213_LAST = 1;\r\n                                }\r\n                            }if(tag.Js2.D1213_LAST == 1 &&TcpServer.GetBitdata(tag.Js2.D1213, 2) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js2.D1213_LAST = 0;\r\n                            }\r\n                        }",
              "ContentCopy": "//jsz2捷瞬抓臂2\r\n\r\n                       var VERX = Settings.deviceInfos?.Find(x =>x.deviceType==2&& x.deviceName == \"Js捷顺2\");\r\n\r\n                        if (VERX != null)\r\n                        {\r\n                            if (tag.Js2.D1212_LAST == 0 && TcpServer.GetBitdata(tag.Js2.D1212, 2) == 1)\r\n                            {\r\n                                var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                {\r\n                                    requestType = 4,\r\n                                    endBit = VERX.location[0]\r\n                                }));\r\n                                LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n                                if (str.Contains(\"true\"))\r\n                                {\r\n                                    tag.Js2.D1212_LAST = 1;\r\n                                }\r\n                            } if(tag.Js2.D1212_LAST == 1 &&TcpServer.GetBitdata(tag.Js2.D1212, 2) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js2.D1212_LAST = 0;\r\n                            }\r\n                            if (tag.Js2.D1213_LAST == 0 && TcpServer.GetBitdata(tag.Js2.D1212, 3) == 1)\r\n                            {\r\n                                var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                {\r\n                                    requestType = 4,\r\n                                    endBit = VERX.location[1]\r\n                                }));\r\n                                LogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n                                if (str.Contains(\"true\"))\r\n                                {\r\n                                    tag.Js2.D1213_LAST = 1;\r\n                                }\r\n                            }if(tag.Js2.D1213_LAST == 1 &&TcpServer.GetBitdata(tag.Js2.D1213, 2) == 0){\r\n\t\t\t\t\t\t\t\ttag.Js2.D1213_LAST = 0;\r\n                            }\r\n                        }",
              "ParentID": "20250325083047245",
              "Children": [],
              "Type": "Program",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "Until",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "View",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {
                    "20250306140515428": [
                      "Open"
                    ]
                  }
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.第三标段.捷瞬抓臂2",
              "ParentFullName": "业务逻辑.第三标段",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250325085810885",
              "Name": "自流转流程",
              "Desc": "",
              "Content": "//foreach(var di in Settings.deviceInfos)\r\n//\tif (di.deviceType == 2 || di.deviceType == 1)\r\n//\tRunafterMac(di,true);\r\n\t/// TODO  mes 下发。   改成机械臂监控 -  监控空的还是满的 - 联动mes 任务。",
              "ContentCopy": "//foreach(var di in Settings.deviceInfos)\r\n//\tif (di.deviceType == 2 || di.deviceType == 1)\r\n//\tRunafterMac(di,true);\r\n\t/// TODO  mes 下发。   改成机械臂监控 -  监控空的还是满的 - 联动mes 任务。",
              "ParentID": "20250325083047245",
              "Children": [],
              "Type": "Program",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "Until",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "View",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {
                    "20250306140515428": [
                      "Open"
                    ]
                  }
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.第三标段.自流转流程",
              "ParentFullName": "业务逻辑.第三标段",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250610002001052",
              "Name": "维系尔1号",
              "Desc": "",
              "Content": "",
              "ContentCopy": "",
              "ParentID": "20250325083047245",
              "Children": [
                {
                  "ID": "20250325083149366",
                  "Name": "维希尔抓臂1L",
                  "Desc": "",
                  "Content": "\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"1\"));\r\n\r\n                        if (VERX != null)\r\n                        {\r\n                            if (tag.wxr1.R44 && !tag.wxr1.R44_LAST && tag.wxr1.R10)\r\n                            {\r\n                                if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0], out string traycode))\r\n                                {\r\n                                    var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                    {\r\n                                        requestType = 1,\r\n                                        cntrCode = traycode,\r\n                                        startBit = VERX.location[0],\r\n                                        endBit = \"\"\r\n                                    }));\r\n                                    LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n                                    if (str.Contains(\"true\"))\r\n                                    {\r\n                                        tag.wxr1.R44_LAST = true; \r\n                                    }\r\n                                }\r\n                                else\r\n                                {\r\n                                    TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n                                }\r\n                            }\r\n                            else\r\n                            {\r\n                               //TaskRepository ts = new TaskRepository();\r\n                                if (tag.wxr1.R10_LAST) //托盘放置信号。。\r\n                                {\r\n                                \tif (tag.wxr1.R10)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\ttag.wxr1.R10_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n                                    if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0],out string traycode))\r\n                                    {\r\n                                        //上报校验。\r\n                                        ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n                                        var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n                                        {\r\n                                            sceneType = 1,\r\n                                            cntrCode = traycode,\r\n                                        }));\r\n                                        if (str.Contains(\"true\"))\r\n                                        {\r\n                                            //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n                                            tag.wxr1.R10 = true;\r\n                                            tag.wxr1.R44_LAST = false;\r\n                                        }\r\n                                        else\r\n                                        {\r\n                                            //报警。\r\n                                        }\r\n                                    }\r\n                                    else { TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n                                }\r\n                            }\r\n                        }",
                  "ContentCopy": "\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"1\"));\r\n\r\n                        if (VERX != null)\r\n                        {\r\n                            if (tag.wxr1.R44 && !tag.wxr1.R44_LAST && tag.wxr1.R10)\r\n                            {\r\n                                if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0], out string traycode))\r\n                                {\r\n                                    var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                    {\r\n                                        requestType = 1,\r\n                                        cntrCode = traycode,\r\n                                        startBit = VERX.location[0],\r\n                                        endBit = \"\"\r\n                                    }));\r\n                                    LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n                                    if (str.Contains(\"true\"))\r\n                                    {\r\n                                        tag.wxr1.R44_LAST = true; \r\n                                    }\r\n                                }\r\n                                else\r\n                                {\r\n                                    TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n                                }\r\n                            }\r\n                            else\r\n                            {\r\n                               //TaskRepository ts = new TaskRepository();\r\n                                if (tag.wxr1.R10_LAST) //托盘放置信号。。\r\n                                {\r\n                                \tif (tag.wxr1.R10)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\ttag.wxr1.R10_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n                                    if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0],out string traycode))\r\n                                    {\r\n                                        //上报校验。\r\n                                        ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n                                        var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n                                        {\r\n                                            sceneType = 1,\r\n                                            cntrCode = traycode,\r\n                                        }));\r\n                                        if (str.Contains(\"true\"))\r\n                                        {\r\n                                            //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n                                            tag.wxr1.R10 = true;\r\n                                            tag.wxr1.R44_LAST = false;\r\n                                        }\r\n                                        else\r\n                                        {\r\n                                            //报警。\r\n                                        }\r\n                                    }\r\n                                    else { TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n                                }\r\n                            }\r\n                        }",
                  "ParentID": "20250610002001052",
                  "Children": [],
                  "Type": "Program",
                  "Property": {
                    "SyncExec": "False",
                    "RepeatExec": "Until",
                    "ExceCount": 1,
                    "ExceInternal": 3000,
                    "StartCondition": {
                      "Type": "View",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {
                        "20250306140515428": [
                          "Open"
                        ]
                      }
                    },
                    "EndCondition": {
                      "Type": "None",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {}
                    }
                  },
                  "FullName": "业务逻辑.第三标段.维系尔1号.维希尔抓臂1L",
                  "ParentFullName": "业务逻辑.第三标段.维系尔1号",
                  "Enabled": "Enabled"
                },
                {
                  "ID": "20250610002047005",
                  "Name": "维希尔抓臂1R",
                  "Desc": "",
                  "Content": "var VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"1\"));\r\n\r\n                        if (VERX != null)\r\n                        {\r\n                            if (tag.wxr1.R46 && !tag.wxr1.R46_LAST && tag.wxr1.R11)\r\n                            {\r\n                                if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1], out string traycode))\r\n                                {\r\n                                    var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                    {\r\n                                        requestType = 1,\r\n                                        cntrCode = traycode,\r\n                                        startBit = VERX.location[1],\r\n                                        endBit = \"\"\r\n                                    }));\r\n                                    LogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n                                    if (str.Contains(\"true\"))\r\n                                    {\r\n                                        tag.wxr1.R46_LAST = true; \r\n                                    }\r\n                                }\r\n                                else\r\n                                {\r\n                                    TcpServer.TcpServerSend(VERX.deviceNo[1], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n                                }\r\n                            }\r\n                            else\r\n                            {\r\n                                if (tag.wxr1.R11_LAST) //托盘放置信号。。\r\n                                {\r\n                                \tif (tag.wxr1.R11)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\ttag.wxr1.R11_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n                                    if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1],out string traycode))\r\n                                    {\r\n                                        //上报校验。\r\n                                        ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n                                        var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n                                        {\r\n                                            sceneType = 1,\r\n                                            cntrCode = traycode,\r\n                                        }));\r\n                                        if (str.Contains(\"true\"))\r\n                                        {\r\n                                            //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n                                            tag.wxr1.R11 = true;\r\n                                            tag.wxr1.R46_LAST = false;\r\n                                        }\r\n                                        else\r\n                                        {\r\n                                            //报警。\r\n                                        }\r\n                                    }\r\n                                    else { TcpServer.TcpServerSend(VERX.deviceNo[1], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n                                }\r\n                            }\r\n                        }",
                  "ContentCopy": "var VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"1\"));\r\n\r\n                        if (VERX != null)\r\n                        {\r\n                            if (tag.wxr1.R46 && !tag.wxr1.R46_LAST && tag.wxr1.R11)\r\n                            {\r\n                                if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1], out string traycode))\r\n                                {\r\n                                    var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                    {\r\n                                        requestType = 1,\r\n                                        cntrCode = traycode,\r\n                                        startBit = VERX.location[1],\r\n                                        endBit = \"\"\r\n                                    }));\r\n                                    LogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n                                    if (str.Contains(\"true\"))\r\n                                    {\r\n                                        tag.wxr1.R46_LAST = true; \r\n                                    }\r\n                                }\r\n                                else\r\n                                {\r\n                                    TcpServer.TcpServerSend(VERX.deviceNo[1], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n                                }\r\n                            }\r\n                            else\r\n                            {\r\n                                if (tag.wxr1.R11_LAST) //托盘放置信号。。\r\n                                {\r\n                                \tif (tag.wxr1.R11)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\ttag.wxr1.R11_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n                                    if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1],out string traycode))\r\n                                    {\r\n                                        //上报校验。\r\n                                        ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n                                        var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n                                        {\r\n                                            sceneType = 1,\r\n                                            cntrCode = traycode,\r\n                                        }));\r\n                                        if (str.Contains(\"true\"))\r\n                                        {\r\n                                            //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n                                            tag.wxr1.R11 = true;\r\n                                            tag.wxr1.R46_LAST = false;\r\n                                        }\r\n                                        else\r\n                                        {\r\n                                            //报警。\r\n                                        }\r\n                                    }\r\n                                    else { TcpServer.TcpServerSend(VERX.deviceNo[1], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n                                }\r\n                            }\r\n                        }",
                  "ParentID": "20250610002001052",
                  "Children": [],
                  "Type": "Program",
                  "Property": {
                    "SyncExec": "False",
                    "RepeatExec": "Until",
                    "ExceCount": 1,
                    "ExceInternal": 3000,
                    "StartCondition": {
                      "Type": "View",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {
                        "20250306140515428": [
                          "Open"
                        ]
                      }
                    },
                    "EndCondition": {
                      "Type": "None",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {}
                    }
                  },
                  "FullName": "业务逻辑.第三标段.维系尔1号.维希尔抓臂1R",
                  "ParentFullName": "业务逻辑.第三标段.维系尔1号",
                  "Enabled": "Enabled"
                }
              ],
              "Type": "Group",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "None",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.第三标段.维系尔1号",
              "ParentFullName": "业务逻辑.第三标段",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250610002414741",
              "Name": "维系尔2号",
              "Desc": "",
              "Content": "",
              "ContentCopy": "",
              "ParentID": "20250325083047245",
              "Children": [
                {
                  "ID": "20250325083315503",
                  "Name": "维希尔抓臂2L",
                  "Desc": "",
                  "Content": "\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"2\"));\r\n\r\n                        if (VERX != null)\r\n                        {\r\n                            if (tag.wxr2.R44 && !tag.wxr2.R44_LAST && tag.wxr2.R10)\r\n                            {\r\n                                if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0], out string traycode))\r\n                                {\r\n                                    var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                    {\r\n                                        requestType = 1,\r\n                                        cntrCode = traycode,\r\n                                        startBit = VERX.location[0],\r\n                                        endBit = \"\"\r\n                                    }));\r\n                                    LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n                                    if (str.Contains(\"true\"))\r\n                                    {\r\n                                        tag.wxr2.R44_LAST = true; \r\n                                    }\r\n                                }\r\n                                else\r\n                                {\r\n                                    TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n                                }\r\n                            }\r\n                            else\r\n                            {\r\n                                if (tag.wxr2.R10_LAST) //托盘放置信号。。\r\n                                {\r\n                                \tif (tag.wxr2.R10)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\ttag.wxr2.R10_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n                                    if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0],out string traycode))\r\n                                    {\r\n                                        //上报校验。\r\n                                        ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n                                        var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n                                        {\r\n                                            sceneType = 1,\r\n                                            cntrCode = traycode,\r\n                                        }));\r\n                                        if (str.Contains(\"true\"))\r\n                                        {\r\n                                            //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n                                            tag.wxr2.R10 = true;\r\n                                            tag.wxr2.R44_LAST = false;\r\n                                        }\r\n                                        else\r\n                                        {\r\n                                            //报警。\r\n                                        }\r\n                                    }\r\n                                    else { TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n                                }\r\n                            }\r\n                        }",
                  "ContentCopy": "\r\nvar VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"2\"));\r\n\r\n                        if (VERX != null)\r\n                        {\r\n                            if (tag.wxr2.R44 && !tag.wxr2.R44_LAST && tag.wxr2.R10)\r\n                            {\r\n                                if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0], out string traycode))\r\n                                {\r\n                                    var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                    {\r\n                                        requestType = 1,\r\n                                        cntrCode = traycode,\r\n                                        startBit = VERX.location[0],\r\n                                        endBit = \"\"\r\n                                    }));\r\n                                    LogHelper.Info($\"{VERX.location[0]}申请mes任务结果{str}\");\r\n                                    if (str.Contains(\"true\"))\r\n                                    {\r\n                                        tag.wxr2.R44_LAST = true; \r\n                                    }\r\n                                }\r\n                                else\r\n                                {\r\n                                    TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n                                }\r\n                            }\r\n                            else\r\n                            {\r\n                                if (tag.wxr2.R10_LAST) //托盘放置信号。。\r\n                                {\r\n                                \tif (tag.wxr2.R10)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\ttag.wxr2.R10_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n                                    if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[0],out string traycode))\r\n                                    {\r\n                                        //上报校验。\r\n                                        ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n                                        var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n                                        {\r\n                                            sceneType = 1,\r\n                                            cntrCode = traycode,\r\n                                        }));\r\n                                        if (str.Contains(\"true\"))\r\n                                        {\r\n                                            //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n                                            tag.wxr2.R10 = true;\r\n                                            tag.wxr2.R44_LAST = false;\r\n                                        }\r\n                                        else\r\n                                        {\r\n                                            //报警。\r\n                                        }\r\n                                    }\r\n                                    else { TcpServer.TcpServerSend(VERX.deviceNo[0], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n                                }\r\n                            }\r\n                        }",
                  "ParentID": "20250610002414741",
                  "Children": [],
                  "Type": "Program",
                  "Property": {
                    "SyncExec": "False",
                    "RepeatExec": "Until",
                    "ExceCount": 1,
                    "ExceInternal": 3000,
                    "StartCondition": {
                      "Type": "View",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {
                        "20250306140515428": [
                          "Open"
                        ]
                      }
                    },
                    "EndCondition": {
                      "Type": "None",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {}
                    }
                  },
                  "FullName": "业务逻辑.第三标段.维系尔2号.维希尔抓臂2L",
                  "ParentFullName": "业务逻辑.第三标段.维系尔2号",
                  "Enabled": "Enabled"
                },
                {
                  "ID": "20250610002647095",
                  "Name": "维希尔抓臂2R",
                  "Desc": "",
                  "Content": "var VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"2\"));\r\n\r\n                        if (VERX != null)\r\n                        {\r\n                            if (tag.wxr2.R46 && !tag.wxr2.R46_LAST && tag.wxr2.R11)\r\n                            {\r\n                                if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1], out string traycode))\r\n                                {\r\n                                    var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                    {\r\n                                        requestType = 1,\r\n                                        cntrCode = traycode,\r\n                                        startBit = VERX.location[1],\r\n                                        endBit = \"\"\r\n                                    }));\r\n                                    LogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n                                    if (str.Contains(\"true\"))\r\n                                    {\r\n                                        tag.wxr2.R46_LAST = true; \r\n                                    }\r\n                                }\r\n                                else\r\n                                {\r\n                                    TcpServer.TcpServerSend(VERX.deviceNo[2], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n                                }\r\n                            }\r\n                            else\r\n                            {\r\n                               if (tag.wxr2.R11_LAST) //托盘放置信号。。\r\n                                {\r\n                                \tif (tag.wxr2.R11)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\ttag.wxr2.R11_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n                                    if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1],out string traycode))\r\n                                    {\r\n                                        //上报校验。\r\n                                        ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n                                        var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n                                        {\r\n                                            sceneType = 1,\r\n                                            cntrCode = traycode,\r\n                                        }));\r\n                                        if (str.Contains(\"true\"))\r\n                                        {\r\n                                            //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n                                            tag.wxr2.R11 = true;\r\n                                            tag.wxr2.R46_LAST = false;\r\n                                        }\r\n                                        else\r\n                                        {\r\n                                            //报警。\r\n                                        }\r\n                                    }\r\n                                    else { TcpServer.TcpServerSend(VERX.deviceNo[1], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n                                }\r\n                            }\r\n                        }",
                  "ContentCopy": "var VERX = Settings.deviceInfos?.Find(x => x.deviceType == 1 && x.deviceName.Contains(\"2\"));\r\n\r\n                        if (VERX != null)\r\n                        {\r\n                            if (tag.wxr2.R46 && !tag.wxr2.R46_LAST && tag.wxr2.R11)\r\n                            {\r\n                                if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1], out string traycode))\r\n                                {\r\n                                    var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/200\", JsonConvert.SerializeObject(new\r\n                                    {\r\n                                        requestType = 1,\r\n                                        cntrCode = traycode,\r\n                                        startBit = VERX.location[1],\r\n                                        endBit = \"\"\r\n                                    }));\r\n                                    LogHelper.Info($\"{VERX.location[1]}申请mes任务结果{str}\");\r\n                                    if (str.Contains(\"true\"))\r\n                                    {\r\n                                        tag.wxr2.R46_LAST = true; \r\n                                    }\r\n                                }\r\n                                else\r\n                                {\r\n                                    TcpServer.TcpServerSend(VERX.deviceNo[2], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\"));\r\n                                }\r\n                            }\r\n                            else\r\n                            {\r\n                               if (tag.wxr2.R11_LAST) //托盘放置信号。。\r\n                                {\r\n                                \tif (tag.wxr2.R11)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\ttag.wxr2.R11_LAST=false;\r\n\t\t\t\t\t\t\t\t\t} else\r\n                                    if (TcpServer.TrayIps.TryGetValue(VERX.deviceNo[1],out string traycode))\r\n                                    {\r\n                                        //上报校验。\r\n                                        ///var str = Settings.apiHelper.Post(Settings.MESbaseUrl + \"mom-basic/dataTransmission/json/service/202\", requestJson);\r\n                                        var str = Settings.apiHelper.Post(Settings.WMSbaseUrl + \"mom-basic/dataTransmission/json/service/202\", JsonConvert.SerializeObject(new\r\n                                        {\r\n                                            sceneType = 1,\r\n                                            cntrCode = traycode,\r\n                                        }));\r\n                                        if (str.Contains(\"true\"))\r\n                                        {\r\n                                            //Conn.默认Redis.SetValue(\"维希尔抓臂1.R10\", \"true\", \"维希尔抓臂1Queue\");\r\n                                            tag.wxr2.R11 = true;\r\n                                            tag.wxr2.R46_LAST = false;\r\n                                        }\r\n                                        else\r\n                                        {\r\n                                            //报警。\r\n                                        }\r\n                                    }\r\n                                    else { TcpServer.TcpServerSend(VERX.deviceNo[1], GZ.Device.PLC.PlcHelper.Hex2Bin(\"544F4E\")); }\r\n                                }\r\n                            }\r\n                        }",
                  "ParentID": "20250610002414741",
                  "Children": [],
                  "Type": "Program",
                  "Property": {
                    "SyncExec": "False",
                    "RepeatExec": "Until",
                    "ExceCount": 1,
                    "ExceInternal": 3000,
                    "StartCondition": {
                      "Type": "View",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {
                        "20250306140515428": [
                          "Open"
                        ]
                      }
                    },
                    "EndCondition": {
                      "Type": "None",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {}
                    }
                  },
                  "FullName": "业务逻辑.第三标段.维系尔2号.维希尔抓臂2R",
                  "ParentFullName": "业务逻辑.第三标段.维系尔2号",
                  "Enabled": "Enabled"
                }
              ],
              "Type": "Group",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "None",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.第三标段.维系尔2号",
              "ParentFullName": "业务逻辑.第三标段",
              "Enabled": "Enabled"
            }
          ],
          "Type": "Group",
          "Property": {
            "SyncExec": "False",
            "RepeatExec": "None",
            "ExceCount": 1,
            "ExceInternal": 3000,
            "StartCondition": {
              "Type": "None",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {}
            },
            "EndCondition": {
              "Type": "None",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {}
            }
          },
          "FullName": "业务逻辑.第三标段",
          "ParentFullName": "业务逻辑",
          "Enabled": "Enabled"
        },
        {
          "ID": "20250325085542733",
          "Name": "任务下发",
          "Desc": "",
          "Content": "ITaskRepository taskservice = new TaskRepository();\r\nvar tklist = taskservice.FindList(x => x.S_B_STATE == \"未执行\" && x.S_WORK_MODE == \"AGV\");\r\nif(tklist.Any())\r\nforeach (var tk in tklist.GroupBy(item =>\r\n{\r\n    var ticks = item.T_CREATE.Ticks;\r\n    return new DateTime(ticks - ticks % (10 * TimeSpan.TicksPerMinute));\r\n}).OrderBy(x => x.Key))\r\n{\r\n    var ts = tk.OrderByDescending(x => x.N_PRIORITY).ToList();\r\n    foreach (var t in ts)\r\n    {\r\n        var b = false;\r\n        b = RunTask(t);\r\n\r\n        if (b)\r\n        {\r\n            t.S_B_STATE = \"已推送\";\r\n            taskservice.Update(t);\r\n        }\r\n    }\r\n    break;\r\n}\r\n#region Rgv\r\n\r\nvar task1Isrun = false;\r\nif (tag.RGV.ReadTask1No > 0 && tag.RGV.bit1taskOver != 1)\r\n{\r\n    task1Isrun = true;\r\n    if (tag.RGV.bit1taskOver_LAST == 1)\r\n        RedisHelper.Add($\"RGV.bit1taskOver_LAST\", \"0\", out string msg);\r\n}\r\nvar task2Isrun = false;\r\nif (tag.RGV.ReadTask2No > 0 && tag.RGV.bit2taskOver != 1)\r\n{\r\n    task2Isrun = true;\r\n    if (tag.RGV.bit2taskOver_LAST == 1)\r\n        RedisHelper.Add($\"RGV.bit2taskOver_LAST\", \"0\", out string msg);\r\n}\r\nif (task1Isrun || task2Isrun)\r\n{\r\n    string mes = \"\";\r\n    if (task1Isrun)\r\n        mes += tag.RGV.ReadTask1No + \"执行中...\";\r\n    if (task2Isrun)\r\n        mes += tag.RGV.ReadTask2No + \"执行中...\";\r\n    LogHelper.Info($\"{mes} 不能下发新任务。\");\r\n    throw new Exception($\"{mes} 不能下发新任务。\");\r\n    //continue;\r\n}\r\nvar thisOver = 0;\r\n\r\nTaskEntity task1 = null;\r\nTaskEntity task2 = null;\r\n\r\nLogHelper.Info($\"查看RGV 1工位任务》\");\r\nif (tag.RGV.ReadTask1No > 0 && tag.RGV.bit1taskOver == 1)\r\n{\r\n    var taskno = tag.RGV.ReadTask1No;\r\n    LogHelper.Info($\"RGV 1工位任务{tag.RGV.ReadTask1No}\");\r\n    string tno = \"TN\" + (DateTime.Now.ToString(\"yy\")) + ((taskno.ToString()).PadLeft(8, '0'));\r\n    task1 = taskservice.FindEntity(x => x.S_TASK_NO == tno);\r\n\r\n    LogHelper.Info($\"RGV 1工位任务{JsonConvert.SerializeObject(task1)}.bit1taskOver_LAST:{tag.RGV.bit1taskOver_LAST}\");\r\n    if (tag.RGV.bit1taskOver_LAST == 0 && task1 != null)\r\n    {\r\n        if (task1.S_B_STATE != \"完成\")\r\n        {\r\n            if (task1.S_B_STATE == \"取货完成\")\r\n            {\r\n                task1.S_B_STATE = \"完成\";\r\n            }\r\n            else\r\n            {\r\n                task1.S_B_STATE = \"取货完成\";\r\n            }\r\n            LogHelper.Info($\"RGV 1工位任务{task1.S_TASK_NO} 状态切换为{task1.S_B_STATE}\");\r\n            //tag.RGV.bit1taskOver_LAST = 1;\r\n            RedisHelper.Add($\"RGV.bit1taskOver_LAST\", \"1\", out string msg);\r\n            LogHelper.Info($\"RGV 1工位任务写处理\");\r\n            taskservice.Update(task1);\r\n            LogHelper.Info($\"RGV 1工位任务更新。\");\r\n        }\r\n    }\r\n}\r\nelse if (tag.RGV.ReadTask1No == 0)\r\n{\r\n    LogHelper.Info($\"RGV 1工位没有任务》\");\r\n}\r\n\r\nLogHelper.Info($\"查看RGV 2工位任务》\");\r\nif (tag.RGV.ReadTask2No > 0 && tag.RGV.bit2taskOver == 1)\r\n{\r\n    var taskno = tag.RGV.ReadTask2No;\r\n    LogHelper.Info($\"RGV 2工位任务{tag.RGV.ReadTask2No}\");\r\n    string tno = \"TN\" + (DateTime.Now.ToString(\"yy\")) + ((taskno.ToString()).PadLeft(8, '0'));\r\n    task2 = taskservice.FindEntity(x => x.S_TASK_NO == tno);\r\n\r\n    LogHelper.Info($\"RGV2工位任务{JsonConvert.SerializeObject(task2)}.bit1taskOver_LAST:{tag.RGV.bit2taskOver_LAST}\");\r\n    if (tag.RGV.bit2taskOver_LAST == 0 && task2 != null)\r\n    {\r\n        if (task2.S_B_STATE != \"完成\")\r\n        {\r\n            if (task2.S_B_STATE == \"取货完成\")\r\n            {\r\n                task2.S_B_STATE = \"完成\";\r\n            }\r\n            else\r\n            {\r\n                task2.S_B_STATE = \"取货完成\";\r\n            }\r\n            LogHelper.Info($\"RGV 2工位任务{task2.S_TASK_NO} 状态切换为{task2.S_B_STATE}\");\r\n            RedisHelper.Add($\"RGV.bit2taskOver_LAST\", \"1\", out string msg);\r\n            LogHelper.Info($\"RGV 2工位任务写处理\");\r\n            taskservice.Update(task2);\r\n            LogHelper.Info($\"RGV 2工位任务更新。\");\r\n        }\r\n    }\r\n}\r\nelse if (tag.RGV.ReadTask2No == 0)\r\n{\r\n    LogHelper.Info($\"RGV 2工位没有任务》\");\r\n}\r\n\r\n\r\n///1 有货  就2 取。  1 没货 就2 卸货, 都有货  就1卸货。 都没货 就1卸\r\ntklist = taskservice.FindList(x => x.S_B_STATE == \"未执行\" && x.S_WORK_MODE == \"RGV\").OrderBy(x => x.T_CREATE).ToList();\r\nif (task1 != null && task1.S_B_STATE != \"完成\") //1有任务\r\n{\r\n    if (task2 != null && task2.S_B_STATE != \"完成\")// 1 有任务  2 有任务。 \r\n    {\r\n        LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 也有任务{task2.S_TASK_NO}。 开始工位1 卸货。\");\r\n        tag.RGV.workMod = 1;\r\n        tag.RGV.taskmod = 2;\r\n        tag.RGV.taskno1 = Convert.ToUInt32(task1.S_TASK_NO.Substring(4));\r\n        tag.RGV.task1do = Convert.ToUInt16(task1.S_END_LOC);\r\n        System.Threading.Thread.Sleep(750);\r\n        tag.RGV.taskend = 125;\r\n        System.Threading.Thread.Sleep(750);\r\n        tag.RGV.taskend = 125;\r\n    }\r\n    else //1有任务  2 没任务。\r\n    {\r\n        LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 找同侧取货任务。\");\r\n        //1 如果有同侧取货任务。就取。没有\r\n        var leftSide = new List<string> { \"1023\", \"1020\" };\r\n        var RightSide = new List<string> { \"1002\", \"1008\", \"1010\", \"1016\" };\r\n        bool creT2 = false;\r\n        if (leftSide.Contains(task1.S_START_LOC))\r\n        {\r\n            leftSide.Remove(task1.S_START_LOC);\r\n            var lsde = leftSide.FirstOrDefault();\r\n            var t2 = tklist.Find(x => x.S_START_LOC == lsde && x.S_END_LOC != \"1017\");\r\n            if (t2 != null) //同侧取货任务。\r\n            {\r\n                LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 找同侧取货任务{t2.S_TASK_NO}。\");\r\n                tag.RGV.workMod = 2;\r\n                tag.RGV.taskmod = 1;\r\n                tag.RGV.taskno2 = Convert.ToUInt32(t2.S_TASK_NO.Substring(4));\r\n                tag.RGV.task2do = Convert.ToUInt16(t2.S_START_LOC);\r\n                System.Threading.Thread.Sleep(750);\r\n                tag.RGV.taskend = 125;\r\n                System.Threading.Thread.Sleep(750);\r\n                tag.RGV.taskend = 125;\r\n                t2.S_B_STATE = \"已推送\";\r\n                taskservice.Update(t2);\r\n                creT2 = true;\r\n            }\r\n        }\r\n        else if (RightSide.Contains(task1.S_START_LOC))\r\n        {\r\n            RightSide.Remove(task1.S_START_LOC);\r\n            var t2 = tklist.Find(x => RightSide.Contains(x.S_START_LOC) && x.S_END_LOC != \"1017\");\r\n            if (t2 != null) //同侧取货任务。\r\n            {\r\n                LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 找同侧取货任务{t2.S_TASK_NO}。\");\r\n                tag.RGV.workMod = 2;\r\n                tag.RGV.taskmod = 1;\r\n                tag.RGV.taskno2 = Convert.ToUInt32(t2.S_TASK_NO.Substring(4));\r\n                tag.RGV.task2do = Convert.ToUInt16(t2.S_START_LOC);\r\n                System.Threading.Thread.Sleep(750);\r\n                tag.RGV.taskend = 125;\r\n                System.Threading.Thread.Sleep(750);\r\n                tag.RGV.taskend = 125;\r\n                t2.S_B_STATE = \"已推送\";\r\n                taskservice.Update(t2);\r\n                creT2 = true;\r\n            }\r\n        }\r\n        //else //1 直接卸货。 \r\n        if (!creT2)\r\n        {\r\n            LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 没有同侧取货任务 1工位卸货。\");\r\n            tag.RGV.workMod = 1;\r\n            tag.RGV.taskmod = 2;\r\n            tag.RGV.taskno1 = Convert.ToUInt32(task1.S_TASK_NO.Substring(4));\r\n            tag.RGV.task1do = Convert.ToUInt16(task1.S_END_LOC);\r\n            System.Threading.Thread.Sleep(750);\r\n            tag.RGV.taskend = 125;\r\n            System.Threading.Thread.Sleep(750);\r\n            tag.RGV.taskend = 125;\r\n        }\r\n    }\r\n}\r\nelse\r\n{\r\n    if (task2 != null && task2.S_B_STATE != \"完成\")// 1 没任务  2 有任务。 \r\n    {\r\n        LogHelper.Info($\"查看RGV 1工位没任务,工位2 有任务{task2.S_TASK_NO}。工位2卸货。。\");\r\n        //2 卸货。\r\n        tag.RGV.workMod = 2;\r\n        tag.RGV.taskmod = 2;\r\n        tag.RGV.taskno2 = Convert.ToUInt32(task2.S_TASK_NO.Substring(4));\r\n        tag.RGV.task2do = Convert.ToUInt16(task2.S_END_LOC);\r\n        System.Threading.Thread.Sleep(750);\r\n        tag.RGV.taskend = 125;\r\n        System.Threading.Thread.Sleep(750);\r\n        tag.RGV.taskend = 125;\r\n    }\r\n    else //1mei 任务  2 没任务。\r\n    {\r\n        LogHelper.Info($\"查看RGV 1工位没任务,工位2 也没任务。优先1工位终点1017任务。。\");\r\n        //、下 1017任务 给1号工位。\r\n        var lss = tklist.Take(2).ToList();\r\n        var e1017first = lss.Find(x => x.S_END_LOC == \"1017\");\r\n        if (e1017first == null)\r\n        {\r\n            e1017first = lss.FirstOrDefault();\r\n        }\r\n        if (e1017first != null)\r\n        {\r\n            LogHelper.Info($\"查看RGV 1工位没任务,工位2 也没任务。1工位下任务{e1017first.S_TASK_NO}> 终点{e1017first.S_END_LOC}。\");\r\n            try\r\n            {\r\n                tag.RGV.workMod = 1;\r\n                tag.RGV.taskmod = 1;\r\n                uint tno = Convert.ToUInt32(e1017first.S_TASK_NO.Substring(4));\r\n                LogHelper.Info($\"{e1017first.S_TASK_NO}> 转换后任务号{tno} 开始写入。\");\r\n                tag.RGV.taskno1 = tno;\r\n                LogHelper.Info($\"{e1017first.S_TASK_NO}>开始写入 task1do>>{e1017first.S_START_LOC}。\");\r\n                tag.RGV.task1do = Convert.ToUInt16(e1017first.S_START_LOC);\r\n            }\r\n            catch (Exception ex)\r\n            {\r\n                LogHelper.Error(ex.Message, ex);\r\n                throw ex;\r\n            }\r\n            System.Threading.Thread.Sleep(750);\r\n            tag.RGV.taskend = 125;\r\n            System.Threading.Thread.Sleep(750);\r\n            tag.RGV.taskend = 125;\r\n            LogHelper.Info($\"{e1017first.S_TASK_NO}> taskend 125\");\r\n            e1017first.S_B_STATE = \"已推送\";\r\n            taskservice.Update(e1017first);\r\n        }\r\n    }\r\n}\r\n\r\n#endregion",
          "ContentCopy": "ITaskRepository taskservice = new TaskRepository();\r\nvar tklist = taskservice.FindList(x => x.S_B_STATE == \"未执行\" && x.S_WORK_MODE == \"AGV\");\r\nif(tklist.Any())\r\nforeach (var tk in tklist.GroupBy(item =>\r\n{\r\n    var ticks = item.T_CREATE.Ticks;\r\n    return new DateTime(ticks - ticks % (10 * TimeSpan.TicksPerMinute));\r\n}).OrderBy(x => x.Key))\r\n{\r\n    var ts = tk.OrderByDescending(x => x.N_PRIORITY).ToList();\r\n    foreach (var t in ts)\r\n    {\r\n        var b = false;\r\n        b = RunTask(t);\r\n\r\n        if (b)\r\n        {\r\n            t.S_B_STATE = \"已推送\";\r\n            taskservice.Update(t);\r\n        }\r\n    }\r\n    break;\r\n}\r\n#region Rgv\r\n\r\nvar task1Isrun = false;\r\nif (tag.RGV.ReadTask1No > 0 && tag.RGV.bit1taskOver != 1)\r\n{\r\n    task1Isrun = true;\r\n    if (tag.RGV.bit1taskOver_LAST == 1)\r\n        RedisHelper.Add($\"RGV.bit1taskOver_LAST\", \"0\", out string msg);\r\n}\r\nvar task2Isrun = false;\r\nif (tag.RGV.ReadTask2No > 0 && tag.RGV.bit2taskOver != 1)\r\n{\r\n    task2Isrun = true;\r\n    if (tag.RGV.bit2taskOver_LAST == 1)\r\n        RedisHelper.Add($\"RGV.bit2taskOver_LAST\", \"0\", out string msg);\r\n}\r\nif (task1Isrun || task2Isrun)\r\n{\r\n    string mes = \"\";\r\n    if (task1Isrun)\r\n        mes += tag.RGV.ReadTask1No + \"执行中...\";\r\n    if (task2Isrun)\r\n        mes += tag.RGV.ReadTask2No + \"执行中...\";\r\n    LogHelper.Info($\"{mes} 不能下发新任务。\");\r\n    throw new Exception($\"{mes} 不能下发新任务。\");\r\n    //continue;\r\n}\r\nvar thisOver = 0;\r\n\r\nTaskEntity task1 = null;\r\nTaskEntity task2 = null;\r\n\r\nLogHelper.Info($\"查看RGV 1工位任务》\");\r\nif (tag.RGV.ReadTask1No > 0 && tag.RGV.bit1taskOver == 1)\r\n{\r\n    var taskno = tag.RGV.ReadTask1No;\r\n    LogHelper.Info($\"RGV 1工位任务{tag.RGV.ReadTask1No}\");\r\n    string tno = \"TN\" + (DateTime.Now.ToString(\"yy\")) + ((taskno.ToString()).PadLeft(8, '0'));\r\n    task1 = taskservice.FindEntity(x => x.S_TASK_NO == tno);\r\n\r\n    LogHelper.Info($\"RGV 1工位任务{JsonConvert.SerializeObject(task1)}.bit1taskOver_LAST:{tag.RGV.bit1taskOver_LAST}\");\r\n    if (tag.RGV.bit1taskOver_LAST == 0 && task1 != null)\r\n    {\r\n        if (task1.S_B_STATE != \"完成\")\r\n        {\r\n            if (task1.S_B_STATE == \"取货完成\")\r\n            {\r\n                task1.S_B_STATE = \"完成\";\r\n            }\r\n            else\r\n            {\r\n                task1.S_B_STATE = \"取货完成\";\r\n            }\r\n            LogHelper.Info($\"RGV 1工位任务{task1.S_TASK_NO} 状态切换为{task1.S_B_STATE}\");\r\n            //tag.RGV.bit1taskOver_LAST = 1;\r\n            RedisHelper.Add($\"RGV.bit1taskOver_LAST\", \"1\", out string msg);\r\n            LogHelper.Info($\"RGV 1工位任务写处理\");\r\n            taskservice.Update(task1);\r\n            LogHelper.Info($\"RGV 1工位任务更新。\");\r\n        }\r\n    }\r\n}\r\nelse if (tag.RGV.ReadTask1No == 0)\r\n{\r\n    LogHelper.Info($\"RGV 1工位没有任务》\");\r\n}\r\n\r\nLogHelper.Info($\"查看RGV 2工位任务》\");\r\nif (tag.RGV.ReadTask2No > 0 && tag.RGV.bit2taskOver == 1)\r\n{\r\n    var taskno = tag.RGV.ReadTask2No;\r\n    LogHelper.Info($\"RGV 2工位任务{tag.RGV.ReadTask2No}\");\r\n    string tno = \"TN\" + (DateTime.Now.ToString(\"yy\")) + ((taskno.ToString()).PadLeft(8, '0'));\r\n    task2 = taskservice.FindEntity(x => x.S_TASK_NO == tno);\r\n\r\n    LogHelper.Info($\"RGV2工位任务{JsonConvert.SerializeObject(task2)}.bit1taskOver_LAST:{tag.RGV.bit2taskOver_LAST}\");\r\n    if (tag.RGV.bit2taskOver_LAST == 0 && task2 != null)\r\n    {\r\n        if (task2.S_B_STATE != \"完成\")\r\n        {\r\n            if (task2.S_B_STATE == \"取货完成\")\r\n            {\r\n                task2.S_B_STATE = \"完成\";\r\n            }\r\n            else\r\n            {\r\n                task2.S_B_STATE = \"取货完成\";\r\n            }\r\n            LogHelper.Info($\"RGV 2工位任务{task2.S_TASK_NO} 状态切换为{task2.S_B_STATE}\");\r\n            RedisHelper.Add($\"RGV.bit2taskOver_LAST\", \"1\", out string msg);\r\n            LogHelper.Info($\"RGV 2工位任务写处理\");\r\n            taskservice.Update(task2);\r\n            LogHelper.Info($\"RGV 2工位任务更新。\");\r\n        }\r\n    }\r\n}\r\nelse if (tag.RGV.ReadTask2No == 0)\r\n{\r\n    LogHelper.Info($\"RGV 2工位没有任务》\");\r\n}\r\n\r\n\r\n///1 有货  就2 取。  1 没货 就2 卸货, 都有货  就1卸货。 都没货 就1卸\r\ntklist = taskservice.FindList(x => x.S_B_STATE == \"未执行\" && x.S_WORK_MODE == \"RGV\").OrderBy(x => x.T_CREATE).ToList();\r\nif (task1 != null && task1.S_B_STATE != \"完成\") //1有任务\r\n{\r\n    if (task2 != null && task2.S_B_STATE != \"完成\")// 1 有任务  2 有任务。 \r\n    {\r\n        LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 也有任务{task2.S_TASK_NO}。 开始工位1 卸货。\");\r\n        tag.RGV.workMod = 1;\r\n        tag.RGV.taskmod = 2;\r\n        tag.RGV.taskno1 = Convert.ToUInt32(task1.S_TASK_NO.Substring(4));\r\n        tag.RGV.task1do = Convert.ToUInt16(task1.S_END_LOC);\r\n        System.Threading.Thread.Sleep(750);\r\n        tag.RGV.taskend = 125;\r\n        System.Threading.Thread.Sleep(750);\r\n        tag.RGV.taskend = 125;\r\n    }\r\n    else //1有任务  2 没任务。\r\n    {\r\n        LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 找同侧取货任务。\");\r\n        //1 如果有同侧取货任务。就取。没有\r\n        var leftSide = new List<string> { \"1023\", \"1020\" };\r\n        var RightSide = new List<string> { \"1002\", \"1008\", \"1010\", \"1016\" };\r\n        bool creT2 = false;\r\n        if (leftSide.Contains(task1.S_START_LOC))\r\n        {\r\n            leftSide.Remove(task1.S_START_LOC);\r\n            var lsde = leftSide.FirstOrDefault();\r\n            var t2 = tklist.Find(x => x.S_START_LOC == lsde && x.S_END_LOC != \"1017\");\r\n            if (t2 != null) //同侧取货任务。\r\n            {\r\n                LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 找同侧取货任务{t2.S_TASK_NO}。\");\r\n                tag.RGV.workMod = 2;\r\n                tag.RGV.taskmod = 1;\r\n                tag.RGV.taskno2 = Convert.ToUInt32(t2.S_TASK_NO.Substring(4));\r\n                tag.RGV.task2do = Convert.ToUInt16(t2.S_START_LOC);\r\n                System.Threading.Thread.Sleep(750);\r\n                tag.RGV.taskend = 125;\r\n                System.Threading.Thread.Sleep(750);\r\n                tag.RGV.taskend = 125;\r\n                t2.S_B_STATE = \"已推送\";\r\n                taskservice.Update(t2);\r\n                creT2 = true;\r\n            }\r\n        }\r\n        else if (RightSide.Contains(task1.S_START_LOC))\r\n        {\r\n            RightSide.Remove(task1.S_START_LOC);\r\n            var t2 = tklist.Find(x => RightSide.Contains(x.S_START_LOC) && x.S_END_LOC != \"1017\");\r\n            if (t2 != null) //同侧取货任务。\r\n            {\r\n                LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 找同侧取货任务{t2.S_TASK_NO}。\");\r\n                tag.RGV.workMod = 2;\r\n                tag.RGV.taskmod = 1;\r\n                tag.RGV.taskno2 = Convert.ToUInt32(t2.S_TASK_NO.Substring(4));\r\n                tag.RGV.task2do = Convert.ToUInt16(t2.S_START_LOC);\r\n                System.Threading.Thread.Sleep(750);\r\n                tag.RGV.taskend = 125;\r\n                System.Threading.Thread.Sleep(750);\r\n                tag.RGV.taskend = 125;\r\n                t2.S_B_STATE = \"已推送\";\r\n                taskservice.Update(t2);\r\n                creT2 = true;\r\n            }\r\n        }\r\n        //else //1 直接卸货。 \r\n        if (!creT2)\r\n        {\r\n            LogHelper.Info($\"查看RGV1 有任务{task1.S_TASK_NO},工位2 没任务。 没有同侧取货任务 1工位卸货。\");\r\n            tag.RGV.workMod = 1;\r\n            tag.RGV.taskmod = 2;\r\n            tag.RGV.taskno1 = Convert.ToUInt32(task1.S_TASK_NO.Substring(4));\r\n            tag.RGV.task1do = Convert.ToUInt16(task1.S_END_LOC);\r\n            System.Threading.Thread.Sleep(750);\r\n            tag.RGV.taskend = 125;\r\n            System.Threading.Thread.Sleep(750);\r\n            tag.RGV.taskend = 125;\r\n        }\r\n    }\r\n}\r\nelse\r\n{\r\n    if (task2 != null && task2.S_B_STATE != \"完成\")// 1 没任务  2 有任务。 \r\n    {\r\n        LogHelper.Info($\"查看RGV 1工位没任务,工位2 有任务{task2.S_TASK_NO}。工位2卸货。。\");\r\n        //2 卸货。\r\n        tag.RGV.workMod = 2;\r\n        tag.RGV.taskmod = 2;\r\n        tag.RGV.taskno2 = Convert.ToUInt32(task2.S_TASK_NO.Substring(4));\r\n        tag.RGV.task2do = Convert.ToUInt16(task2.S_END_LOC);\r\n        System.Threading.Thread.Sleep(750);\r\n        tag.RGV.taskend = 125;\r\n        System.Threading.Thread.Sleep(750);\r\n        tag.RGV.taskend = 125;\r\n    }\r\n    else //1mei 任务  2 没任务。\r\n    {\r\n        LogHelper.Info($\"查看RGV 1工位没任务,工位2 也没任务。优先1工位终点1017任务。。\");\r\n        //、下 1017任务 给1号工位。\r\n        var lss = tklist.Take(2).ToList();\r\n        var e1017first = lss.Find(x => x.S_END_LOC == \"1017\");\r\n        if (e1017first == null)\r\n        {\r\n            e1017first = lss.FirstOrDefault();\r\n        }\r\n        if (e1017first != null)\r\n        {\r\n            LogHelper.Info($\"查看RGV 1工位没任务,工位2 也没任务。1工位下任务{e1017first.S_TASK_NO}> 终点{e1017first.S_END_LOC}。\");\r\n            try\r\n            {\r\n                tag.RGV.workMod = 1;\r\n                tag.RGV.taskmod = 1;\r\n                uint tno = Convert.ToUInt32(e1017first.S_TASK_NO.Substring(4));\r\n                LogHelper.Info($\"{e1017first.S_TASK_NO}> 转换后任务号{tno} 开始写入。\");\r\n                tag.RGV.taskno1 = tno;\r\n                LogHelper.Info($\"{e1017first.S_TASK_NO}>开始写入 task1do>>{e1017first.S_START_LOC}。\");\r\n                tag.RGV.task1do = Convert.ToUInt16(e1017first.S_START_LOC);\r\n            }\r\n            catch (Exception ex)\r\n            {\r\n                LogHelper.Error(ex.Message, ex);\r\n                throw ex;\r\n            }\r\n            System.Threading.Thread.Sleep(750);\r\n            tag.RGV.taskend = 125;\r\n            System.Threading.Thread.Sleep(750);\r\n            tag.RGV.taskend = 125;\r\n            LogHelper.Info($\"{e1017first.S_TASK_NO}> taskend 125\");\r\n            e1017first.S_B_STATE = \"已推送\";\r\n            taskservice.Update(e1017first);\r\n        }\r\n    }\r\n}\r\n\r\n#endregion",
          "ParentID": "20250226153120175",
          "Children": [],
          "Type": "Program",
          "Property": {
            "SyncExec": "False",
            "RepeatExec": "Until",
            "ExceCount": 1,
            "ExceInternal": 3000,
            "StartCondition": {
              "Type": "View",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {
                "20250306140515428": [
                  "Open"
                ]
              }
            },
            "EndCondition": {
              "Type": "None",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {}
            }
          },
          "FullName": "业务逻辑.任务下发",
          "ParentFullName": "业务逻辑",
          "Enabled": "Enabled"
        },
        {
          "ID": "20250531163653189",
          "Name": "处理MES任务线程",
          "Desc": "",
          "Content": "",
          "ContentCopy": "",
          "ParentID": "20250226153120175",
          "Children": [
            {
              "ID": "20250531163716255",
              "Name": "ResolveMesTask",
              "Desc": "",
              "Content": "//mes 任务拆分。一段任务和 多段任务。\r\nToWMSMES.ResMesTask();",
              "ContentCopy": "//mes 任务拆分。一段任务和 多段任务。\r\nToWMSMES.ResMesTask();",
              "ParentID": "20250531163653189",
              "Children": [],
              "Type": "Program",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "Until",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "View",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {
                    "20250306140515428": [
                      "Open"
                    ]
                  }
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.处理MES任务线程.ResolveMesTask",
              "ParentFullName": "业务逻辑.处理MES任务线程",
              "Enabled": "Enabled"
            }
          ],
          "Type": "Group",
          "Property": {
            "SyncExec": "False",
            "RepeatExec": "None",
            "ExceCount": 1,
            "ExceInternal": 3000,
            "StartCondition": {
              "Type": "None",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {}
            },
            "EndCondition": {
              "Type": "None",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {}
            }
          },
          "FullName": "业务逻辑.处理MES任务线程",
          "ParentFullName": "业务逻辑",
          "Enabled": "Enabled"
        },
        {
          "ID": "20250605212104026",
          "Name": "SocketServer",
          "Desc": "",
          "Content": "var host = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());\r\nforeach (var ip in host.AddressList)\r\n{\r\n    if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)\r\n    {\r\n        Console.WriteLine($\"ip= {ip.ToString()}\");\r\n        new TcpServer(ip.ToString());\r\n    }\r\n}",
          "ContentCopy": "var host = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());\r\nforeach (var ip in host.AddressList)\r\n{\r\n    if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)\r\n    {\r\n        Console.WriteLine($\"ip= {ip.ToString()}\");\r\n        new TcpServer(ip.ToString());\r\n    }\r\n}",
          "ParentID": "20250226153120175",
          "Children": [],
          "Type": "Program",
          "Property": {
            "SyncExec": "True",
            "RepeatExec": "None",
            "ExceCount": 1,
            "ExceInternal": 3000,
            "StartCondition": {
              "Type": "View",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {
                "20250306140515428": [
                  "Open"
                ]
              }
            },
            "EndCondition": {
              "Type": "None",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {}
            }
          },
          "FullName": "业务逻辑.SocketServer",
          "ParentFullName": "业务逻辑",
          "Enabled": "Enabled"
        },
        {
          "ID": "20250611223832523",
          "Name": "光栅处理",
          "Desc": "",
          "Content": "// - 光栅交互处理。。\r\n                        var taskCOdes = new List<string> { \"Sarrive\", \"Srelease\", \"Earrive\", \"Erelease\" };\r\n                        TaskActRepository taskActRepository = new TaskActRepository();\r\n                        TaskRepository taskRepository = new TaskRepository();\r\n                        var requires = taskActRepository.FindList(x => taskCOdes.Contains(x.S_ACTION_CODE) && x.N_CREATEMETHOD == 0);\r\n                        foreach (var item in requires)\r\n                        {\r\n                            var tin = taskCOdes.IndexOf(item.S_ACTION_CODE);\r\n                            if (tin == -1)\r\n                            {\r\n                                item.N_CREATEMETHOD = -1;\r\n                                taskActRepository.Update(item);\r\n                                continue;\r\n                            }\r\n                            //var task = taskRepository.FindEntity(x => x.S_TASK_NO == item.S_TASK_NO);\r\n                            string loc = \"\";\r\n                            if (tin < 2)\r\n                            {\r\n                                loc = item.S_START_LOC;\r\n                            }\r\n                            else\r\n                            {\r\n                                loc = item.S_END_LOC;\r\n                            } \r\n\t\t\t\t\t\t\tif (loc == null) continue; else loc = loc.Trim();\r\n                            bool goin = tin % 2 == 0;\r\n                            bool continuuuuu =false;\r\n                            var dev = Settings.deviceInfos.Find(x => x.location.Contains(loc));\r\n                            if (dev != null)\r\n                            {\r\n                                var V = dev.location.ToList().FindIndex(x => x == loc) == 0;\r\n\t\t\t\t\t\t\t\t//车走了  开光栅\r\n                                if (!goin)\r\n                                {\r\n                                    if (dev.deviceType == 1)\r\n                                    {\r\n                                        LogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"R02\" : \"R04\"), \"true\", dev.deviceName + \"Queue\"));\r\n                                        Conn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"R02\" : \"R04\"), \"true\", dev.deviceName + \"Queue\");\r\n\r\n                                    }\r\n                                    else if (dev.deviceType == 2)\r\n                                    {\r\n                                        LogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"D1222\" : \"D1223\"), \"1\", dev.deviceName + \"Queue\"));\r\n                                        Conn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"D1222\" : \"D1223\"), \"1\", dev.deviceName + \"Queue\");\r\n                                    }\r\n                                    \r\n\t                                item.N_CREATEMETHOD = 1;\r\n\t                                taskActRepository.Update(item);\r\n\t\t\t\t\t\t\t\t}\r\n                                //车要进入交互。\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n                                    if (dev.deviceType == 1)\r\n                                    {\r\n\t\t\t\t\t\t\t\t\t\tvar tf = Conn.默认Redis.GetValue(dev.deviceName + \".\" + (V ? \"R50\" : \"R52\"));//读关闭状态\r\n\t\t\t\t\t\t\t\t\t\tif (tf?.ToLower() == \"true\")\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tLogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。 已经关闭!\");\r\n\t\t\t\t\t\t\t\t\t\t\tcontinuuuuu = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tLogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"R01\" : \"R03\"), \"true\", dev.deviceName + \"Queue\"));\r\n\t\t\t\t\t\t\t\t\t\t\tConn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"R01\" : \"R03\"), \"true\", dev.deviceName + \"Queue\");\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n                                    }\r\n                                    else if (dev.deviceType == 2)\r\n                                    {\r\n                                        var tf = Conn.默认Redis.GetValue(dev.deviceName + \".D1202\");\r\n\t\t\t\t\t\t\t\t\t\tint numm = int.Parse(string.IsNullOrEmpty(tf) ? \"0\" : tf);\r\n                                        if (TcpServer.GetBitdata(numm,(V?0:1))==1)\r\n                                        {\r\n\t\t\t\t\t\t\t\t\t\t\tLogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。 已经关闭!\");\r\n                                            continuuuuu = true;\r\n                                        }\r\n                                        else\r\n                                        {\r\n                                            LogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"D1220\" : \"D1221\"), dev.deviceName + \"Queue\"));\r\n                                            Conn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"D1220\" : \"D1221\"), \"1\", dev.deviceName + \"Queue\");\r\n                                        }\r\n                                    }\r\n\r\n                                }\r\n\r\n                            }\r\n                            if (continuuuuu)\r\n                            {\r\n\t\t\t\t\t\t\t\tLogHelper.Info($\"{item.S_TASK_NO}{item.S_ACTION_CODE} 车辆发送继续任务!\");\r\n                                continueTask(new HaiKangOrderInfo\r\n                                {\r\n                                    reqCode = item.S_ID.Replace(\"-\", \"\"),\r\n                                    taskCode = item.S_TASK_NO\r\n                                });\r\n                                item.N_CREATEMETHOD = 1;\r\n                                taskActRepository.Update(item);\r\n                            }\r\n                        }\r\n                        System.Threading.Thread.Sleep(3000);\r\n                        //重置信号\r\n                        foreach (var dev in Settings.deviceInfos.FindAll(x => x.deviceType == 2))\r\n                        {\r\n                            var tf = Conn.默认Redis.GetValue(dev.deviceName + \".D1202\");\r\n                            int numm = int.Parse(string.IsNullOrEmpty(tf) ? \"0\" : tf);\r\n                            if (TcpServer.GetBitdata(numm, 0) == 0)\r\n                            {\r\n                                Conn.默认Redis.SetValue(dev.deviceName + \".D1220\", \"0\", dev.deviceName + \"Queue\");\r\n                                Conn.默认Redis.SetValue(dev.deviceName + \".D1222\", \"0\", dev.deviceName + \"Queue\");\r\n                            }\r\n                            else if (TcpServer.GetBitdata(numm, 1) == 0)\r\n                            {\r\n                                Conn.默认Redis.SetValue(dev.deviceName + \".D1221\", \"0\", dev.deviceName + \"Queue\");\r\n                                Conn.默认Redis.SetValue(dev.deviceName + \".D1223\", \"0\", dev.deviceName + \"Queue\");\r\n                            }\r\n                        }\r\n                        \r\n                        // 发那科下料光栅。",
          "ContentCopy": "// - 光栅交互处理。。\r\n                        var taskCOdes = new List<string> { \"Sarrive\", \"Srelease\", \"Earrive\", \"Erelease\" };\r\n                        TaskActRepository taskActRepository = new TaskActRepository();\r\n                        TaskRepository taskRepository = new TaskRepository();\r\n                        var requires = taskActRepository.FindList(x => taskCOdes.Contains(x.S_ACTION_CODE) && x.N_CREATEMETHOD == 0);\r\n                        foreach (var item in requires)\r\n                        {\r\n                            var tin = taskCOdes.IndexOf(item.S_ACTION_CODE);\r\n                            if (tin == -1)\r\n                            {\r\n                                item.N_CREATEMETHOD = -1;\r\n                                taskActRepository.Update(item);\r\n                                continue;\r\n                            }\r\n                            //var task = taskRepository.FindEntity(x => x.S_TASK_NO == item.S_TASK_NO);\r\n                            string loc = \"\";\r\n                            if (tin < 2)\r\n                            {\r\n                                loc = item.S_START_LOC;\r\n                            }\r\n                            else\r\n                            {\r\n                                loc = item.S_END_LOC;\r\n                            } \r\n\t\t\t\t\t\t\tif (loc == null) continue; else loc = loc.Trim();\r\n                            bool goin = tin % 2 == 0;\r\n                            bool continuuuuu =false;\r\n                            var dev = Settings.deviceInfos.Find(x => x.location.Contains(loc));\r\n                            if (dev != null)\r\n                            {\r\n                                var V = dev.location.ToList().FindIndex(x => x == loc) == 0;\r\n\t\t\t\t\t\t\t\t//车走了  开光栅\r\n                                if (!goin)\r\n                                {\r\n                                    if (dev.deviceType == 1)\r\n                                    {\r\n                                        LogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"R02\" : \"R04\"), \"true\", dev.deviceName + \"Queue\"));\r\n                                        Conn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"R02\" : \"R04\"), \"true\", dev.deviceName + \"Queue\");\r\n\r\n                                    }\r\n                                    else if (dev.deviceType == 2)\r\n                                    {\r\n                                        LogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"D1222\" : \"D1223\"), \"1\", dev.deviceName + \"Queue\"));\r\n                                        Conn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"D1222\" : \"D1223\"), \"1\", dev.deviceName + \"Queue\");\r\n                                    }\r\n                                    \r\n\t                                item.N_CREATEMETHOD = 1;\r\n\t                                taskActRepository.Update(item);\r\n\t\t\t\t\t\t\t\t}\r\n                                //车要进入交互。\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n                                    if (dev.deviceType == 1)\r\n                                    {\r\n\t\t\t\t\t\t\t\t\t\tvar tf = Conn.默认Redis.GetValue(dev.deviceName + \".\" + (V ? \"R50\" : \"R52\"));//读关闭状态\r\n\t\t\t\t\t\t\t\t\t\tif (tf?.ToLower() == \"true\")\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tLogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。 已经关闭!\");\r\n\t\t\t\t\t\t\t\t\t\t\tcontinuuuuu = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tLogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"R01\" : \"R03\"), \"true\", dev.deviceName + \"Queue\"));\r\n\t\t\t\t\t\t\t\t\t\t\tConn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"R01\" : \"R03\"), \"true\", dev.deviceName + \"Queue\");\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n                                    }\r\n                                    else if (dev.deviceType == 2)\r\n                                    {\r\n                                        var tf = Conn.默认Redis.GetValue(dev.deviceName + \".D1202\");\r\n\t\t\t\t\t\t\t\t\t\tint numm = int.Parse(string.IsNullOrEmpty(tf) ? \"0\" : tf);\r\n                                        if (TcpServer.GetBitdata(numm,(V?0:1))==1)\r\n                                        {\r\n\t\t\t\t\t\t\t\t\t\t\tLogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。 已经关闭!\");\r\n                                            continuuuuu = true;\r\n                                        }\r\n                                        else\r\n                                        {\r\n                                            LogHelper.Info($\"{dev.deviceName}{(V ? \"左\" : \"右\")} 光栅{(goin?\"关闭\":\"开启\")} 申请。\"+string.Format(\"{0}{1}{2}\", dev.deviceName + \".\" + (V ? \"D1220\" : \"D1221\"), dev.deviceName + \"Queue\"));\r\n                                            Conn.默认Redis.SetValue(dev.deviceName + \".\" + (V ? \"D1220\" : \"D1221\"), \"1\", dev.deviceName + \"Queue\");\r\n                                        }\r\n                                    }\r\n\r\n                                }\r\n\r\n                            }\r\n                            if (continuuuuu)\r\n                            {\r\n\t\t\t\t\t\t\t\tLogHelper.Info($\"{item.S_TASK_NO}{item.S_ACTION_CODE} 车辆发送继续任务!\");\r\n                                continueTask(new HaiKangOrderInfo\r\n                                {\r\n                                    reqCode = item.S_ID.Replace(\"-\", \"\"),\r\n                                    taskCode = item.S_TASK_NO\r\n                                });\r\n                                item.N_CREATEMETHOD = 1;\r\n                                taskActRepository.Update(item);\r\n                            }\r\n                        }\r\n                        System.Threading.Thread.Sleep(3000);\r\n                        //重置信号\r\n                        foreach (var dev in Settings.deviceInfos.FindAll(x => x.deviceType == 2))\r\n                        {\r\n                            var tf = Conn.默认Redis.GetValue(dev.deviceName + \".D1202\");\r\n                            int numm = int.Parse(string.IsNullOrEmpty(tf) ? \"0\" : tf);\r\n                            if (TcpServer.GetBitdata(numm, 0) == 0)\r\n                            {\r\n                                Conn.默认Redis.SetValue(dev.deviceName + \".D1220\", \"0\", dev.deviceName + \"Queue\");\r\n                                Conn.默认Redis.SetValue(dev.deviceName + \".D1222\", \"0\", dev.deviceName + \"Queue\");\r\n                            }\r\n                            else if (TcpServer.GetBitdata(numm, 1) == 0)\r\n                            {\r\n                                Conn.默认Redis.SetValue(dev.deviceName + \".D1221\", \"0\", dev.deviceName + \"Queue\");\r\n                                Conn.默认Redis.SetValue(dev.deviceName + \".D1223\", \"0\", dev.deviceName + \"Queue\");\r\n                            }\r\n                        }\r\n                        \r\n                        // 发那科下料光栅。",
          "ParentID": "20250226153120175",
          "Children": [],
          "Type": "Program",
          "Property": {
            "SyncExec": "False",
            "RepeatExec": "Until",
            "ExceCount": 1,
            "ExceInternal": 3000,
            "StartCondition": {
              "Type": "View",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {
                "20250306140515428": [
                  "Open"
                ]
              }
            },
            "EndCondition": {
              "Type": "None",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {}
            }
          },
          "FullName": "业务逻辑.光栅处理",
          "ParentFullName": "业务逻辑",
          "Enabled": "Enabled"
        },
        {
          "ID": "20250614173821058",
          "Name": "流程2热处理炉进出",
          "Desc": "",
          "Content": "",
          "ContentCopy": "",
          "ParentID": "20250226153120175",
          "Children": [
            {
              "ID": "20250616094224396",
              "Name": "1020空框下线",
              "Desc": "",
              "Content": "foreach (var Bssx in new string[] { \"1020\", \"1023\" })\r\n{\r\n    var RtaskState = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState\"), typeof(System.UInt16));\r\n    var RtaskState_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState_LAST\"), typeof(System.UInt16));\r\n    var R托盘码 = (System.String)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.R托盘码\"), typeof(System.String));\r\n    Console.WriteLine($\"{Bssx} 空下检测:任务申请:{RtaskState}- 是否已处理:{RtaskState_LAST}- 托盘码:{R托盘码}\");\r\n    if (RtaskState == 3 && RtaskState_LAST == 0)\r\n    {\r\n        try\r\n        {\r\n            foreach (var item in new string[] { \"1004\", \"1006\", \"1012\", \"1014\" })\r\n            {\r\n                var R5 = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲\"), typeof(System.UInt16));\r\n                var R5空闲_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲_LAST\"), typeof(System.UInt16));\r\n                if (R5 == 5 && R5空闲_LAST == 0)\r\n                {\r\n                    var b = TaskProcess.CreateTask(\"\", Bssx, item, \"空上RGV\", 5, new List<string> { R托盘码 }, \"RGV\");\r\n                    if (b)\r\n                    {\r\n                        LogHelper.Debug($\"输送线RGV空托任务 from:{Bssx}>to {item}开始创建成功\");\r\n                        RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"1\", out string msg);\r\n                        //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"1\", $\"S{Bssx}ReadQueue\");\r\n                        RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"1\", out string msg1);\r\n                        //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"1\", $\"S{item}ReadQueue\");\r\n                        break;\r\n                    }\r\n                }\r\n                else if (R5 != 5 && R5空闲_LAST == 1)\r\n                {\r\n                    RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"0\", out string msg);\r\n                    //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"0\", $\"S{item}ReadQueue\");\r\n                }\r\n            }\r\n            System.Threading.Thread.Sleep(1000);\r\n        }\r\n        catch (Exception ex)\r\n        {\r\n            LogHelper.Error(ex.Message, ex);\r\n            Console.WriteLine(ex.Message + ex.StackTrace);\r\n        }\r\n    }\r\n    else if (RtaskState != 3 && RtaskState_LAST == 1)\r\n    {\r\n        RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"0\", out string msg);\r\n        //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"0\", $\"S{Bssx}ReadQueue\");\r\n    }\r\n    System.Threading.Thread.Sleep(2000);\r\n}",
              "ContentCopy": "foreach (var Bssx in new string[] { \"1020\", \"1023\" })\r\n{\r\n    var RtaskState = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState\"), typeof(System.UInt16));\r\n    var RtaskState_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState_LAST\"), typeof(System.UInt16));\r\n    var R托盘码 = (System.String)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.R托盘码\"), typeof(System.String));\r\n    Console.WriteLine($\"{Bssx} 空下检测:任务申请:{RtaskState}- 是否已处理:{RtaskState_LAST}- 托盘码:{R托盘码}\");\r\n    if (RtaskState == 3 && RtaskState_LAST == 0)\r\n    {\r\n        try\r\n        {\r\n            foreach (var item in new string[] { \"1004\", \"1006\", \"1012\", \"1014\" })\r\n            {\r\n                var R5 = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲\"), typeof(System.UInt16));\r\n                var R5空闲_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲_LAST\"), typeof(System.UInt16));\r\n                if (R5 == 5 && R5空闲_LAST == 0)\r\n                {\r\n                    var b = TaskProcess.CreateTask(\"\", Bssx, item, \"空上RGV\", 5, new List<string> { R托盘码 }, \"RGV\");\r\n                    if (b)\r\n                    {\r\n                        LogHelper.Debug($\"输送线RGV空托任务 from:{Bssx}>to {item}开始创建成功\");\r\n                        RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"1\", out string msg);\r\n                        //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"1\", $\"S{Bssx}ReadQueue\");\r\n                        RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"1\", out string msg1);\r\n                        //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"1\", $\"S{item}ReadQueue\");\r\n                        break;\r\n                    }\r\n                }\r\n                else if (R5 != 5 && R5空闲_LAST == 1)\r\n                {\r\n                    RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"0\", out string msg);\r\n                    //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"0\", $\"S{item}ReadQueue\");\r\n                }\r\n            }\r\n            System.Threading.Thread.Sleep(1000);\r\n        }\r\n        catch (Exception ex)\r\n        {\r\n            LogHelper.Error(ex.Message, ex);\r\n            Console.WriteLine(ex.Message + ex.StackTrace);\r\n        }\r\n    }\r\n    else if (RtaskState != 3 && RtaskState_LAST == 1)\r\n    {\r\n        RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"0\", out string msg);\r\n        //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"0\", $\"S{Bssx}ReadQueue\");\r\n    }\r\n    System.Threading.Thread.Sleep(2000);\r\n}",
              "ParentID": "20250614173821058",
              "Children": [],
              "Type": "Program",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "Until",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "View",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {
                    "20250306140515428": [
                      "Open"
                    ]
                  }
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.流程2热处理炉进出.1020空框下线",
              "ParentFullName": "业务逻辑.流程2热处理炉进出",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250616094226654",
              "Name": "1023空框下线",
              "Desc": "",
              "Content": "//1023 空框下线",
              "ContentCopy": "//1023 空框下线",
              "ParentID": "20250614173821058",
              "Children": [],
              "Type": "Program",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "Until",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "View",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {
                    "20250306140515428": [
                      "Open"
                    ]
                  }
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.流程2热处理炉进出.1023空框下线",
              "ParentFullName": "业务逻辑.流程2热处理炉进出",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250616094632985",
              "Name": "定子满下线",
              "Desc": "",
              "Content": "foreach (var Bssx in new string[] { \"1008\", \"1016\" })\r\n{\r\n    var RtaskState = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState\"), typeof(System.UInt16));\r\n    var RtaskState_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState_LAST\"), typeof(System.UInt16));\r\n    var R托盘码 = (System.String)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.R托盘码\"), typeof(System.String));\r\n    Console.WriteLine($\"{Bssx} 满下检测:任务申请:{RtaskState}- 是否已处理:{RtaskState_LAST}- 托盘码:{R托盘码}\");\r\n    if (RtaskState == 3 && RtaskState_LAST == 0)\r\n    {\r\n        var item = \"1026\";\r\n        var R5 = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲\"), typeof(System.UInt16));\r\n        var R5空闲_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲_LAST\"), typeof(System.UInt16));\r\n        if (R5 == 5 && R5空闲_LAST == 0)\r\n        {\r\n            var b = TaskProcess.CreateTask(\"\", Bssx, item, \"满转1026\", 5, new List<string> { R托盘码 }, \"RGV\");\r\n            if (b)\r\n            {\r\n                RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"1\", out string msg);\r\n                RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"1\", out string msg2);\r\n                //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"1\", $\"S{Bssx}ReadQueue\");\r\n                //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"1\", $\"S{item}ReadQueue\");\r\n                break;\r\n            }\r\n        }\r\n        else if (R5 != 5 && R5空闲_LAST == 1)\r\n        {\r\n            RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"0\", out string msg2);\r\n        }\r\n    }\r\n    else if (RtaskState != 3 && RtaskState_LAST == 1)\r\n    {\r\n        RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"0\", out string msg);\r\n        //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"0\", $\"S{Bssx}ReadQueue\");\r\n    }\r\n    System.Threading.Thread.Sleep(2000);\r\n}",
              "ContentCopy": "foreach (var Bssx in new string[] { \"1008\", \"1016\" })\r\n{\r\n    var RtaskState = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState\"), typeof(System.UInt16));\r\n    var RtaskState_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState_LAST\"), typeof(System.UInt16));\r\n    var R托盘码 = (System.String)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.R托盘码\"), typeof(System.String));\r\n    Console.WriteLine($\"{Bssx} 满下检测:任务申请:{RtaskState}- 是否已处理:{RtaskState_LAST}- 托盘码:{R托盘码}\");\r\n    if (RtaskState == 3 && RtaskState_LAST == 0)\r\n    {\r\n        var item = \"1026\";\r\n        var R5 = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲\"), typeof(System.UInt16));\r\n        var R5空闲_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲_LAST\"), typeof(System.UInt16));\r\n        if (R5 == 5 && R5空闲_LAST == 0)\r\n        {\r\n            var b = TaskProcess.CreateTask(\"\", Bssx, item, \"满转1026\", 5, new List<string> { R托盘码 }, \"RGV\");\r\n            if (b)\r\n            {\r\n                RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"1\", out string msg);\r\n                RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"1\", out string msg2);\r\n                //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"1\", $\"S{Bssx}ReadQueue\");\r\n                //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"1\", $\"S{item}ReadQueue\");\r\n                break;\r\n            }\r\n        }\r\n        else if (R5 != 5 && R5空闲_LAST == 1)\r\n        {\r\n            RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"0\", out string msg2);\r\n        }\r\n    }\r\n    else if (RtaskState != 3 && RtaskState_LAST == 1)\r\n    {\r\n        RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"0\", out string msg);\r\n        //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"0\", $\"S{Bssx}ReadQueue\");\r\n    }\r\n    System.Threading.Thread.Sleep(2000);\r\n}",
              "ParentID": "20250614173821058",
              "Children": [],
              "Type": "Program",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "Until",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "View",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {
                    "20250306140515428": [
                      "Open"
                    ]
                  }
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.流程2热处理炉进出.定子满下线",
              "ParentFullName": "业务逻辑.流程2热处理炉进出",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250616094511322",
              "Name": "转子满下线",
              "Desc": "",
              "Content": "//转子满下线  1002  1010   - RGV2工位不可到 1017 不可下发2工位任务。\r\nforeach (var Bssx in new string[] { \"1002\", \"1010\" })\r\n{\r\n    var RtaskState = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState\"), typeof(System.UInt16));\r\n    var RtaskState_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState_LAST\"), typeof(System.UInt16));\r\n    var R托盘码 = (System.String)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.R托盘码\"), typeof(System.String));\r\n    Console.WriteLine($\"{Bssx} 满下检测:任务申请:{RtaskState}- 是否已处理:{RtaskState_LAST}- 托盘码:{R托盘码}\");\r\n    if (RtaskState == 3 && RtaskState_LAST == 0)\r\n    {\r\n        var item = \"1017\";\r\n        var R5 = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲\"), typeof(System.UInt16));\r\n        var R5空闲_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲_LAST\"), typeof(System.UInt16));\r\n        if (R5 == 5 && R5空闲_LAST == 0)\r\n        {\r\n            var b = TaskProcess.CreateTask(\"\", Bssx, item, \"满转1017\", 5, new List<string> { R托盘码 }, \"RGV\");\r\n            if (b)\r\n            {\r\n                RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"1\", out string msg);\r\n                RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"1\", out string msg1);\r\n                //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"1\", $\"S{Bssx}ReadQueue\");\r\n                //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"1\", $\"S{item}ReadQueue\");\r\n                break;\r\n            }\r\n        }\r\n        else if (R5 != 5 && R5空闲_LAST == 1)\r\n        {\r\n            RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"0\", out string msg1);\r\n        }\r\n    }\r\n    else if (RtaskState != 3 && RtaskState_LAST == 1)\r\n    {\r\n        RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"0\", out string msg);\r\n    }\r\n    System.Threading.Thread.Sleep(2000);\r\n}",
              "ContentCopy": "//转子满下线  1002  1010   - RGV2工位不可到 1017 不可下发2工位任务。\r\nforeach (var Bssx in new string[] { \"1002\", \"1010\" })\r\n{\r\n    var RtaskState = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState\"), typeof(System.UInt16));\r\n    var RtaskState_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.RtaskState_LAST\"), typeof(System.UInt16));\r\n    var R托盘码 = (System.String)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{Bssx}Read.R托盘码\"), typeof(System.String));\r\n    Console.WriteLine($\"{Bssx} 满下检测:任务申请:{RtaskState}- 是否已处理:{RtaskState_LAST}- 托盘码:{R托盘码}\");\r\n    if (RtaskState == 3 && RtaskState_LAST == 0)\r\n    {\r\n        var item = \"1017\";\r\n        var R5 = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲\"), typeof(System.UInt16));\r\n        var R5空闲_LAST = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"S{item}Read.R5空闲_LAST\"), typeof(System.UInt16));\r\n        if (R5 == 5 && R5空闲_LAST == 0)\r\n        {\r\n            var b = TaskProcess.CreateTask(\"\", Bssx, item, \"满转1017\", 5, new List<string> { R托盘码 }, \"RGV\");\r\n            if (b)\r\n            {\r\n                RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"1\", out string msg);\r\n                RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"1\", out string msg1);\r\n                //Conn.默认Redis.SetValue($\"S{Bssx}Read.RtaskState_LAST\", \"1\", $\"S{Bssx}ReadQueue\");\r\n                //Conn.默认Redis.SetValue($\"S{item}Read.R5空闲_LAST\", \"1\", $\"S{item}ReadQueue\");\r\n                break;\r\n            }\r\n        }\r\n        else if (R5 != 5 && R5空闲_LAST == 1)\r\n        {\r\n            RedisHelper.Add($\"S{item}Read.R5空闲_LAST\", \"0\", out string msg1);\r\n        }\r\n    }\r\n    else if (RtaskState != 3 && RtaskState_LAST == 1)\r\n    {\r\n        RedisHelper.Add($\"S{Bssx}Read.RtaskState_LAST\", \"0\", out string msg);\r\n    }\r\n    System.Threading.Thread.Sleep(2000);\r\n}",
              "ParentID": "20250614173821058",
              "Children": [],
              "Type": "Program",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "Until",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "View",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {
                    "20250306140515428": [
                      "Open"
                    ]
                  }
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.流程2热处理炉进出.转子满下线",
              "ParentFullName": "业务逻辑.流程2热处理炉进出",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250616095605911",
              "Name": "下料位检测",
              "Desc": "",
              "Content": "//下料位检测。  1003  到位时 写 标识信号 并 给机械手信号。  \r\nforeach (var ssx in new string[] { \"1003\", \"1005\", \"1011\", \"1013\" })\r\n{\r\n    var RArrive = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"FNK1003051113.RArrive{ssx}\"), typeof(System.UInt16));\r\n    var RArriveLast = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"FNK1003051113.RArrive{ssx}_LAST\"), typeof(System.UInt16));\r\n    if (RArrive == 1 && RArriveLast == 0)\r\n    {\r\n        if (ssx == \"1005\")\r\n        {\r\n            tag.FNK1.D2210 = 1;\r\n            tag.SF下料位.RArrive1005_LAST = 1;\r\n\r\n            tag.SF下料位.WRelease1005 = 0;\r\n            tag.SF下料位.WSafe0305 = 0;\r\n        }\r\n        else if (ssx == \"1003\")\r\n        {\r\n            tag.FNK2.D2215 = 1;\r\n            tag.SF下料位.RArrive1003_LAST = 1;\r\n\r\n            tag.SF下料位.WRelease1003 = 0;\r\n            tag.SF下料位.WSafe0305 = 0;\r\n        }\r\n        else if (ssx == \"1013\")\r\n        {\r\n            tag.FNK2.D2210 = 1;\r\n            tag.SF下料位.RArrive1013_LAST = 1;\r\n\r\n            tag.SF下料位.WRelease1013 = 0;\r\n            tag.SF下料位.WSafe1113 = 0;\r\n        }\r\n        else if (ssx == \"1011\")\r\n        {\r\n            tag.FNK2.D2215 = 1;\r\n            tag.SF下料位.RArrive1011_LAST = 1;\r\n\r\n            tag.SF下料位.WRelease1011 = 0;\r\n            tag.SF下料位.WSafe1113 = 0;\r\n        }\r\n    }\r\n    else if (RArrive == 0 && RArriveLast == 1)\r\n    {\r\n                                RedisHelper.Add($\"FNK1003051113.RArrive{ssx}_LAST\", \"0\", out string msg);\r\n    }\r\n}",
              "ContentCopy": "//下料位检测。  1003  到位时 写 标识信号 并 给机械手信号。  \r\nforeach (var ssx in new string[] { \"1003\", \"1005\", \"1011\", \"1013\" })\r\n{\r\n    var RArrive = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"FNK1003051113.RArrive{ssx}\"), typeof(System.UInt16));\r\n    var RArriveLast = (System.UInt16)System.Convert.ChangeType(Conn.默认Redis.GetValue($\"FNK1003051113.RArrive{ssx}_LAST\"), typeof(System.UInt16));\r\n    if (RArrive == 1 && RArriveLast == 0)\r\n    {\r\n        if (ssx == \"1005\")\r\n        {\r\n            tag.FNK1.D2210 = 1;\r\n            tag.SF下料位.RArrive1005_LAST = 1;\r\n\r\n            tag.SF下料位.WRelease1005 = 0;\r\n            tag.SF下料位.WSafe0305 = 0;\r\n        }\r\n        else if (ssx == \"1003\")\r\n        {\r\n            tag.FNK2.D2215 = 1;\r\n            tag.SF下料位.RArrive1003_LAST = 1;\r\n\r\n            tag.SF下料位.WRelease1003 = 0;\r\n            tag.SF下料位.WSafe0305 = 0;\r\n        }\r\n        else if (ssx == \"1013\")\r\n        {\r\n            tag.FNK2.D2210 = 1;\r\n            tag.SF下料位.RArrive1013_LAST = 1;\r\n\r\n            tag.SF下料位.WRelease1013 = 0;\r\n            tag.SF下料位.WSafe1113 = 0;\r\n        }\r\n        else if (ssx == \"1011\")\r\n        {\r\n            tag.FNK2.D2215 = 1;\r\n            tag.SF下料位.RArrive1011_LAST = 1;\r\n\r\n            tag.SF下料位.WRelease1011 = 0;\r\n            tag.SF下料位.WSafe1113 = 0;\r\n        }\r\n    }\r\n    else if (RArrive == 0 && RArriveLast == 1)\r\n    {\r\n                                RedisHelper.Add($\"FNK1003051113.RArrive{ssx}_LAST\", \"0\", out string msg);\r\n    }\r\n}",
              "ParentID": "20250614173821058",
              "Children": [],
              "Type": "Program",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "Until",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "View",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {
                    "20250306140515428": [
                      "Open"
                    ]
                  }
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.流程2热处理炉进出.下料位检测",
              "ParentFullName": "业务逻辑.流程2热处理炉进出",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250616095709155",
              "Name": "1号FNK机械手完成",
              "Desc": "",
              "Content": "if (tag.FNK1.D2212 == 1 && tag.FNK1.D2212_LAST == 0)\r\n{\r\n    tag.FNK1.D2210 = 0;\r\n    tag.FNK1.D2212_LAST = 1;\r\n\r\n    tag.SF下料位.WRelease1005 = 1;\r\n    tag.SF下料位.WSafe0305 = 1;\r\n}\r\nelse if (tag.FNK1.D2212 == 0 && tag.FNK1.D2212_LAST == 1)\r\n{\r\n    tag.FNK1.D2212_LAST = 0;\r\n}\r\nif (tag.FNK1.D2217 == 1 && tag.FNK1.D2217_LAST == 0)\r\n{\r\n    tag.FNK1.D2215 = 0;\r\n    tag.FNK1.D2217_LAST = 1;\r\n\r\n    tag.SF下料位.WRelease1003 = 1;\r\n    tag.SF下料位.WSafe0305 = 1;\r\n}\r\nelse if (tag.FNK1.D2217 == 0 && tag.FNK1.D2217_LAST == 1)\r\n    tag.FNK1.D2217_LAST = 0;\r\n",
              "ContentCopy": "if (tag.FNK1.D2212 == 1 && tag.FNK1.D2212_LAST == 0)\r\n{\r\n    tag.FNK1.D2210 = 0;\r\n    tag.FNK1.D2212_LAST = 1;\r\n\r\n    tag.SF下料位.WRelease1005 = 1;\r\n    tag.SF下料位.WSafe0305 = 1;\r\n}\r\nelse if (tag.FNK1.D2212 == 0 && tag.FNK1.D2212_LAST == 1)\r\n{\r\n    tag.FNK1.D2212_LAST = 0;\r\n}\r\nif (tag.FNK1.D2217 == 1 && tag.FNK1.D2217_LAST == 0)\r\n{\r\n    tag.FNK1.D2215 = 0;\r\n    tag.FNK1.D2217_LAST = 1;\r\n\r\n    tag.SF下料位.WRelease1003 = 1;\r\n    tag.SF下料位.WSafe0305 = 1;\r\n}\r\nelse if (tag.FNK1.D2217 == 0 && tag.FNK1.D2217_LAST == 1)\r\n    tag.FNK1.D2217_LAST = 0;\r\n",
              "ParentID": "20250614173821058",
              "Children": [],
              "Type": "Program",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "Until",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "View",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {
                    "20250306140515428": [
                      "Open"
                    ]
                  }
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.流程2热处理炉进出.1号FNK机械手完成",
              "ParentFullName": "业务逻辑.流程2热处理炉进出",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250616095733680",
              "Name": "2号FNK机械手完成",
              "Desc": "",
              "Content": " if (tag.FNK2.D2212 == 1 && tag.FNK2.D2212_LAST == 0)\r\n {\r\n     tag.FNK2.D2210 = 0;\r\n     tag.FNK2.D2212_LAST = 1;\r\n\r\n     tag.SF下料位.WRelease1013 = 1;\r\n     tag.SF下料位.WSafe1113 = 1;\r\n }\r\n else if (tag.FNK2.D2212 == 0 && tag.FNK2.D2212_LAST == 1)\r\n {\r\n     tag.FNK2.D2212_LAST = 0;\r\n }\r\n if (tag.FNK2.D2217 == 1 && tag.FNK2.D2217_LAST == 0)\r\n {\r\n     tag.FNK2.D2215 = 0;\r\n     tag.FNK2.D2217_LAST = 1;\r\n\r\n     tag.SF下料位.WRelease1011 = 1;\r\n     tag.SF下料位.WSafe1113 = 1;\r\n }\r\n else if (tag.FNK2.D2217 == 0 && tag.FNK2.D2217_LAST == 1)\r\n     tag.FNK2.D2217_LAST = 0;",
              "ContentCopy": " if (tag.FNK2.D2212 == 1 && tag.FNK2.D2212_LAST == 0)\r\n {\r\n     tag.FNK2.D2210 = 0;\r\n     tag.FNK2.D2212_LAST = 1;\r\n\r\n     tag.SF下料位.WRelease1013 = 1;\r\n     tag.SF下料位.WSafe1113 = 1;\r\n }\r\n else if (tag.FNK2.D2212 == 0 && tag.FNK2.D2212_LAST == 1)\r\n {\r\n     tag.FNK2.D2212_LAST = 0;\r\n }\r\n if (tag.FNK2.D2217 == 1 && tag.FNK2.D2217_LAST == 0)\r\n {\r\n     tag.FNK2.D2215 = 0;\r\n     tag.FNK2.D2217_LAST = 1;\r\n\r\n     tag.SF下料位.WRelease1011 = 1;\r\n     tag.SF下料位.WSafe1113 = 1;\r\n }\r\n else if (tag.FNK2.D2217 == 0 && tag.FNK2.D2217_LAST == 1)\r\n     tag.FNK2.D2217_LAST = 0;",
              "ParentID": "20250614173821058",
              "Children": [],
              "Type": "Program",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "Until",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "View",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {
                    "20250306140515428": [
                      "Open"
                    ]
                  }
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.流程2热处理炉进出.2号FNK机械手完成",
              "ParentFullName": "业务逻辑.流程2热处理炉进出",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250617081923670",
              "Name": "1019转满出输送线",
              "Desc": "",
              "Content": "",
              "ContentCopy": "",
              "ParentID": "20250614173821058",
              "Children": [
                {
                  "ID": "20250617085708084",
                  "Name": "Program1",
                  "Desc": "",
                  "Content": "\r\n Console.WriteLine($\"1019任务状态:{tag.SA1019.RtaskState}- barcode:{tag.SA1019.R托盘码}- 空闲{tag.SA1019.R5空闲}\");",
                  "ContentCopy": "\r\n Console.WriteLine($\"1019任务状态:{tag.SA1019.RtaskState}- barcode:{tag.SA1019.R托盘码}- 空闲{tag.SA1019.R5空闲}\");",
                  "ParentID": "20250617081923670",
                  "Children": [],
                  "Type": "Program",
                  "Property": {
                    "SyncExec": "False",
                    "RepeatExec": "Until",
                    "ExceCount": 1,
                    "ExceInternal": 3000,
                    "StartCondition": {
                      "Type": "View",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {
                        "20250306140515428": [
                          "Open"
                        ]
                      }
                    },
                    "EndCondition": {
                      "Type": "None",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {}
                    }
                  },
                  "FullName": "业务逻辑.流程2热处理炉进出.1019转满出输送线.Program1",
                  "ParentFullName": "业务逻辑.流程2热处理炉进出.1019转满出输送线",
                  "Enabled": "Enabled"
                }
              ],
              "Type": "Group",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "None",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.流程2热处理炉进出.1019转满出输送线",
              "ParentFullName": "业务逻辑.流程2热处理炉进出",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250617081926036",
              "Name": "1025agv上空",
              "Desc": "",
              "Content": "",
              "ContentCopy": "",
              "ParentID": "20250614173821058",
              "Children": [
                {
                  "ID": "20250617085712101",
                  "Name": "Program1",
                  "Desc": "",
                  "Content": "\r\n                        Console.WriteLine($\"SA1025 任务状态:{tag.SA1025.RtaskState}- 空闲{tag.SA1025.R5空闲}\");",
                  "ContentCopy": "\r\n                        Console.WriteLine($\"SA1025 任务状态:{tag.SA1025.RtaskState}- 空闲{tag.SA1025.R5空闲}\");",
                  "ParentID": "20250617081926036",
                  "Children": [],
                  "Type": "Program",
                  "Property": {
                    "SyncExec": "False",
                    "RepeatExec": "Until",
                    "ExceCount": 1,
                    "ExceInternal": 3000,
                    "StartCondition": {
                      "Type": "View",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {
                        "20250306140515428": [
                          "Open"
                        ]
                      }
                    },
                    "EndCondition": {
                      "Type": "None",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {}
                    }
                  },
                  "FullName": "业务逻辑.流程2热处理炉进出.1025agv上空.Program1",
                  "ParentFullName": "业务逻辑.流程2热处理炉进出.1025agv上空",
                  "Enabled": "Enabled"
                }
              ],
              "Type": "Group",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "None",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.流程2热处理炉进出.1025agv上空",
              "ParentFullName": "业务逻辑.流程2热处理炉进出",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250617081930010",
              "Name": "1022agv上空",
              "Desc": "",
              "Content": "",
              "ContentCopy": "",
              "ParentID": "20250614173821058",
              "Children": [
                {
                  "ID": "20250617085750712",
                  "Name": "Program1",
                  "Desc": "",
                  "Content": "\r\n                        Console.WriteLine($\"SA1022 任务状态:{tag.SA1022.RtaskState}- 空闲{tag.SA1022.R5空闲}\");",
                  "ContentCopy": "\r\n                        Console.WriteLine($\"SA1022 任务状态:{tag.SA1022.RtaskState}- 空闲{tag.SA1022.R5空闲}\");",
                  "ParentID": "20250617081930010",
                  "Children": [],
                  "Type": "Program",
                  "Property": {
                    "SyncExec": "False",
                    "RepeatExec": "Until",
                    "ExceCount": 1,
                    "ExceInternal": 3000,
                    "StartCondition": {
                      "Type": "View",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {
                        "20250306140515428": [
                          "Open"
                        ]
                      }
                    },
                    "EndCondition": {
                      "Type": "None",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {}
                    }
                  },
                  "FullName": "业务逻辑.流程2热处理炉进出.1022agv上空.Program1",
                  "ParentFullName": "业务逻辑.流程2热处理炉进出.1022agv上空",
                  "Enabled": "Enabled"
                }
              ],
              "Type": "Group",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "None",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.流程2热处理炉进出.1022agv上空",
              "ParentFullName": "业务逻辑.流程2热处理炉进出",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250617081932131",
              "Name": "1030下母托",
              "Desc": "",
              "Content": "",
              "ContentCopy": "",
              "ParentID": "20250614173821058",
              "Children": [
                {
                  "ID": "20250617085800942",
                  "Name": "Program1",
                  "Desc": "",
                  "Content": "\r\n                        Console.WriteLine($\"SA1030 任务状态:{tag.SA1030.RtaskState}- 空闲{tag.SA1030.R5空闲}-->对应终点2001>空闲5:{tag.SA2001.R5空闲}\");",
                  "ContentCopy": "\r\n                        Console.WriteLine($\"SA1030 任务状态:{tag.SA1030.RtaskState}- 空闲{tag.SA1030.R5空闲}-->对应终点2001>空闲5:{tag.SA2001.R5空闲}\");",
                  "ParentID": "20250617081932131",
                  "Children": [],
                  "Type": "Program",
                  "Property": {
                    "SyncExec": "False",
                    "RepeatExec": "Until",
                    "ExceCount": 1,
                    "ExceInternal": 3000,
                    "StartCondition": {
                      "Type": "View",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {
                        "20250306140515428": [
                          "Open"
                        ]
                      }
                    },
                    "EndCondition": {
                      "Type": "None",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {}
                    }
                  },
                  "FullName": "业务逻辑.流程2热处理炉进出.1030下母托.Program1",
                  "ParentFullName": "业务逻辑.流程2热处理炉进出.1030下母托",
                  "Enabled": "Enabled"
                }
              ],
              "Type": "Group",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "None",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.流程2热处理炉进出.1030下母托",
              "ParentFullName": "业务逻辑.流程2热处理炉进出",
              "Enabled": "Enabled"
            },
            {
              "ID": "20250617081938161",
              "Name": "2030输送线下定子",
              "Desc": "",
              "Content": "",
              "ContentCopy": "",
              "ParentID": "20250614173821058",
              "Children": [
                {
                  "ID": "20250617085809982",
                  "Name": "Program1",
                  "Desc": "",
                  "Content": "\r\n                        Console.WriteLine($\"SA2030 任务状态:{tag.SA2030.RtaskState}- 空闲{tag.SA2030.R5空闲} - barcode:{tag.SA2030.R托盘码}\");",
                  "ContentCopy": "\r\n                        Console.WriteLine($\"SA2030 任务状态:{tag.SA2030.RtaskState}- 空闲{tag.SA2030.R5空闲} - barcode:{tag.SA2030.R托盘码}\");",
                  "ParentID": "20250617081938161",
                  "Children": [],
                  "Type": "Program",
                  "Property": {
                    "SyncExec": "False",
                    "RepeatExec": "Until",
                    "ExceCount": 1,
                    "ExceInternal": 3000,
                    "StartCondition": {
                      "Type": "View",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {
                        "20250306140515428": [
                          "Open"
                        ]
                      }
                    },
                    "EndCondition": {
                      "Type": "None",
                      "Event": "",
                      "Expression": "",
                      "Judge": "",
                      "Command": {},
                      "HmiEvent": {}
                    }
                  },
                  "FullName": "业务逻辑.流程2热处理炉进出.2030输送线下定子.Program1",
                  "ParentFullName": "业务逻辑.流程2热处理炉进出.2030输送线下定子",
                  "Enabled": "Enabled"
                }
              ],
              "Type": "Group",
              "Property": {
                "SyncExec": "False",
                "RepeatExec": "None",
                "ExceCount": 1,
                "ExceInternal": 3000,
                "StartCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                },
                "EndCondition": {
                  "Type": "None",
                  "Event": "",
                  "Expression": "",
                  "Judge": "",
                  "Command": {},
                  "HmiEvent": {}
                }
              },
              "FullName": "业务逻辑.流程2热处理炉进出.2030输送线下定子",
              "ParentFullName": "业务逻辑.流程2热处理炉进出",
              "Enabled": "Enabled"
            }
          ],
          "Type": "Group",
          "Property": {
            "SyncExec": "False",
            "RepeatExec": "None",
            "ExceCount": 1,
            "ExceInternal": 3000,
            "StartCondition": {
              "Type": "None",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {}
            },
            "EndCondition": {
              "Type": "None",
              "Event": "",
              "Expression": "",
              "Judge": "",
              "Command": {},
              "HmiEvent": {}
            }
          },
          "FullName": "业务逻辑.流程2热处理炉进出",
          "ParentFullName": "业务逻辑",
          "Enabled": "Enabled"
        }
      ],
      "Type": "Group",
      "Property": {
        "SyncExec": "False",
        "RepeatExec": "None",
        "ExceCount": 1,
        "ExceInternal": 3000,
        "StartCondition": {
          "Type": "None",
          "Event": "",
          "Expression": "",
          "Judge": "",
          "Command": {},
          "HmiEvent": {}
        },
        "EndCondition": {
          "Type": "None",
          "Event": "",
          "Expression": "",
          "Judge": "",
          "Command": {},
          "HmiEvent": {}
        }
      },
      "FullName": "业务逻辑",
      "ParentFullName": "",
      "Enabled": "Enabled"
    },
    {
      "ID": "20250226153120181",
      "Name": "界面处理",
      "Desc": "",
      "Content": "",
      "ContentCopy": "",
      "ParentID": "",
      "Children": [],
      "Type": "Group",
      "Property": {
        "SyncExec": "False",
        "RepeatExec": "None",
        "ExceCount": 1,
        "ExceInternal": 3000,
        "StartCondition": {
          "Type": "None",
          "Event": "",
          "Expression": "",
          "Judge": "",
          "Command": {},
          "HmiEvent": {}
        },
        "EndCondition": {
          "Type": "None",
          "Event": "",
          "Expression": "",
          "Judge": "",
          "Command": {},
          "HmiEvent": {}
        }
      },
      "FullName": "界面处理",
      "ParentFullName": "",
      "Enabled": "Enabled"
    }
  ],
  "CreationTime": "2025-02-26 15:31:20",
  "LastWriteTime": "2025-06-18 23:06:58",
  "HasSaved": true
}