[r26]: / branches / PackMLState / Main_Escape_PLC / Plc Logic / Application / Function Blocks / Puzzle / LaserStateMachine / svnobj  Maximize  Restore  History

Download this file

72 lines (68 with data), 18.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
IF NOT xInit THEN	
	UM				(		sName := 'Normal Operation', 
							dwAllowsLeavingFromStates := PACK_ML.State.Stopped OR PACK_ML.State.Aborted OR PACK_ML.State.Idle, 
		IF SysStrCmp(Client.sCommandToPLC, Client.LockCommands[0]) =  0 THEN;		
			Lock_CO_Match := TRUE;
			
		ELSIF SysStrCmp(Client.sCommandToPLC, 'UnSuspend') =  0 THEN		
			UnSuspend();
		
	END_CASE
	Client.iCommandToPLC := 0;
	Client.sCommandToPLC := '';
	Client.bReadyToPLC := FALSE;
CASE UM.CurrentState OF
PACK_ML.State.Stopped:
;
PACK_ML.State.Aborted:
PACK_ML.State.Idle:
PACK_ML.State.Complete :
PACK_ML.State.Execute :
	IF puzzleTimer.iProcess = 25 THEN
		IF Client.ActualStep < 30 THEN
			SendCommand(Command := CommandType.Media ,Value := 'PACKML');				
	END_IF
	IF puzzleTimer.iProcess = 50 THEN
		IF Client.ActualStep >= 30 THEN
		SendCommand(Command := CommandType.Media ,Value := 'Automation Suite');		
	CASE Client.ActualStep OF
	0: // aborted
		LaserGamePuzzle := PACK_ML.Aborted;
		DO_Reset_Light := bl.OUT;
		IF (overrideStart OR DI_Init )AND NOT DI_Auto_Hand_Switch THEN
			Client.ActualStep := 20;
			DO_HintLaser_ON := TRUE;
			DO_Storing_Light := FALSE;			
		END_IF		
		IF NOT DI_NoodstopCabinet THEN;
			Client.ActualStep := 0;
			DO_HintLaser_ON := FALSE;
			DO_Spanning_Light := FALSE;
			DO_Storing_Light := FALSE;	
	20: // Idle
		LaserGamePuzzle := PACK_ML.Idle;
		DO_In_Bedrijf_Light := bl2.OUT;
		r_trig(CLK:= DI_Start_Switch AND NOT DI_Auto_Hand_Switch);
		IF r_trig.Q OR overrideStart THEN
    		overrideStart := FALSE;	
			DO_In_Bedrijf_Light	:= TRUE;
			DO_Laser_ON := TRUE;	
			Client.ActualStep := 30;	
		IF Lock_CO_Match THEN				//OR ton.Q
			DO_Laser_ON := FALSE;				
			Client.ActualStep := 0;		
	DO_Auto_Hand_Light := NOT DI_Auto_Hand_Switch;
 
    overrideStart := FALSE;
	Client.Progress := 0;	
	DO_Storing_Light := FALSE;
	DO_Auto_Hand_Light := FALSE;
	DO_Laser_ON := FALSE;
	Lock_CO_Match := FALSE;
	StateComplete();
PACK_ML.State.Completing :	
PACK_ML.State.Aborting :
PACK_ML.State.Stopping:
PACK_ML.State.Clearing :
IF NOT (DI_EmergencyGF AND NOT DI_EmergencyFF) THEN
	Abort();	
Client.ActualState := UM.CurrentState;
IF puzzleTimer.iProcess >= 100 THEN
bl(ENABLE := TRUE,TIMELOW := T#250MS,TIMEHIGH:= T#500MS);