aboutsummaryrefslogtreecommitdiffstats
path: root/tests/999-projects/trafficlights_2.awl
blob: 6eff07fc980c4d04d2d3136e10075a5f06ac39e1 (plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
FUNCTION "Ampelsteuerung" : VOID
TITLE =
VERSION : 0.1

BEGIN
NETWORK
TITLE =Takt/Zähler

      U     "Takt_0.5Hz"; 
      ZV    Z      0; 
      NOP   0; 
      NOP   0; 
      NOP   0; 
      U(    ; 
      O(    ; 
      L     MW    12; 
      L     16; 
      ==I   ; 
      )     ; 
      O     "S0"; 
      ON    "S1"; 
      )     ; 
      R     Z      0; 
      L     Z      0; 
      T     MW    12; 
      NOP   0; 
      NOP   0; 
NETWORK
TITLE =Autoampel Rot

      U(    ; 
      L     MW    12; 
      L     9; 
      >=I   ; 
      )     ; 
      U     "S1"; 
      UN    "S0"; 
      =     "H1"; 
NETWORK
TITLE =Autoampel Gelb

      U(    ; 
      U(    ; 
      L     MW    12; 
      L     7; 
      >=I   ; 
      )     ; 
      UN    "H1"; 
      O(    ; 
      L     MW    12; 
      L     15; 
      >=I   ; 
      )     ; 
      )     ; 
      U     "S1"; 
      O     ; 
      U     "S0"; 
      U     "Takt_0.5Hz"; 
      =     "H2"; 
NETWORK
TITLE =Autoampel Grün

      U(    ; 
      L     MW    12; 
      L     7; 
      <=I   ; 
      )     ; 
      UN    "H2"; 
      U     "S1"; 
      UN    "S0"; 
      =     "H3"; 
NETWORK
TITLE =Fußgängeranpel Rot

      U(    ; 
      O(    ; 
      L     MW    12; 
      L     14; 
      >=I   ; 
      )     ; 
      O(    ; 
      L     MW    12; 
      L     10; 
      <=I   ; 
      )     ; 
      )     ; 
      U     "S1"; 
      UN    "H5"; 
      UN    "S0"; 
      =     "H4"; 
NETWORK
TITLE =Fußgängerampel Grün

      U(    ; 
      L     MW    12; 
      L     10; 
      >=I   ; 
      )     ; 
      U(    ; 
      L     MW    12; 
      L     14; 
      <=I   ; 
      )     ; 
      U     "S1"; 
      UN    "H4"; 
      UN    "S0"; 
      =     "H5"; 
END_FUNCTION


ORGANIZATION_BLOCK OB 1
TITLE = "Main Program Sweep (Cycle)"
VERSION : 0.1


VAR_TEMP
  OB1_EV_CLASS : BYTE ;	//Bits 0-3 = 1 (Coming event), Bits 4-7 = 1 (Event class 1)
  OB1_SCAN_1 : BYTE ;	//1 (Cold restart scan 1 of OB 1), 3 (Scan 2-n of OB 1)
  OB1_PRIORITY : BYTE ;	//Priority of OB Execution
  OB1_OB_NUMBR : BYTE ;	//1 (Organization block 1, OB1)
  OB1_RESERVED_1 : BYTE ;	//Reserved for system
  OB1_RESERVED_2 : BYTE ;	//Reserved for system
  OB1_PREV_CYCLE : INT ;	//Cycle time of previous OB1 scan (milliseconds)
  OB1_MIN_CYCLE : INT ;	//Minimum cycle time of OB1 (milliseconds)
  OB1_MAX_CYCLE : INT ;	//Maximum cycle time of OB1 (milliseconds)
  OB1_DATE_TIME : DATE_AND_TIME ;	//Date and time OB1 started
END_VAR
BEGIN
NETWORK
TITLE =

      CALL "Ampelsteuerung" ;
      NOP   0; 
END_ORGANIZATION_BLOCK


ORGANIZATION_BLOCK OB 100
	TITLE		=
	VERSION		: 0.1
	VAR_TEMP
		OB100_EV_CLASS   : BYTE;          // B#16#13, Event class 1, Entering event state, Event logged in diagnostic buffer
		OB100_STRTUP     : BYTE;          // B#16#81/82/83/84 Method of startup
		OB100_PRIORITY   : BYTE;          // Priority of OB execution
		OB100_OB_NUMBR   : BYTE;          // 100 (Organization block 100, OB 100)
		OB100_RESERVED_1 : BYTE;
		OB100_RESERVED_2 : BYTE;
		OB100_STOP       : WORD;          // Event that caused CPU to stop (W#16#4XXX)
		OB100_STRT_INFO  : DWORD;         // Information on how system started
		OB100_DATE_TIME  : DATE_AND_TIME; // Date and time OB 100 started
	END_VAR
BEGIN
	// Ampel einschalten
	SET;
	=	"S1";
END_ORGANIZATION_BLOCK
bues.ch cgit interface