13
13
{attribute addProperty Name "|[[1]Attribute_stopDefaultName]|"}
14
14
_stopDefault : TcoCore.TcoTask(THIS^);
15
15
increment: INT;
16
+ _suspendedHome:BOOL;
17
+ _suspendedWork:BOOL;
16
18
END_VAR
17
19
VAR
18
20
_config : TcoCylinderConfig;
21
23
END_VAR]]> </Declaration >
22
24
<Implementation >
23
25
<ST ><![CDATA[ SUPER^(inoAtHomePos := inoAtHomePos, inoAtWorkPos := inoAtWorkPos, inoToHomePos := inoToHomePos, inoToWorkPos := inoToWorkPos);
26
+
24
27
25
28
IF(_atHomePos AND _atWorkPos) THEN Messenger.Error('<#Home and work position sensors are both active. Check the position of sensors!#>'); END_IF;
26
29
@@ -32,12 +35,11 @@ _moveHomeDefault(PositionSensor := _atHomePos AND NOT _atWorkPos,
32
35
MoveToPositionSignal := _toHomePos,
33
36
InverseSignal := _toWorkPos,
34
37
TimeToRefill:=_config.TimeToRefill,
38
+ refInverseTask:=_moveWorkDefault,
35
39
MaxTimeToReachPosition := _config.TimeToReachHomePosition,
36
40
PositionName := '<#Home#>');
37
41
38
- IF _moveHomeDefault.Execute() THEN
39
- _moveWorkDefault.Restore();
40
- END_IF
42
+
41
43
42
44
// Disables mutualy exclusive actions
43
45
_moveHomeDefault.Enabled := TRUE;//NOT _moveWorkDefault.Busy;
@@ -46,12 +48,10 @@ _moveWorkDefault(PositionSensor := _atWorkPos AND NOT _atHomePos,
46
48
MoveToPositionSignal := _toWorkPos,
47
49
InverseSignal := _toHomePos,
48
50
TimeToRefill:=_config.TimeToRefill,
51
+ refInverseTask:=_moveHomeDefault,
49
52
MaxTimeToReachPosition := _config.TimeToReachWorkPosition,
50
53
PositionName := '<#Work#>');
51
54
52
- IF _moveWorkDefault.Execute() THEN
53
- _moveHomeDefault.Restore();
54
- END_IF
55
55
56
56
IF (_stopDefault.Execute()) THEN
57
57
_toHomePos := FALSE;
@@ -65,6 +65,8 @@ IF (_stopDefault.Execute()) THEN
65
65
_stopDefault.DoneWhen(TRUE);
66
66
END_IF
67
67
68
+
69
+
68
70
// For further discussion about Status
69
71
IF(_moveHomeDefault.Busy) THEN
70
72
_status.ActionDescription := 'Moving to home position';
307
309
_signalInfo : TcoSignalInfo;
308
310
END_VAR]]> </Declaration >
309
311
<Implementation >
310
- <ST ><![CDATA[ IF (_toHomePos OR _moveHomeDefault.Busy) AND inoDisableCondition THEN
312
+ <ST ><![CDATA[ _suspendedHome:=inoDisableCondition;
313
+
314
+ IF (_toHomePos OR _moveHomeDefault.Busy) AND inoDisableCondition THEN
311
315
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
312
316
Messenger.Warning(CONCAT('<#Movement suspended due to#> : ' , _signalInfo.SymbolPath));
313
317
_toHomePos := FALSE;
@@ -324,7 +328,9 @@ VAR_INPUT
324
328
END_VAR
325
329
]]> </Declaration >
326
330
<Implementation >
327
- <ST ><![CDATA[ IF (_toHomePos OR _moveHomeDefault.Busy) AND inDisableCondition THEN
331
+ <ST ><![CDATA[ _suspendedHome:=inDisableCondition;
332
+
333
+ IF (_toHomePos OR _moveHomeDefault.Busy) AND inDisableCondition THEN
328
334
Messenger.Warning(CONCAT('<#Movement suspended due to#> : ' , inMessage));
329
335
_toHomePos := FALSE;
330
336
IF(__ISVALIDREF(THIS^.inoToHomePos)) THEN THIS^.inoToHomePos := FALSE; END_IF;
360
366
_signalInfo : TcoSignalInfo;
361
367
END_VAR]]> </Declaration >
362
368
<Implementation >
363
- <ST ><![CDATA[ IF (_toHomePos OR _moveHomeDefault.Busy) AND not inoDisableCondition THEN
369
+ <ST ><![CDATA[ _suspendedHome:=inoDisableCondition;
370
+
371
+ IF (_toHomePos OR _moveHomeDefault.Busy) AND not inoDisableCondition THEN
364
372
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
365
373
Messenger.Warning(CONCAT('<#Movement suspended due to NOT#> : ' , _signalInfo.SymbolPath));
366
374
_toHomePos := FALSE;
397
405
_signalInfo : TcoSignalInfo;
398
406
END_VAR]]> </Declaration >
399
407
<Implementation >
400
- <ST ><![CDATA[ IF (_toWorkPos OR _moveWorkDefault.Busy) AND inoDisableCondition THEN
408
+ <ST ><![CDATA[ _suspendedWork:=inoDisableCondition;
409
+ IF (_toWorkPos OR _moveWorkDefault.Busy) AND inoDisableCondition THEN
401
410
_signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
402
411
Messenger.Warning(CONCAT('<#Movement suspended due to#> : ' , _signalInfo.SymbolPath));
403
412
_toWorkPos := FALSE;
@@ -414,11 +423,15 @@ VAR_INPUT
414
423
END_VAR
415
424
]]> </Declaration >
416
425
<Implementation >
417
- <ST ><![CDATA[ IF (_toWorkPos OR _moveWorkDefault.Busy) AND inDisableCondition THEN
418
- Messenger.Warning(CONCAT('<#Movement suspended due to#> : ' , inMessage));
419
- _toWorkPos := FALSE;
420
- IF(__ISVALIDREF(THIS^.inoToWorkPos)) THEN THIS^.inoToWorkPos := FALSE; END_IF;
421
-
426
+ <ST ><![CDATA[ _suspendedWork := inDisableCondition;
427
+
428
+ IF (_toWorkPos OR _moveWorkDefault.Busy) AND inDisableCondition THEN
429
+ Messenger.Warning(CONCAT('<#Movement suspended due to#> : ', inMessage));
430
+ _toWorkPos := FALSE;
431
+ IF (__ISVALIDREF(THIS^.inoToWorkPos)) THEN
432
+ THIS^.inoToWorkPos := FALSE;
433
+ END_IF;
434
+
422
435
END_IF]]> </ST >
423
436
</Implementation >
424
437
</Method >
@@ -450,11 +463,15 @@ VAR
450
463
_signalInfo : TcoSignalInfo;
451
464
END_VAR]]> </Declaration >
452
465
<Implementation >
453
- <ST ><![CDATA[ IF (_toWorkPos OR _moveWorkDefault.Busy) AND not inoDisableCondition THEN
454
- _signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
455
- Messenger.Warning(CONCAT('<#Movement suspended due to NOT#> : ' , _signalInfo.SymbolPath));
456
- _toWorkPos := FALSE;
457
- IF(__ISVALIDREF(THIS^.inoToWorkPos)) THEN THIS^.inoToWorkPos := FALSE; END_IF;
466
+ <ST ><![CDATA[ _suspendedWork := inoDisableCondition;
467
+
468
+ IF (_toWorkPos OR _moveWorkDefault.Busy) AND not inoDisableCondition THEN
469
+ _signalInfo.GetSignalInfo(SIZEOF(inoDisableCondition), ADR(inoDisableCondition));
470
+ Messenger.Warning(CONCAT('<#Movement suspended due to NOT#> : ', _signalInfo.SymbolPath));
471
+ _toWorkPos := FALSE;
472
+ IF (__ISVALIDREF(THIS^.inoToWorkPos)) THEN
473
+ THIS^.inoToWorkPos := FALSE;
474
+ END_IF;
458
475
459
476
END_IF]]> </ST >
460
477
</Implementation >
0 commit comments