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

Download this file

64 lines (61 with data), 18.2 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
ChildObjectGuids
AddAttributeSubsequent
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 = 20 THEN
		IF Client.ActualStep < 30 THEN
			SendCommand(Command := CommandType.Hint ,Value := 'The statemachine is visible in the display.');	
	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;
			SendCommand(Command:= CommandType.Key, Value:= Client.KeyCommands[0]);	// cabinet enabled
		IF NOT DI_Stop THEN
			Client.ActualStep := 10;		
			DO_In_Bedrijf_Light := FALSE;	
			DO_Laser_ON := FALSE;
		IF NOT DI_NoodstopCabinet THEN;		
	30: // Execute
		LaserGamePuzzle := PACK_ML.Execute;
		ton(PT := T#2M,IN := TRUE);
		IF Lock_CO_Match THEN				//OR ton.Q
			StateComplete();					
			DO_In_Bedrijf_Light := FALSE;
		END_IF	
	END_CASE 
	Client.Progress := puzzleTimer.iProcess;
PACK_ML.State.Resetting :
	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);