[r54]: / repair_ballast / Display_Escape_PLC / Plc Logic / Application / Function Blocks / Puzzle / VisionGameStateMachine / svnobj  Maximize  Restore  History

Download this file

61 lines (57 with data), 14.0 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
//---- Client init  ----\\
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		
			//First Lock Function
		ELSIF SysStrCmp(Client.sCommandToPLC, Client.LockCommands[1]) =  0 THEN		
			//Second Lock Function
		ELSIF SysStrCmp(Client.sCommandToPLC, 'UnSuspend') =  0 THEN		
			UnSuspend();
		
	END_CASE
	Client.iCommandToPLC := 0;
	Client.sCommandToPLC := '';
	Client.bReadyToPLC := FALSE;
//---- Client statemachine  ----\\
CASE UM.CurrentState OF
PACK_ML.State.Stopped:
	;
PACK_ML.State.Aborted:
PACK_ML.State.Idle:
PACK_ML.State.Complete :	
PACK_ML.State.Execute :
	CASE Client.Mode OF
		Mode.Mode1: // Target practise simulation
			IF puzzleTimer.iProcess = 25 THEN;
				//SendCommand(Command := CommandType.Media ,Value := 'Padlock K000367');	
			END_IF			
			IF puzzleTimer.iProcess = 75 THEN;
				//
			
	CASE Client.ActualStep OF
					
		sInstructionString := 'Time To Start the Training Excersise, remember this is a battle simulation!';
	40:
PACK_ML.State.Resetting :
	StateComplete();
PACK_ML.State.Starting :
PACK_ML.State.Completing :
PACK_ML.State.Aborting :
PACK_ML.State.Stopping:
PACK_ML.State.Clearing :	
END_CASE
//---- Emergency ----\\
IF NOT x_EmergencyGF AND x_EmergencyFF THEN
	 //Emergency Abort.
	Abort();	
//---- State handling ----\\
Client.ActualState := UM.CurrentState;
messageQueue(Client := Client);
END_VAR
	UM	: PACK_ML.UnitMode; 
	messageQueue : MessageQueue;
// 
xHide_Leopold 	: BOOL;
xHide_Zeeland 	: BOOL;
xHide_Dolfijn 	: BOOL;
xHide_Crosshair : BOOL;
xHide_Text_Center 	:BOOL;
xHide_Button2		: BOOL;