aboutsummaryrefslogtreecommitdiffstats
path: root/tests/999-projects/impulszaehler.awlpro
blob: fe64a861dcf16d58e2e70536816f26141fef88c7 (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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Awlsim project file generated by awlsim-0.66.0-pre -->
<awlsim_project date_create="2015-02-01 13:10:29.448326"
                date_modify="2018-07-08 18:00:12.603565"
                format_version="1">
	<!-- CPU core configuration -->
	<cpu>
		<!-- CPU core feature specification -->
		<specs call_stack_size="256"
		       nr_accus="2"
		       nr_counters="256"
		       nr_flags="2048"
		       nr_inputs="128"
		       nr_localbytes="1024"
		       nr_outputs="128"
		       nr_timers="256"
		       parenthesis_stack_size="7" />

		<!-- CPU core configuration -->
		<config clock_memory_byte="-1"
		        cycle_time_limit_us="1000000"
		        ext_insns_enable="0"
		        mnemonics="0"
		        ob_startinfo_enable="0"
		        run_time_limit_us="-1" />
	</cpu>

	<!-- AWL/STL language configuration -->
	<language_awl>
		<!-- AWL/STL source code -->
		<source enabled="1"
		        name="OB1"
		        type="0"><![CDATA[
ORGANIZATION_BLOCK OB 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, OB 1)
		OB1_RESERVED_1 : BYTE;
		OB1_RESERVED_2 : BYTE;
		OB1_PREV_CYCLE : INT;           // Cycle time of previous OB 1 scan (milliseconds)
		OB1_MIN_CYCLE  : INT;           // Minimum cycle time of OB 1 (milliseconds)
		OB1_MAX_CYCLE  : INT;           // Maximum cycle time of OB 1 (milliseconds)
		OB1_DATE_TIME  : DATE_AND_TIME; // Date and time OB 1 started
	END_VAR
BEGIN
	CALL "Impulszaehler_aufruf", DB 1
END_ORGANIZATION_BLOCK

]]></source>

		<!-- AWL/STL source code -->
		<source enabled="1"
		        name="Impulszaehler"
		        type="0"><![CDATA[
FUNCTION_BLOCK "impulszaehler"
TITLE =
VERSION : 0.1


VAR_INPUT
  Taste : BOOL ;	
  Zeit_t1 : S5TIME ;	
  Zeitglied_t1 : TIMER ;	
  Zeit_t2 : S5TIME ;	
  Zeitglied_T2 : TIMER ;	
  Obere_Grenze : INT ;	
  Schrittgroesse : INT ;	
END_VAR
VAR_OUTPUT
  Impuls : BOOL ;	
END_VAR
VAR_IN_OUT
  Sollwert : INT ;	
END_VAR
VAR
  Taste_Flankenmerker : BOOL ;	
  Zeit_t1_Flankenmerker : BOOL ;	
  Zeit_t1_Zustand : BOOL ;	
END_VAR
VAR_TEMP
  Impuls_temp : BOOL ;	
  Neuer_Sollwert : INT ;	
END_VAR
BEGIN
NETWORK
TITLE =

      U(    ; 
      U     #Taste; 
      L     #Zeit_t2; 
      SE    #Zeitglied_T2; 
      NOP   0; 
      NOP   0; 
      NOP   0; 
      U     #Zeitglied_T2; 
      )     ; 
      UN    #Zeit_t1_Zustand; 
      L     #Zeit_t1; 
      SV    #Zeitglied_t1; 
      UN    #Taste; 
      R     #Zeitglied_t1; 
      NOP   0; 
      NOP   0; 
      U     #Zeitglied_t1; 
      =     #Zeit_t1_Zustand; 
NETWORK
TITLE =

      U     #Taste; 
      FP    #Taste_Flankenmerker; 
      O(    ; 
      U     #Zeit_t1_Zustand; 
      FP    #Zeit_t1_Flankenmerker; 
      )     ; 
      =     #Impuls; 
      =     #Impuls_temp; 
NETWORK
TITLE =

      L     #Sollwert; 
      L     #Schrittgroesse; 
      +I    ; 
      T     #Neuer_Sollwert; 
      NOP   0; 
NETWORK
TITLE =

      U(    ; 
      L     #Neuer_Sollwert; 
      L     #Obere_Grenze; 
      >I    ; 
      )     ; 
      SPBNB _001; 
      L     #Obere_Grenze; 
      T     #Neuer_Sollwert; 
_001: NOP   0; 
NETWORK
TITLE =

      U     #Impuls_temp; 
      SPBNB _002; 
      L     #Neuer_Sollwert; 
      T     #Sollwert; 
_002: NOP   0; 
END_FUNCTION_BLOCK

FUNCTION_BLOCK "impulszaehler_aufruf"
TITLE =
VERSION : 0.1


VAR
  impulszaehler_1 : "impulszaehler";	
  impulszaehler_2 : "impulszaehler";	
  Sollwert_1 : INT ;	
  Sollwert_2 : INT ;	
END_VAR
BEGIN
NETWORK
TITLE =

      U     E      0.0; 
      =     L      0.0; 
      BLD   103; 
      CALL #impulszaehler_1 (
           Taste                    := L      0.0,
           Zeit_t1                  := S5T#1S,
           Zeitglied_t1             := T      1,
           Zeit_t2                  := S5T#500MS,
           Zeitglied_T2             := T      2,
           Obere_Grenze             := 2000,
           Schrittgroesse           := 10,
           Impuls                   := M     10.0,
           Sollwert                 := #Sollwert_1);
      NOP   0; 
NETWORK
TITLE =

      X     M     11.0; 
      X     M     10.0; 
      =     M     11.0; 
NETWORK
TITLE =

      U     E      0.4; 
      SPBNB _001; 
      L     0; 
      T     #Sollwert_1; 
_001: NOP   0; 
NETWORK
TITLE =

      U     E      0.1; 
      =     L      0.0; 
      BLD   103; 
      CALL #impulszaehler_2 (
           Taste                    := L      0.0,
           Zeit_t1                  := S5T#2S,
           Zeitglied_t1             := T      3,
           Zeit_t2                  := S5T#1S,
           Zeitglied_T2             := T      4,
           Obere_Grenze             := 3000,
           Schrittgroesse           := 25,
           Impuls                   := M     10.1,
           Sollwert                 := #Sollwert_2);
      NOP   0; 
NETWORK
TITLE =

      X     M     11.1; 
      X     M     10.1; 
      =     M     11.1; 
NETWORK
TITLE =

      U     E      0.5; 
      SPBNB _002; 
      L     0; 
      T     #Sollwert_2; 
_002: NOP   0; 
END_FUNCTION_BLOCK


]]></source>

		<!-- AWL/STL source code -->
		<source enabled="1"
		        name="DB"
		        type="0"><![CDATA[
DATA_BLOCK DB 1
	"Impulszaehler_aufruf"
BEGIN
END_DATA_BLOCK

]]></source>
	</language_awl>

	<!-- Symbol table configuration -->
	<symbols>
		<!-- symbol table source code -->
		<source enabled="1"
		        name="Symbol table"
		        type="3"><![CDATA[
126,array_db                DB 60       DB 60                                                                                     
126,array_uebung            FC 60       FC 60                                                                                     
126,BLKMOV                  SFC 20      SFC 20    Copy Variables                                                                  
126,CREAT_DB                SFC 22      SFC 22    Create Data Block                                                               
126,CTD                     SFB 1       SFB 1     Count Down                                                                      
126,CTU                     SFB 0       SFB 0     Count Up                                                                        
126,date_and_time_db        DB 20       DB 20                                                                                     
126,date_and_time_uebung    FC 8        FC 8                                                                                      
126,db_dynamisch            FC 20       FC 20                                                                                     
126,db_zugriff              FC 7        FC 7                                                                                      
126,dbtest_fb               FB 40       FB 40                                                                                     
126,dbtest_fc               FC 10       FC 10                                                                                     
126,DEL_DB                  SFC 23      SFC 23    Delete Data Block                                                               
126,DELETE                  FC 104      FC 104    Delete String                                                                   
126,DT_DAY                  FC 107      FC 107    DT to DAY                                                                       
126,flankenerkennung        FB 20       FB 20                                                                                     
126,impulszaehler           FB 30       FB 30                                                                                     
126,impulszaehler_aufruf    FB 31       FB 31                                                                                     
126,laufbandsteuerung       FC 3        FC 3                                                                                      
126,laufbandsteuerung_aufrufFC 4        FC 4                                                                                      
126,Motor                   UDT 99      UDT 99                                                                                    
126,multiinst_aufruf        FB 100      FB 100                                                                                    
126,pufferspeicher          FC 5        FC 5                                                                                      
126,pufferspeicher_aufruf   FC 6        FC 6                                                                                      
126,READ_CLK                SFC 1       SFC 1     Read System Clock                                                               
126,Rollfeld_Motor_aufruf   FC 53       FC 53                                                                                     
126,Rollfeld_Motor_FC       FC 52       FC 52                                                                                     
126,Rollfeld_Motoren        DB 51       DB 51                                                                                     
126,SB_DT_DT                FC 34       FC 34     Subtract DT - DT                                                                
126,stoeranzeige_fb         FB 1        FB 1                                                                                      
126,stoeranzeige_fc         FC 1        FC 1                                                                                      
126,string_db               DB 50       DB 50                                                                                     
126,string_uebung           FC 50       FC 50                                                                                     
126,taktgenerator           FB 15       FB 15                                                                                     
126,taktgenerator_aufruf    FB 16       FB 16                                                                                     
126,tauchbad                FB 10       FB 10                                                                                     
126,tauchbad_aufruf         FB 11       FB 11                                                                                     
126,TEST_DB                 SFC 24      SFC 24    Test Data Block                                                                 
126,TON                     SFB 4       SFB 4     Generate an On Delay                                                            
126,TP                      SFB 3       SFB 3     Generate a Pulse                                                                
126,zaehler_fc              FC 2        FC 2                                                                                      

]]></source>
	</symbols>

	<!-- Core server link configuration -->
	<core_link>
		<!-- Locally spawned core server -->
		<spawn_local enable="1"
		             interpreters="$DEFAULT"
		             port_range_begin="4183"
		             port_range_end="8278" />

		<!-- Remote server connection -->
		<connect host="localhost"
		         port="4151"
		         timeout_ms="3000" />

		<!-- Transport tunnel -->
		<tunnel local_port="-1"
		        type="0">
			<ssh executable="ssh"
			     port="22"
			     user="pi" />
		</tunnel>
	</core_link>

	<!-- Graphical user interface configuration -->
	<gui>
		<editor autoindent="1"
		        paste_autoindent="1"
		        validation="1" />
	</gui>
</awlsim_project>
bues.ch cgit interface