-
Notifications
You must be signed in to change notification settings - Fork 0
/
07_VYTAH.ST.bak
65 lines (62 loc) · 2.29 KB
/
07_VYTAH.ST.bak
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
VAR_GLOBAL
timePLC AT %s16 : INT := 0;
timeDelayed : INT := 0;
switchCase : INT := 0;
fifthFloorElevDoorsOpen : BOOL := FALSE;
fourthFloorElevDoorsOpen : BOOL := FALSE;
thirdFloorElevDoorsOpen : BOOL := FALSE;
secondFloorElevDoorsOpen : BOOL := FALSE;
firstFloorElevDoorsOpen : BOOL := TRUE;
elevatorFloor : INT := 5; // 1, 2, 3, 4
fifthFloorButtonPressed : BOOL := FALSE;
fourthFloorButtonPressed : BOOL := FALSE;
thirdFloorButtonPressed : BOOL := FALSE;
secondFloorButtonPressed : BOOL := FALSE;
firstFloorButtonPressed : BOOL := FALSE;
elevatorFifthFloorButtonPressed : BOOL := FALSE;
elevatorFourthFloorButtonPressed : BOOL := FALSE;
elevatorThirdFloorButtonPressed : BOOL := FALSE;
elevatorSecondFloorButtonPressed : BOOL := FALSE;
elevatorFirstFloorButtonPressed : BOOL := FALSE;
elevatorButtonStopPressed : BOOL := FALSE;
// -1: down | 0: idle | 1: up
forceOpenDoors : BOOL := FALSE;
elevatorDirection : INT := 0;
anyObstacleDetected : BOOL := FALSE;
anyObstacleWasDetected : BOOL := FALSE;
obstacleElevator : BOOL := FALSE;
obstacleElevatorFifthFloor : BOOL := FALSE;
obstacleElevatorFourthFloor : BOOL := FALSE;
obstacleElevatorThirdFloor : BOOL := FALSE;
obstacleElevatorSecondFloor : BOOL := FALSE;
obstacleElevatorFirstFloor : BOOL := FALSE;
elevatorMaximumWeight : INT := 300;
elevatorWeight : INT := 0;
// constants
elevatorFloorTravelTime : INT := 1;
elevatorFloorDoorsOpenTime : INT := 2;
waitingForDoors : BOOL := FALSE;
highestFloor : INT := 5;
targetFloorDefaultValue : INT := -1;
// floors
anyFloorButtonPressed : BOOL := FALSE;
anyFifthFloorButtonPressed : BOOL := FALSE;
anyFourthFloorButtonPressed : BOOL := FALSE;
anyThirdFloorButtonPressed : BOOL := FALSE;
anySecondFloorButtonPressed : BOOL := FALSE;
anyFirstFloorButtonPressed : BOOL := FALSE;
// movement handlers
targetFloor : INT := -1;
floorDifference : INT := -10;
inputLocked : BOOL := FALSE;
middleFloorStop : BOOL := FALSE;
// text info
textElevatorWeight : STRING := 'Simulovana vaha vytahu [kg]:';
textMaxElevatorWeight : STRING := 'Maximalni vaha vytahu [kg]:';
//misc
stopSignActivated : BOOL := TRUE;
configured : BOOL := FALSE;
queueDefaultValue : INT := -1;
// queue
queue : array[0..10] OF INT; // number of floors * 2
END_VAR