|
1 <?xml version='1.0' encoding='utf-8'?> |
|
2 <project xmlns:ns1="http://www.plcopen.org/xml/tc6_0201" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.plcopen.org/xml/tc6_0201"> |
|
3 <fileHeader companyName="Beremiz" productName="Beremiz" productVersion="1" creationDateTime="2016-10-24T18:09:22"/> |
|
4 <contentHeader name="First Steps" modificationDateTime="2016-10-26T20:18:02"> |
|
5 <coordinateInfo> |
|
6 <fbd> |
|
7 <scaling x="0" y="0"/> |
|
8 </fbd> |
|
9 <ld> |
|
10 <scaling x="0" y="0"/> |
|
11 </ld> |
|
12 <sfc> |
|
13 <scaling x="0" y="0"/> |
|
14 </sfc> |
|
15 </coordinateInfo> |
|
16 </contentHeader> |
|
17 <types> |
|
18 <dataTypes/> |
|
19 <pous> |
|
20 <pou name="plc_prg" pouType="program"> |
|
21 <interface> |
|
22 <inputVars> |
|
23 <variable name="Reset"> |
|
24 <type> |
|
25 <BOOL/> |
|
26 </type> |
|
27 </variable> |
|
28 </inputVars> |
|
29 <outputVars> |
|
30 <variable name="Cnt1"> |
|
31 <type> |
|
32 <INT/> |
|
33 </type> |
|
34 </variable> |
|
35 <variable name="Cnt2"> |
|
36 <type> |
|
37 <INT/> |
|
38 </type> |
|
39 </variable> |
|
40 <variable name="Cnt3"> |
|
41 <type> |
|
42 <INT/> |
|
43 </type> |
|
44 </variable> |
|
45 <variable name="Cnt4"> |
|
46 <type> |
|
47 <INT/> |
|
48 </type> |
|
49 </variable> |
|
50 <variable name="Cnt5"> |
|
51 <type> |
|
52 <INT/> |
|
53 </type> |
|
54 </variable> |
|
55 </outputVars> |
|
56 <localVars> |
|
57 <variable name="CounterST0"> |
|
58 <type> |
|
59 <derived name="CounterST"/> |
|
60 </type> |
|
61 </variable> |
|
62 <variable name="CounterFBD0"> |
|
63 <type> |
|
64 <derived name="CounterFBD"/> |
|
65 </type> |
|
66 </variable> |
|
67 <variable name="CounterSFC0"> |
|
68 <type> |
|
69 <derived name="CounterSFC"/> |
|
70 </type> |
|
71 </variable> |
|
72 <variable name="CounterIL0"> |
|
73 <type> |
|
74 <derived name="CounterIL"/> |
|
75 </type> |
|
76 </variable> |
|
77 <variable name="CounterLD0"> |
|
78 <type> |
|
79 <derived name="CounterLD"/> |
|
80 </type> |
|
81 </variable> |
|
82 </localVars> |
|
83 </interface> |
|
84 <body> |
|
85 <FBD> |
|
86 <block localId="1" typeName="CounterST" instanceName="CounterST0" executionOrderId="0" height="60" width="125"> |
|
87 <position x="207" y="53"/> |
|
88 <inputVariables> |
|
89 <variable formalParameter="Reset"> |
|
90 <connectionPointIn> |
|
91 <relPosition x="0" y="40"/> |
|
92 <connection refLocalId="2"> |
|
93 <position x="207" y="93"/> |
|
94 <position x="114" y="93"/> |
|
95 </connection> |
|
96 </connectionPointIn> |
|
97 </variable> |
|
98 </inputVariables> |
|
99 <inOutVariables/> |
|
100 <outputVariables> |
|
101 <variable formalParameter="OUT"> |
|
102 <connectionPointOut> |
|
103 <relPosition x="125" y="40"/> |
|
104 </connectionPointOut> |
|
105 </variable> |
|
106 </outputVariables> |
|
107 </block> |
|
108 <inVariable localId="2" executionOrderId="0" height="24" width="79" negated="false"> |
|
109 <position x="35" y="81"/> |
|
110 <connectionPointOut> |
|
111 <relPosition x="79" y="12"/> |
|
112 </connectionPointOut> |
|
113 <expression>Reset</expression> |
|
114 </inVariable> |
|
115 <outVariable localId="3" executionOrderId="0" height="24" width="106" negated="false"> |
|
116 <position x="424" y="81"/> |
|
117 <connectionPointIn> |
|
118 <relPosition x="0" y="12"/> |
|
119 <connection refLocalId="1" formalParameter="OUT"> |
|
120 <position x="424" y="93"/> |
|
121 <position x="332" y="93"/> |
|
122 </connection> |
|
123 </connectionPointIn> |
|
124 <expression>Cnt1</expression> |
|
125 </outVariable> |
|
126 <block localId="4" typeName="CounterFBD" instanceName="CounterFBD0" executionOrderId="0" height="54" width="121"> |
|
127 <position x="211" y="145"/> |
|
128 <inputVariables> |
|
129 <variable formalParameter="Reset"> |
|
130 <connectionPointIn> |
|
131 <relPosition x="0" y="37"/> |
|
132 <connection refLocalId="13"> |
|
133 <position x="211" y="182"/> |
|
134 <position x="115" y="182"/> |
|
135 </connection> |
|
136 </connectionPointIn> |
|
137 </variable> |
|
138 </inputVariables> |
|
139 <inOutVariables/> |
|
140 <outputVariables> |
|
141 <variable formalParameter="OUT"> |
|
142 <connectionPointOut> |
|
143 <relPosition x="121" y="37"/> |
|
144 </connectionPointOut> |
|
145 </variable> |
|
146 </outputVariables> |
|
147 </block> |
|
148 <outVariable localId="5" executionOrderId="0" height="24" width="103" negated="false"> |
|
149 <position x="426" y="170"/> |
|
150 <connectionPointIn> |
|
151 <relPosition x="0" y="12"/> |
|
152 <connection refLocalId="4" formalParameter="OUT"> |
|
153 <position x="426" y="182"/> |
|
154 <position x="332" y="182"/> |
|
155 </connection> |
|
156 </connectionPointIn> |
|
157 <expression>Cnt2</expression> |
|
158 </outVariable> |
|
159 <comment localId="6" height="264" width="417"> |
|
160 <position x="569" y="55"/> |
|
161 <content> |
|
162 <xhtml:p><![CDATA[In this example function block with the same functionality |
|
163 is created using all five IEC 61131-3 programing languages: |
|
164 - IL; |
|
165 - FBD; |
|
166 - LD; |
|
167 - ST; |
|
168 - SFC. |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 Function block is a counter with reset control input. |
|
174 If reset is True counter value is reset to the value defined by |
|
175 global configuration constant ResetCounterValue. |
|
176 If reset is False, counter is incremented every cycle. |
|
177 ]]></xhtml:p> |
|
178 </content> |
|
179 </comment> |
|
180 <block localId="7" typeName="CounterSFC" instanceName="CounterSFC0" executionOrderId="0" height="52" width="121"> |
|
181 <position x="211" y="237"/> |
|
182 <inputVariables> |
|
183 <variable formalParameter="Reset"> |
|
184 <connectionPointIn> |
|
185 <relPosition x="0" y="36"/> |
|
186 <connection refLocalId="12"> |
|
187 <position x="211" y="273"/> |
|
188 <position x="103" y="273"/> |
|
189 </connection> |
|
190 </connectionPointIn> |
|
191 </variable> |
|
192 </inputVariables> |
|
193 <inOutVariables/> |
|
194 <outputVariables> |
|
195 <variable formalParameter="OUT"> |
|
196 <connectionPointOut> |
|
197 <relPosition x="121" y="36"/> |
|
198 </connectionPointOut> |
|
199 </variable> |
|
200 </outputVariables> |
|
201 </block> |
|
202 <outVariable localId="8" executionOrderId="0" height="24" width="97" negated="false"> |
|
203 <position x="431" y="261"/> |
|
204 <connectionPointIn> |
|
205 <relPosition x="0" y="12"/> |
|
206 <connection refLocalId="7" formalParameter="OUT"> |
|
207 <position x="431" y="273"/> |
|
208 <position x="332" y="273"/> |
|
209 </connection> |
|
210 </connectionPointIn> |
|
211 <expression>Cnt3</expression> |
|
212 </outVariable> |
|
213 <block localId="9" typeName="CounterIL" instanceName="CounterIL0" executionOrderId="0" height="62" width="121"> |
|
214 <position x="211" y="322"/> |
|
215 <inputVariables> |
|
216 <variable formalParameter="Reset"> |
|
217 <connectionPointIn> |
|
218 <relPosition x="0" y="41"/> |
|
219 <connection refLocalId="10"> |
|
220 <position x="211" y="363"/> |
|
221 <position x="101" y="363"/> |
|
222 </connection> |
|
223 </connectionPointIn> |
|
224 </variable> |
|
225 </inputVariables> |
|
226 <inOutVariables/> |
|
227 <outputVariables> |
|
228 <variable formalParameter="OUT"> |
|
229 <connectionPointOut> |
|
230 <relPosition x="121" y="41"/> |
|
231 </connectionPointOut> |
|
232 </variable> |
|
233 </outputVariables> |
|
234 </block> |
|
235 <inVariable localId="10" executionOrderId="0" height="24" width="67" negated="false"> |
|
236 <position x="34" y="351"/> |
|
237 <connectionPointOut> |
|
238 <relPosition x="67" y="12"/> |
|
239 </connectionPointOut> |
|
240 <expression>Reset</expression> |
|
241 </inVariable> |
|
242 <outVariable localId="11" executionOrderId="0" height="24" width="91" negated="false"> |
|
243 <position x="434" y="351"/> |
|
244 <connectionPointIn> |
|
245 <relPosition x="0" y="12"/> |
|
246 <connection refLocalId="9" formalParameter="OUT"> |
|
247 <position x="434" y="363"/> |
|
248 <position x="332" y="363"/> |
|
249 </connection> |
|
250 </connectionPointIn> |
|
251 <expression>Cnt4</expression> |
|
252 </outVariable> |
|
253 <inVariable localId="12" executionOrderId="0" height="24" width="67" negated="false"> |
|
254 <position x="36" y="261"/> |
|
255 <connectionPointOut> |
|
256 <relPosition x="67" y="12"/> |
|
257 </connectionPointOut> |
|
258 <expression>Reset</expression> |
|
259 </inVariable> |
|
260 <inVariable localId="13" executionOrderId="0" height="24" width="79" negated="false"> |
|
261 <position x="36" y="170"/> |
|
262 <connectionPointOut> |
|
263 <relPosition x="79" y="12"/> |
|
264 </connectionPointOut> |
|
265 <expression>Reset</expression> |
|
266 </inVariable> |
|
267 <block localId="14" typeName="CounterLD" instanceName="CounterLD0" executionOrderId="0" height="62" width="124"> |
|
268 <position x="210" y="411"/> |
|
269 <inputVariables> |
|
270 <variable formalParameter="Reset"> |
|
271 <connectionPointIn> |
|
272 <relPosition x="0" y="41"/> |
|
273 <connection refLocalId="16"> |
|
274 <position x="210" y="452"/> |
|
275 <position x="100" y="452"/> |
|
276 </connection> |
|
277 </connectionPointIn> |
|
278 </variable> |
|
279 </inputVariables> |
|
280 <inOutVariables/> |
|
281 <outputVariables> |
|
282 <variable formalParameter="Out"> |
|
283 <connectionPointOut> |
|
284 <relPosition x="124" y="41"/> |
|
285 </connectionPointOut> |
|
286 </variable> |
|
287 </outputVariables> |
|
288 </block> |
|
289 <outVariable localId="15" executionOrderId="0" height="24" width="88" negated="false"> |
|
290 <position x="437" y="440"/> |
|
291 <connectionPointIn> |
|
292 <relPosition x="0" y="12"/> |
|
293 <connection refLocalId="14" formalParameter="Out"> |
|
294 <position x="437" y="452"/> |
|
295 <position x="334" y="452"/> |
|
296 </connection> |
|
297 </connectionPointIn> |
|
298 <expression>Cnt5</expression> |
|
299 </outVariable> |
|
300 <inVariable localId="16" executionOrderId="0" height="24" width="64" negated="false"> |
|
301 <position x="36" y="440"/> |
|
302 <connectionPointOut> |
|
303 <relPosition x="64" y="12"/> |
|
304 </connectionPointOut> |
|
305 <expression>Reset</expression> |
|
306 </inVariable> |
|
307 </FBD> |
|
308 </body> |
|
309 </pou> |
|
310 <pou name="CounterST" pouType="functionBlock"> |
|
311 <interface> |
|
312 <inputVars> |
|
313 <variable name="Reset"> |
|
314 <type> |
|
315 <BOOL/> |
|
316 </type> |
|
317 </variable> |
|
318 </inputVars> |
|
319 <localVars> |
|
320 <variable name="Cnt"> |
|
321 <type> |
|
322 <INT/> |
|
323 </type> |
|
324 </variable> |
|
325 </localVars> |
|
326 <outputVars> |
|
327 <variable name="OUT"> |
|
328 <type> |
|
329 <INT/> |
|
330 </type> |
|
331 </variable> |
|
332 </outputVars> |
|
333 <externalVars constant="true"> |
|
334 <variable name="ResetCounterValue"> |
|
335 <type> |
|
336 <INT/> |
|
337 </type> |
|
338 </variable> |
|
339 </externalVars> |
|
340 </interface> |
|
341 <body> |
|
342 <ST> |
|
343 <xhtml:p><![CDATA[IF Reset THEN |
|
344 Cnt := ResetCounterValue; |
|
345 ELSE |
|
346 Cnt := Cnt + 1; |
|
347 END_IF; |
|
348 |
|
349 Out := Cnt;]]></xhtml:p> |
|
350 </ST> |
|
351 </body> |
|
352 </pou> |
|
353 <pou name="CounterFBD" pouType="functionBlock"> |
|
354 <interface> |
|
355 <inputVars> |
|
356 <variable name="Reset"> |
|
357 <type> |
|
358 <BOOL/> |
|
359 </type> |
|
360 </variable> |
|
361 </inputVars> |
|
362 <outputVars> |
|
363 <variable name="OUT"> |
|
364 <type> |
|
365 <INT/> |
|
366 </type> |
|
367 </variable> |
|
368 </outputVars> |
|
369 <localVars> |
|
370 <variable name="Cnt"> |
|
371 <type> |
|
372 <INT/> |
|
373 </type> |
|
374 </variable> |
|
375 </localVars> |
|
376 <externalVars constant="true"> |
|
377 <variable name="ResetCounterValue"> |
|
378 <type> |
|
379 <INT/> |
|
380 </type> |
|
381 </variable> |
|
382 </externalVars> |
|
383 </interface> |
|
384 <body> |
|
385 <FBD> |
|
386 <inVariable localId="1" executionOrderId="0" height="24" width="61" negated="false"> |
|
387 <position x="321" y="58"/> |
|
388 <connectionPointOut> |
|
389 <relPosition x="61" y="12"/> |
|
390 </connectionPointOut> |
|
391 <expression>Reset</expression> |
|
392 </inVariable> |
|
393 <outVariable localId="2" executionOrderId="0" height="24" width="34" negated="false"> |
|
394 <position x="675" y="137"/> |
|
395 <connectionPointIn> |
|
396 <relPosition x="0" y="12"/> |
|
397 <connection refLocalId="3"> |
|
398 <position x="675" y="149"/> |
|
399 <position x="586" y="149"/> |
|
400 </connection> |
|
401 </connectionPointIn> |
|
402 <expression>OUT</expression> |
|
403 </outVariable> |
|
404 <inOutVariable localId="3" executionOrderId="0" height="24" width="29" negatedOut="false" negatedIn="false"> |
|
405 <position x="557" y="137"/> |
|
406 <connectionPointIn> |
|
407 <relPosition x="0" y="12"/> |
|
408 <connection refLocalId="7" formalParameter="OUT"> |
|
409 <position x="557" y="149"/> |
|
410 <position x="524" y="149"/> |
|
411 <position x="524" y="130"/> |
|
412 <position x="505" y="130"/> |
|
413 </connection> |
|
414 </connectionPointIn> |
|
415 <connectionPointOut> |
|
416 <relPosition x="29" y="12"/> |
|
417 </connectionPointOut> |
|
418 <expression>Cnt</expression> |
|
419 </inOutVariable> |
|
420 <block localId="4" typeName="ADD" executionOrderId="0" height="80" width="57"> |
|
421 <position x="328" y="115"/> |
|
422 <inputVariables> |
|
423 <variable formalParameter="IN1"> |
|
424 <connectionPointIn> |
|
425 <relPosition x="0" y="35"/> |
|
426 <connection refLocalId="6"> |
|
427 <position x="328" y="150"/> |
|
428 <position x="275" y="150"/> |
|
429 </connection> |
|
430 </connectionPointIn> |
|
431 </variable> |
|
432 <variable formalParameter="IN2"> |
|
433 <connectionPointIn> |
|
434 <relPosition x="0" y="65"/> |
|
435 <connection refLocalId="3"> |
|
436 <position x="328" y="180"/> |
|
437 <position x="317" y="180"/> |
|
438 <position x="317" y="213"/> |
|
439 <position x="596" y="213"/> |
|
440 <position x="596" y="149"/> |
|
441 <position x="586" y="149"/> |
|
442 </connection> |
|
443 </connectionPointIn> |
|
444 </variable> |
|
445 </inputVariables> |
|
446 <inOutVariables/> |
|
447 <outputVariables> |
|
448 <variable formalParameter="OUT"> |
|
449 <connectionPointOut> |
|
450 <relPosition x="57" y="35"/> |
|
451 </connectionPointOut> |
|
452 </variable> |
|
453 </outputVariables> |
|
454 </block> |
|
455 <inVariable localId="5" executionOrderId="0" height="24" width="158" negated="false"> |
|
456 <position x="222" y="256"/> |
|
457 <connectionPointOut> |
|
458 <relPosition x="158" y="12"/> |
|
459 </connectionPointOut> |
|
460 <expression>ResetCounterValue</expression> |
|
461 </inVariable> |
|
462 <inVariable localId="6" executionOrderId="0" height="24" width="21" negated="false"> |
|
463 <position x="254" y="138"/> |
|
464 <connectionPointOut> |
|
465 <relPosition x="21" y="12"/> |
|
466 </connectionPointOut> |
|
467 <expression>1</expression> |
|
468 </inVariable> |
|
469 <block localId="7" typeName="SEL" executionOrderId="0" height="80" width="57"> |
|
470 <position x="448" y="100"/> |
|
471 <inputVariables> |
|
472 <variable formalParameter="G"> |
|
473 <connectionPointIn> |
|
474 <relPosition x="0" y="30"/> |
|
475 <connection refLocalId="1"> |
|
476 <position x="448" y="130"/> |
|
477 <position x="415" y="130"/> |
|
478 <position x="415" y="70"/> |
|
479 <position x="382" y="70"/> |
|
480 </connection> |
|
481 </connectionPointIn> |
|
482 </variable> |
|
483 <variable formalParameter="IN0"> |
|
484 <connectionPointIn> |
|
485 <relPosition x="0" y="50"/> |
|
486 <connection refLocalId="4" formalParameter="OUT"> |
|
487 <position x="448" y="150"/> |
|
488 <position x="385" y="150"/> |
|
489 </connection> |
|
490 </connectionPointIn> |
|
491 </variable> |
|
492 <variable formalParameter="IN1"> |
|
493 <connectionPointIn> |
|
494 <relPosition x="0" y="70"/> |
|
495 <connection refLocalId="5"> |
|
496 <position x="448" y="170"/> |
|
497 <position x="414" y="170"/> |
|
498 <position x="414" y="268"/> |
|
499 <position x="380" y="268"/> |
|
500 </connection> |
|
501 </connectionPointIn> |
|
502 </variable> |
|
503 </inputVariables> |
|
504 <inOutVariables/> |
|
505 <outputVariables> |
|
506 <variable formalParameter="OUT"> |
|
507 <connectionPointOut> |
|
508 <relPosition x="57" y="30"/> |
|
509 </connectionPointOut> |
|
510 </variable> |
|
511 </outputVariables> |
|
512 </block> |
|
513 </FBD> |
|
514 </body> |
|
515 </pou> |
|
516 <pou name="CounterSFC" pouType="functionBlock"> |
|
517 <interface> |
|
518 <inputVars> |
|
519 <variable name="Reset"> |
|
520 <type> |
|
521 <BOOL/> |
|
522 </type> |
|
523 </variable> |
|
524 </inputVars> |
|
525 <outputVars> |
|
526 <variable name="OUT"> |
|
527 <type> |
|
528 <INT/> |
|
529 </type> |
|
530 </variable> |
|
531 </outputVars> |
|
532 <localVars> |
|
533 <variable name="Cnt"> |
|
534 <type> |
|
535 <INT/> |
|
536 </type> |
|
537 </variable> |
|
538 </localVars> |
|
539 <externalVars constant="true"> |
|
540 <variable name="ResetCounterValue"> |
|
541 <type> |
|
542 <INT/> |
|
543 </type> |
|
544 </variable> |
|
545 </externalVars> |
|
546 </interface> |
|
547 <actions/> |
|
548 <body> |
|
549 <SFC> |
|
550 <step localId="1" name="Start" initialStep="true" height="28" width="90"> |
|
551 <position x="241" y="14"/> |
|
552 <connectionPointOut formalParameter=""> |
|
553 <relPosition x="45" y="28"/> |
|
554 </connectionPointOut> |
|
555 </step> |
|
556 <selectionDivergence localId="2" height="1" width="431"> |
|
557 <position x="70" y="86"/> |
|
558 <connectionPointIn> |
|
559 <relPosition x="216" y="0"/> |
|
560 <connection refLocalId="1"> |
|
561 <position x="286" y="86"/> |
|
562 <position x="286" y="42"/> |
|
563 </connection> |
|
564 </connectionPointIn> |
|
565 <connectionPointOut formalParameter=""> |
|
566 <relPosition x="0" y="1"/> |
|
567 </connectionPointOut> |
|
568 <connectionPointOut formalParameter=""> |
|
569 <relPosition x="431" y="1"/> |
|
570 </connectionPointOut> |
|
571 </selectionDivergence> |
|
572 <transition localId="3" height="2" width="20"> |
|
573 <position x="491" y="132"/> |
|
574 <connectionPointIn> |
|
575 <relPosition x="10" y="0"/> |
|
576 <connection refLocalId="2"> |
|
577 <position x="501" y="132"/> |
|
578 <position x="501" y="87"/> |
|
579 </connection> |
|
580 </connectionPointIn> |
|
581 <connectionPointOut> |
|
582 <relPosition x="10" y="2"/> |
|
583 </connectionPointOut> |
|
584 <condition> |
|
585 <inline name=""> |
|
586 <ST> |
|
587 <xhtml:p><![CDATA[Reset]]></xhtml:p> |
|
588 </ST> |
|
589 </inline> |
|
590 </condition> |
|
591 </transition> |
|
592 <transition localId="4" height="2" width="20" executionOrderId="0"> |
|
593 <position x="60" y="135"/> |
|
594 <connectionPointIn> |
|
595 <relPosition x="10" y="0"/> |
|
596 <connection refLocalId="2"> |
|
597 <position x="70" y="135"/> |
|
598 <position x="70" y="87"/> |
|
599 </connection> |
|
600 </connectionPointIn> |
|
601 <connectionPointOut> |
|
602 <relPosition x="10" y="2"/> |
|
603 </connectionPointOut> |
|
604 <condition> |
|
605 <inline name=""> |
|
606 <ST> |
|
607 <xhtml:p><![CDATA[NOT Reset]]></xhtml:p> |
|
608 </ST> |
|
609 </inline> |
|
610 </condition> |
|
611 </transition> |
|
612 <step localId="5" name="ResetCounter" initialStep="false" height="24" width="104"> |
|
613 <position x="449" y="190"/> |
|
614 <connectionPointIn> |
|
615 <relPosition x="52" y="0"/> |
|
616 <connection refLocalId="3"> |
|
617 <position x="501" y="190"/> |
|
618 <position x="501" y="134"/> |
|
619 </connection> |
|
620 </connectionPointIn> |
|
621 <connectionPointOut formalParameter=""> |
|
622 <relPosition x="52" y="24"/> |
|
623 </connectionPointOut> |
|
624 <connectionPointOutAction formalParameter=""> |
|
625 <relPosition x="104" y="12"/> |
|
626 </connectionPointOutAction> |
|
627 </step> |
|
628 <actionBlock localId="6" height="63" width="222"> |
|
629 <position x="600" y="187"/> |
|
630 <connectionPointIn> |
|
631 <relPosition x="0" y="15"/> |
|
632 <connection refLocalId="5"> |
|
633 <position x="600" y="202"/> |
|
634 <position x="553" y="202"/> |
|
635 </connection> |
|
636 </connectionPointIn> |
|
637 <action localId="0"> |
|
638 <relPosition x="0" y="0"/> |
|
639 <inline> |
|
640 <ST> |
|
641 <xhtml:p><![CDATA[Cnt := ResetCounterValue;]]></xhtml:p> |
|
642 </ST> |
|
643 </inline> |
|
644 </action> |
|
645 <action localId="0"> |
|
646 <relPosition x="0" y="0"/> |
|
647 <inline> |
|
648 <ST> |
|
649 <xhtml:p><![CDATA[OUT := Cnt;]]></xhtml:p> |
|
650 </ST> |
|
651 </inline> |
|
652 </action> |
|
653 </actionBlock> |
|
654 <step localId="7" name="Count" initialStep="false" height="24" width="85" executionOrderId="0"> |
|
655 <position x="28" y="191"/> |
|
656 <connectionPointIn> |
|
657 <relPosition x="42" y="0"/> |
|
658 <connection refLocalId="4"> |
|
659 <position x="70" y="191"/> |
|
660 <position x="70" y="137"/> |
|
661 </connection> |
|
662 </connectionPointIn> |
|
663 <connectionPointOut formalParameter=""> |
|
664 <relPosition x="42" y="24"/> |
|
665 </connectionPointOut> |
|
666 <connectionPointOutAction formalParameter=""> |
|
667 <relPosition x="85" y="12"/> |
|
668 </connectionPointOutAction> |
|
669 </step> |
|
670 <actionBlock localId="8" height="52" width="148" executionOrderId="0"> |
|
671 <position x="135" y="188"/> |
|
672 <connectionPointIn> |
|
673 <relPosition x="0" y="15"/> |
|
674 <connection refLocalId="7"> |
|
675 <position x="135" y="203"/> |
|
676 <position x="113" y="203"/> |
|
677 </connection> |
|
678 </connectionPointIn> |
|
679 <action localId="0"> |
|
680 <relPosition x="0" y="0"/> |
|
681 <inline> |
|
682 <ST> |
|
683 <xhtml:p><![CDATA[Cnt := Cnt + 1;]]></xhtml:p> |
|
684 </ST> |
|
685 </inline> |
|
686 </action> |
|
687 <action localId="0"> |
|
688 <relPosition x="0" y="0"/> |
|
689 <inline> |
|
690 <ST> |
|
691 <xhtml:p><![CDATA[OUT := Cnt;]]></xhtml:p> |
|
692 </ST> |
|
693 </inline> |
|
694 </action> |
|
695 </actionBlock> |
|
696 <selectionConvergence localId="10" height="1" width="431"> |
|
697 <position x="70" y="273"/> |
|
698 <connectionPointIn> |
|
699 <relPosition x="0" y="0"/> |
|
700 <connection refLocalId="13"> |
|
701 <position x="70" y="273"/> |
|
702 <position x="70" y="244"/> |
|
703 </connection> |
|
704 </connectionPointIn> |
|
705 <connectionPointIn> |
|
706 <relPosition x="431" y="0"/> |
|
707 <connection refLocalId="14"> |
|
708 <position x="501" y="273"/> |
|
709 <position x="501" y="250"/> |
|
710 </connection> |
|
711 </connectionPointIn> |
|
712 <connectionPointOut> |
|
713 <relPosition x="216" y="1"/> |
|
714 </connectionPointOut> |
|
715 </selectionConvergence> |
|
716 <jumpStep localId="12" targetName="Start" height="13" width="12"> |
|
717 <position x="280" y="317"/> |
|
718 <connectionPointIn> |
|
719 <relPosition x="6" y="0"/> |
|
720 <connection refLocalId="10"> |
|
721 <position x="286" y="317"/> |
|
722 <position x="286" y="274"/> |
|
723 </connection> |
|
724 </connectionPointIn> |
|
725 </jumpStep> |
|
726 <transition localId="13" height="2" width="20" executionOrderId="0"> |
|
727 <position x="60" y="242"/> |
|
728 <connectionPointIn> |
|
729 <relPosition x="10" y="0"/> |
|
730 <connection refLocalId="7"> |
|
731 <position x="70" y="242"/> |
|
732 <position x="70" y="215"/> |
|
733 </connection> |
|
734 </connectionPointIn> |
|
735 <connectionPointOut> |
|
736 <relPosition x="10" y="2"/> |
|
737 </connectionPointOut> |
|
738 <condition> |
|
739 <inline name=""> |
|
740 <ST> |
|
741 <xhtml:p><![CDATA[Reset]]></xhtml:p> |
|
742 </ST> |
|
743 </inline> |
|
744 </condition> |
|
745 </transition> |
|
746 <transition localId="14" height="2" width="20" executionOrderId="0"> |
|
747 <position x="491" y="248"/> |
|
748 <connectionPointIn> |
|
749 <relPosition x="10" y="0"/> |
|
750 <connection refLocalId="5"> |
|
751 <position x="501" y="248"/> |
|
752 <position x="501" y="214"/> |
|
753 </connection> |
|
754 </connectionPointIn> |
|
755 <connectionPointOut> |
|
756 <relPosition x="10" y="2"/> |
|
757 </connectionPointOut> |
|
758 <condition> |
|
759 <inline name=""> |
|
760 <ST> |
|
761 <xhtml:p><![CDATA[NOT Reset]]></xhtml:p> |
|
762 </ST> |
|
763 </inline> |
|
764 </condition> |
|
765 </transition> |
|
766 </SFC> |
|
767 </body> |
|
768 </pou> |
|
769 <pou name="CounterIL" pouType="functionBlock"> |
|
770 <interface> |
|
771 <localVars> |
|
772 <variable name="Cnt"> |
|
773 <type> |
|
774 <INT/> |
|
775 </type> |
|
776 </variable> |
|
777 </localVars> |
|
778 <inputVars> |
|
779 <variable name="Reset"> |
|
780 <type> |
|
781 <BOOL/> |
|
782 </type> |
|
783 </variable> |
|
784 </inputVars> |
|
785 <outputVars> |
|
786 <variable name="OUT"> |
|
787 <type> |
|
788 <INT/> |
|
789 </type> |
|
790 </variable> |
|
791 </outputVars> |
|
792 <externalVars constant="true"> |
|
793 <variable name="ResetCounterValue"> |
|
794 <type> |
|
795 <INT/> |
|
796 </type> |
|
797 </variable> |
|
798 </externalVars> |
|
799 </interface> |
|
800 <body> |
|
801 <IL> |
|
802 <xhtml:p><![CDATA[LD Reset |
|
803 JMPC ResetCnt |
|
804 |
|
805 (* increment counter *) |
|
806 LD Cnt |
|
807 ADD 1 |
|
808 JMP QuitFb |
|
809 |
|
810 ResetCnt: |
|
811 (* reset counter *) |
|
812 LD ResetCounterValue |
|
813 |
|
814 QuitFb: |
|
815 (* save results *) |
|
816 ST Cnt |
|
817 ST Out |
|
818 ]]></xhtml:p> |
|
819 </IL> |
|
820 </body> |
|
821 </pou> |
|
822 <pou name="CounterLD" pouType="functionBlock"> |
|
823 <interface> |
|
824 <inputVars> |
|
825 <variable name="Reset"> |
|
826 <type> |
|
827 <BOOL/> |
|
828 </type> |
|
829 </variable> |
|
830 </inputVars> |
|
831 <outputVars> |
|
832 <variable name="Out"> |
|
833 <type> |
|
834 <INT/> |
|
835 </type> |
|
836 </variable> |
|
837 </outputVars> |
|
838 <localVars> |
|
839 <variable name="Cnt"> |
|
840 <type> |
|
841 <INT/> |
|
842 </type> |
|
843 </variable> |
|
844 </localVars> |
|
845 <externalVars constant="true"> |
|
846 <variable name="ResetCounterValue"> |
|
847 <type> |
|
848 <INT/> |
|
849 </type> |
|
850 </variable> |
|
851 </externalVars> |
|
852 </interface> |
|
853 <body> |
|
854 <LD> |
|
855 <outVariable localId="2" executionOrderId="0" height="24" width="34" negated="false"> |
|
856 <position x="527" y="90"/> |
|
857 <connectionPointIn> |
|
858 <relPosition x="0" y="12"/> |
|
859 <connection refLocalId="3"> |
|
860 <position x="527" y="102"/> |
|
861 <position x="438" y="102"/> |
|
862 </connection> |
|
863 </connectionPointIn> |
|
864 <expression>Out</expression> |
|
865 </outVariable> |
|
866 <inOutVariable localId="3" executionOrderId="0" height="24" width="29" negatedOut="false" negatedIn="false"> |
|
867 <position x="409" y="90"/> |
|
868 <connectionPointIn> |
|
869 <relPosition x="0" y="12"/> |
|
870 <connection refLocalId="7" formalParameter="OUT"> |
|
871 <position x="409" y="102"/> |
|
872 <position x="357" y="102"/> |
|
873 </connection> |
|
874 </connectionPointIn> |
|
875 <connectionPointOut> |
|
876 <relPosition x="29" y="12"/> |
|
877 </connectionPointOut> |
|
878 <expression>Cnt</expression> |
|
879 </inOutVariable> |
|
880 <block localId="4" typeName="ADD" executionOrderId="0" height="80" width="57"> |
|
881 <position x="180" y="87"/> |
|
882 <inputVariables> |
|
883 <variable formalParameter="IN1"> |
|
884 <connectionPointIn> |
|
885 <relPosition x="0" y="35"/> |
|
886 <connection refLocalId="6"> |
|
887 <position x="180" y="122"/> |
|
888 <position x="127" y="122"/> |
|
889 </connection> |
|
890 </connectionPointIn> |
|
891 </variable> |
|
892 <variable formalParameter="IN2"> |
|
893 <connectionPointIn> |
|
894 <relPosition x="0" y="65"/> |
|
895 <connection refLocalId="3"> |
|
896 <position x="180" y="152"/> |
|
897 <position x="169" y="152"/> |
|
898 <position x="169" y="185"/> |
|
899 <position x="448" y="185"/> |
|
900 <position x="448" y="102"/> |
|
901 <position x="438" y="102"/> |
|
902 </connection> |
|
903 </connectionPointIn> |
|
904 </variable> |
|
905 </inputVariables> |
|
906 <inOutVariables/> |
|
907 <outputVariables> |
|
908 <variable formalParameter="OUT"> |
|
909 <connectionPointOut> |
|
910 <relPosition x="57" y="35"/> |
|
911 </connectionPointOut> |
|
912 </variable> |
|
913 </outputVariables> |
|
914 </block> |
|
915 <inVariable localId="5" executionOrderId="0" height="24" width="158" negated="false"> |
|
916 <position x="74" y="228"/> |
|
917 <connectionPointOut> |
|
918 <relPosition x="158" y="12"/> |
|
919 </connectionPointOut> |
|
920 <expression>ResetCounterValue</expression> |
|
921 </inVariable> |
|
922 <inVariable localId="6" executionOrderId="0" height="24" width="21" negated="false"> |
|
923 <position x="106" y="110"/> |
|
924 <connectionPointOut> |
|
925 <relPosition x="21" y="12"/> |
|
926 </connectionPointOut> |
|
927 <expression>1</expression> |
|
928 </inVariable> |
|
929 <block localId="7" typeName="SEL" executionOrderId="0" height="80" width="57"> |
|
930 <position x="300" y="72"/> |
|
931 <inputVariables> |
|
932 <variable formalParameter="G"> |
|
933 <connectionPointIn> |
|
934 <relPosition x="0" y="30"/> |
|
935 <connection refLocalId="9"> |
|
936 <position x="300" y="102"/> |
|
937 <position x="266" y="102"/> |
|
938 <position x="266" y="62"/> |
|
939 <position x="134" y="62"/> |
|
940 </connection> |
|
941 </connectionPointIn> |
|
942 </variable> |
|
943 <variable formalParameter="IN0"> |
|
944 <connectionPointIn> |
|
945 <relPosition x="0" y="50"/> |
|
946 <connection refLocalId="4" formalParameter="OUT"> |
|
947 <position x="300" y="122"/> |
|
948 <position x="237" y="122"/> |
|
949 </connection> |
|
950 </connectionPointIn> |
|
951 </variable> |
|
952 <variable formalParameter="IN1"> |
|
953 <connectionPointIn> |
|
954 <relPosition x="0" y="70"/> |
|
955 <connection refLocalId="5"> |
|
956 <position x="300" y="142"/> |
|
957 <position x="266" y="142"/> |
|
958 <position x="266" y="240"/> |
|
959 <position x="232" y="240"/> |
|
960 </connection> |
|
961 </connectionPointIn> |
|
962 </variable> |
|
963 </inputVariables> |
|
964 <inOutVariables/> |
|
965 <outputVariables> |
|
966 <variable formalParameter="OUT"> |
|
967 <connectionPointOut> |
|
968 <relPosition x="57" y="30"/> |
|
969 </connectionPointOut> |
|
970 </variable> |
|
971 </outputVariables> |
|
972 </block> |
|
973 <leftPowerRail localId="8" height="40" width="3"> |
|
974 <position x="46" y="42"/> |
|
975 <connectionPointOut formalParameter=""> |
|
976 <relPosition x="3" y="20"/> |
|
977 </connectionPointOut> |
|
978 </leftPowerRail> |
|
979 <contact localId="9" height="15" width="21" negated="false"> |
|
980 <position x="113" y="54"/> |
|
981 <connectionPointIn> |
|
982 <relPosition x="0" y="8"/> |
|
983 <connection refLocalId="8"> |
|
984 <position x="113" y="62"/> |
|
985 <position x="49" y="62"/> |
|
986 </connection> |
|
987 </connectionPointIn> |
|
988 <connectionPointOut> |
|
989 <relPosition x="21" y="8"/> |
|
990 </connectionPointOut> |
|
991 <variable>Reset</variable> |
|
992 </contact> |
|
993 </LD> |
|
994 </body> |
|
995 </pou> |
|
996 </pous> |
|
997 </types> |
|
998 <instances> |
|
999 <configurations> |
|
1000 <configuration name="config"> |
|
1001 <resource name="resource1"> |
|
1002 <task name="plc_task" priority="1" interval="T#100ms"> |
|
1003 <pouInstance name="plc_task_instance" typeName="plc_prg"/> |
|
1004 </task> |
|
1005 </resource> |
|
1006 <globalVars constant="true"> |
|
1007 <variable name="ResetCounterValue"> |
|
1008 <type> |
|
1009 <INT/> |
|
1010 </type> |
|
1011 <initialValue> |
|
1012 <simpleValue value="17"/> |
|
1013 </initialValue> |
|
1014 </variable> |
|
1015 </globalVars> |
|
1016 </configuration> |
|
1017 </configurations> |
|
1018 </instances> |
|
1019 </project> |