|
1 <?xml version='1.0' encoding='utf-8'?> |
|
2 <project xmlns="http://www.plcopen.org/xml/tc6_0201" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xsi:schemaLocation="http://www.plcopen.org/xml/tc6_0201"> |
|
3 <fileHeader companyName="" productName="Beremiz" productVersion="0.0" creationDateTime="2008-12-14T16:21:19" contentDescription="This example shows many features in Beremiz: 1. How to implement python extensions. 2. How to implement basic C extension. 3. How to use C code in IEC POUs. 4. How to call C functions from python code. 5. How to avoid race conditions between IEC, C and python code. 6. How to convert betweet different IEC types. "/> |
|
4 <contentHeader name="Beremiz Python Support Tests" modificationDateTime="2020-10-19T23:53:08"> |
|
5 <coordinateInfo> |
|
6 <pageSize x="1024" y="1024"/> |
|
7 <fbd> |
|
8 <scaling x="5" y="5"/> |
|
9 </fbd> |
|
10 <ld> |
|
11 <scaling x="5" y="5"/> |
|
12 </ld> |
|
13 <sfc> |
|
14 <scaling x="5" y="5"/> |
|
15 </sfc> |
|
16 </coordinateInfo> |
|
17 </contentHeader> |
|
18 <types> |
|
19 <dataTypes> |
|
20 <dataType name="CPLX_TYPE"> |
|
21 <baseType> |
|
22 <struct> |
|
23 <variable name="FIRSTBYTE"> |
|
24 <type> |
|
25 <SINT/> |
|
26 </type> |
|
27 </variable> |
|
28 <variable name="SECONDBYTE"> |
|
29 <type> |
|
30 <SINT/> |
|
31 </type> |
|
32 </variable> |
|
33 </struct> |
|
34 </baseType> |
|
35 </dataType> |
|
36 <dataType name="StateMachine"> |
|
37 <baseType> |
|
38 <enum> |
|
39 <values> |
|
40 <value name="STANDBY"/> |
|
41 <value name="START"/> |
|
42 <value name="STOP"/> |
|
43 </values> |
|
44 </enum> |
|
45 </baseType> |
|
46 </dataType> |
|
47 <dataType name="datatype0"> |
|
48 <baseType> |
|
49 <BOOL/> |
|
50 </baseType> |
|
51 </dataType> |
|
52 <dataType name="blups"> |
|
53 <baseType> |
|
54 <array> |
|
55 <dimension lower="0" upper="31"/> |
|
56 <baseType> |
|
57 <derived name="CPLX_TYPE"/> |
|
58 </baseType> |
|
59 </array> |
|
60 </baseType> |
|
61 </dataType> |
|
62 </dataTypes> |
|
63 <pous> |
|
64 <pou name="main_pytest" pouType="program"> |
|
65 <interface> |
|
66 <localVars> |
|
67 <variable name="mux1_sel"> |
|
68 <type> |
|
69 <INT/> |
|
70 </type> |
|
71 <initialValue> |
|
72 <simpleValue value="3"/> |
|
73 </initialValue> |
|
74 <documentation> |
|
75 <xhtml:p><![CDATA[blah]]></xhtml:p> |
|
76 </documentation> |
|
77 </variable> |
|
78 <variable name="mux2_sel"> |
|
79 <type> |
|
80 <INT/> |
|
81 </type> |
|
82 <initialValue> |
|
83 <simpleValue value="3"/> |
|
84 </initialValue> |
|
85 </variable> |
|
86 <variable name="pytest_var1"> |
|
87 <type> |
|
88 <string/> |
|
89 </type> |
|
90 </variable> |
|
91 <variable name="fefvsd"> |
|
92 <type> |
|
93 <derived name="datatype0"/> |
|
94 </type> |
|
95 </variable> |
|
96 <variable name="pytest_var2"> |
|
97 <type> |
|
98 <BOOL/> |
|
99 </type> |
|
100 </variable> |
|
101 <variable name="py1"> |
|
102 <type> |
|
103 <derived name="python_eval"/> |
|
104 </type> |
|
105 </variable> |
|
106 <variable name="Block1"> |
|
107 <type> |
|
108 <derived name="python_eval"/> |
|
109 </type> |
|
110 </variable> |
|
111 <variable name="Block2"> |
|
112 <type> |
|
113 <derived name="python_eval"/> |
|
114 </type> |
|
115 </variable> |
|
116 <variable name="Block3"> |
|
117 <type> |
|
118 <derived name="python_eval"/> |
|
119 </type> |
|
120 </variable> |
|
121 <variable name="pytest_var3"> |
|
122 <type> |
|
123 <BOOL/> |
|
124 </type> |
|
125 </variable> |
|
126 <variable name="FromC"> |
|
127 <type> |
|
128 <SINT/> |
|
129 </type> |
|
130 </variable> |
|
131 <variable name="C_Pragma0"> |
|
132 <type> |
|
133 <derived name="C_Pragma"/> |
|
134 </type> |
|
135 </variable> |
|
136 </localVars> |
|
137 <externalVars> |
|
138 <variable name="TestInput"> |
|
139 <type> |
|
140 <SINT/> |
|
141 </type> |
|
142 </variable> |
|
143 <variable name="TestOutput"> |
|
144 <type> |
|
145 <SINT/> |
|
146 </type> |
|
147 </variable> |
|
148 </externalVars> |
|
149 <localVars> |
|
150 <variable name="FromInput"> |
|
151 <type> |
|
152 <SINT/> |
|
153 </type> |
|
154 </variable> |
|
155 <variable name="Test_BCD"> |
|
156 <type> |
|
157 <WORD/> |
|
158 </type> |
|
159 <initialValue> |
|
160 <simpleValue value="151"/> |
|
161 </initialValue> |
|
162 </variable> |
|
163 <variable name="Test_BCD_WRONG"> |
|
164 <type> |
|
165 <WORD/> |
|
166 </type> |
|
167 <initialValue> |
|
168 <simpleValue value="154"/> |
|
169 </initialValue> |
|
170 </variable> |
|
171 <variable name="Test_BCD_CONVERTED"> |
|
172 <type> |
|
173 <BOOL/> |
|
174 </type> |
|
175 </variable> |
|
176 <variable name="Test_BCD_RESULT"> |
|
177 <type> |
|
178 <UINT/> |
|
179 </type> |
|
180 </variable> |
|
181 <variable name="Test_BCD_WRONG_RESULT"> |
|
182 <type> |
|
183 <UINT/> |
|
184 </type> |
|
185 </variable> |
|
186 <variable name="Test_DT"> |
|
187 <type> |
|
188 <DT/> |
|
189 </type> |
|
190 <initialValue> |
|
191 <simpleValue value="DT#2013-02-23-22:35:46"/> |
|
192 </initialValue> |
|
193 </variable> |
|
194 <variable name="Test_TOD"> |
|
195 <type> |
|
196 <TOD/> |
|
197 </type> |
|
198 </variable> |
|
199 <variable name="Test_TOD_STRING"> |
|
200 <type> |
|
201 <string/> |
|
202 </type> |
|
203 </variable> |
|
204 <variable name="Test_Date"> |
|
205 <type> |
|
206 <DATE/> |
|
207 </type> |
|
208 </variable> |
|
209 <variable name="Test_String"> |
|
210 <type> |
|
211 <string/> |
|
212 </type> |
|
213 <initialValue> |
|
214 <simpleValue value="test"/> |
|
215 </initialValue> |
|
216 </variable> |
|
217 <variable name="Test_Bool"> |
|
218 <type> |
|
219 <BOOL/> |
|
220 </type> |
|
221 </variable> |
|
222 </localVars> |
|
223 <externalVars> |
|
224 <variable name="Global_RS"> |
|
225 <type> |
|
226 <derived name="RS"/> |
|
227 </type> |
|
228 </variable> |
|
229 <variable name="TUTU"> |
|
230 <type> |
|
231 <INT/> |
|
232 </type> |
|
233 </variable> |
|
234 <variable name="TOTO"> |
|
235 <type> |
|
236 <INT/> |
|
237 </type> |
|
238 </variable> |
|
239 <variable name="Test_Python_Var"> |
|
240 <type> |
|
241 <INT/> |
|
242 </type> |
|
243 </variable> |
|
244 <variable name="Second_Python_Var"> |
|
245 <type> |
|
246 <INT/> |
|
247 </type> |
|
248 </variable> |
|
249 <variable name="Grumpf"> |
|
250 <type> |
|
251 <string/> |
|
252 </type> |
|
253 </variable> |
|
254 </externalVars> |
|
255 <localVars> |
|
256 <variable name="RTC0"> |
|
257 <type> |
|
258 <derived name="RTC"/> |
|
259 </type> |
|
260 </variable> |
|
261 </localVars> |
|
262 <externalVars> |
|
263 <variable name="SomeVarName"> |
|
264 <type> |
|
265 <DINT/> |
|
266 </type> |
|
267 </variable> |
|
268 </externalVars> |
|
269 </interface> |
|
270 <body> |
|
271 <FBD> |
|
272 <inVariable localId="4" height="30" width="160" executionOrderId="0" negated="false"> |
|
273 <position x="295" y="450"/> |
|
274 <connectionPointOut> |
|
275 <relPosition x="160" y="15"/> |
|
276 </connectionPointOut> |
|
277 <expression>'666'</expression> |
|
278 </inVariable> |
|
279 <block localId="5" width="125" height="80" typeName="python_eval" instanceName="py1" executionOrderId="0"> |
|
280 <position x="686" y="400"/> |
|
281 <inputVariables> |
|
282 <variable formalParameter="TRIG"> |
|
283 <connectionPointIn> |
|
284 <relPosition x="0" y="35"/> |
|
285 <connection refLocalId="7" formalParameter="OUT"> |
|
286 <position x="686" y="435"/> |
|
287 <position x="285" y="435"/> |
|
288 <position x="285" y="480"/> |
|
289 <position x="250" y="480"/> |
|
290 </connection> |
|
291 </connectionPointIn> |
|
292 </variable> |
|
293 <variable formalParameter="CODE"> |
|
294 <connectionPointIn> |
|
295 <relPosition x="0" y="65"/> |
|
296 <connection refLocalId="4"> |
|
297 <position x="686" y="465"/> |
|
298 <position x="455" y="465"/> |
|
299 </connection> |
|
300 </connectionPointIn> |
|
301 </variable> |
|
302 </inputVariables> |
|
303 <inOutVariables/> |
|
304 <outputVariables> |
|
305 <variable formalParameter="ACK"> |
|
306 <connectionPointOut> |
|
307 <relPosition x="125" y="35"/> |
|
308 </connectionPointOut> |
|
309 </variable> |
|
310 <variable formalParameter="RESULT"> |
|
311 <connectionPointOut> |
|
312 <relPosition x="125" y="65"/> |
|
313 </connectionPointOut> |
|
314 </variable> |
|
315 </outputVariables> |
|
316 </block> |
|
317 <block localId="7" width="70" height="45" typeName="NOT" executionOrderId="0"> |
|
318 <position x="180" y="450"/> |
|
319 <inputVariables> |
|
320 <variable formalParameter="IN"> |
|
321 <connectionPointIn> |
|
322 <relPosition x="0" y="30"/> |
|
323 <connection refLocalId="3"> |
|
324 <position x="180" y="480"/> |
|
325 <position x="155" y="480"/> |
|
326 </connection> |
|
327 </connectionPointIn> |
|
328 </variable> |
|
329 </inputVariables> |
|
330 <inOutVariables/> |
|
331 <outputVariables> |
|
332 <variable formalParameter="OUT"> |
|
333 <connectionPointOut> |
|
334 <relPosition x="70" y="30"/> |
|
335 </connectionPointOut> |
|
336 </variable> |
|
337 </outputVariables> |
|
338 </block> |
|
339 <inOutVariable localId="3" height="30" width="120" executionOrderId="0" negatedOut="false" negatedIn="false"> |
|
340 <position x="35" y="465"/> |
|
341 <connectionPointIn> |
|
342 <relPosition x="0" y="15"/> |
|
343 <connection refLocalId="7" formalParameter="OUT"> |
|
344 <position x="35" y="480"/> |
|
345 <position x="25" y="480"/> |
|
346 <position x="25" y="440"/> |
|
347 <position x="270" y="440"/> |
|
348 <position x="270" y="480"/> |
|
349 <position x="250" y="480"/> |
|
350 </connection> |
|
351 </connectionPointIn> |
|
352 <connectionPointOut> |
|
353 <relPosition x="120" y="15"/> |
|
354 </connectionPointOut> |
|
355 <expression>pytest_var2</expression> |
|
356 </inOutVariable> |
|
357 <block localId="8" width="125" height="80" typeName="python_eval" instanceName="Block1" executionOrderId="0"> |
|
358 <position x="686" y="545"/> |
|
359 <inputVariables> |
|
360 <variable formalParameter="TRIG"> |
|
361 <connectionPointIn> |
|
362 <relPosition x="0" y="35"/> |
|
363 <connection refLocalId="7" formalParameter="OUT"> |
|
364 <position x="686" y="580"/> |
|
365 <position x="285" y="580"/> |
|
366 <position x="285" y="480"/> |
|
367 <position x="250" y="480"/> |
|
368 </connection> |
|
369 </connectionPointIn> |
|
370 </variable> |
|
371 <variable formalParameter="CODE"> |
|
372 <connectionPointIn> |
|
373 <relPosition x="0" y="65"/> |
|
374 <connection refLocalId="9"> |
|
375 <position x="686" y="610"/> |
|
376 <position x="665" y="610"/> |
|
377 </connection> |
|
378 </connectionPointIn> |
|
379 </variable> |
|
380 </inputVariables> |
|
381 <inOutVariables/> |
|
382 <outputVariables> |
|
383 <variable formalParameter="ACK"> |
|
384 <connectionPointOut> |
|
385 <relPosition x="125" y="35"/> |
|
386 </connectionPointOut> |
|
387 </variable> |
|
388 <variable formalParameter="RESULT"> |
|
389 <connectionPointOut> |
|
390 <relPosition x="125" y="65"/> |
|
391 </connectionPointOut> |
|
392 </variable> |
|
393 </outputVariables> |
|
394 </block> |
|
395 <inVariable localId="9" height="30" width="370" executionOrderId="0" negated="false"> |
|
396 <position x="295" y="595"/> |
|
397 <connectionPointOut> |
|
398 <relPosition x="370" y="15"/> |
|
399 </connectionPointOut> |
|
400 <expression>'sys.stdout.write("FBID :"+str(FBID)+"\n")'</expression> |
|
401 </inVariable> |
|
402 <inVariable localId="11" height="30" width="290" executionOrderId="0" negated="false"> |
|
403 <position x="295" y="735"/> |
|
404 <connectionPointOut> |
|
405 <relPosition x="290" y="15"/> |
|
406 </connectionPointOut> |
|
407 <expression>'PLCBinary.Simple_C_Call(5678)'</expression> |
|
408 </inVariable> |
|
409 <block localId="12" width="125" height="80" typeName="python_eval" instanceName="Block2" executionOrderId="0"> |
|
410 <position x="686" y="687"/> |
|
411 <inputVariables> |
|
412 <variable formalParameter="TRIG"> |
|
413 <connectionPointIn> |
|
414 <relPosition x="0" y="33"/> |
|
415 <connection refLocalId="7" formalParameter="OUT"> |
|
416 <position x="686" y="720"/> |
|
417 <position x="285" y="720"/> |
|
418 <position x="285" y="480"/> |
|
419 <position x="250" y="480"/> |
|
420 </connection> |
|
421 </connectionPointIn> |
|
422 </variable> |
|
423 <variable formalParameter="CODE"> |
|
424 <connectionPointIn> |
|
425 <relPosition x="0" y="63"/> |
|
426 <connection refLocalId="11"> |
|
427 <position x="686" y="750"/> |
|
428 <position x="585" y="750"/> |
|
429 </connection> |
|
430 </connectionPointIn> |
|
431 </variable> |
|
432 </inputVariables> |
|
433 <inOutVariables/> |
|
434 <outputVariables> |
|
435 <variable formalParameter="ACK"> |
|
436 <connectionPointOut> |
|
437 <relPosition x="125" y="33"/> |
|
438 </connectionPointOut> |
|
439 </variable> |
|
440 <variable formalParameter="RESULT"> |
|
441 <connectionPointOut> |
|
442 <relPosition x="125" y="63"/> |
|
443 </connectionPointOut> |
|
444 </variable> |
|
445 </outputVariables> |
|
446 </block> |
|
447 <inVariable localId="14" height="30" width="290" executionOrderId="0" negated="false"> |
|
448 <position x="290" y="885"/> |
|
449 <connectionPointOut> |
|
450 <relPosition x="290" y="15"/> |
|
451 </connectionPointOut> |
|
452 <expression>'MyPythonFunc(42)'</expression> |
|
453 </inVariable> |
|
454 <block localId="15" width="125" height="80" typeName="python_eval" instanceName="Block3" executionOrderId="0"> |
|
455 <position x="686" y="837"/> |
|
456 <inputVariables> |
|
457 <variable formalParameter="TRIG"> |
|
458 <connectionPointIn> |
|
459 <relPosition x="0" y="33"/> |
|
460 <connection refLocalId="7" formalParameter="OUT"> |
|
461 <position x="686" y="870"/> |
|
462 <position x="285" y="870"/> |
|
463 <position x="285" y="480"/> |
|
464 <position x="250" y="480"/> |
|
465 </connection> |
|
466 </connectionPointIn> |
|
467 </variable> |
|
468 <variable formalParameter="CODE"> |
|
469 <connectionPointIn> |
|
470 <relPosition x="0" y="63"/> |
|
471 <connection refLocalId="14"> |
|
472 <position x="686" y="900"/> |
|
473 <position x="580" y="900"/> |
|
474 </connection> |
|
475 </connectionPointIn> |
|
476 </variable> |
|
477 </inputVariables> |
|
478 <inOutVariables/> |
|
479 <outputVariables> |
|
480 <variable formalParameter="ACK"> |
|
481 <connectionPointOut> |
|
482 <relPosition x="125" y="33"/> |
|
483 </connectionPointOut> |
|
484 </variable> |
|
485 <variable formalParameter="RESULT"> |
|
486 <connectionPointOut> |
|
487 <relPosition x="125" y="63"/> |
|
488 </connectionPointOut> |
|
489 </variable> |
|
490 </outputVariables> |
|
491 </block> |
|
492 <comment localId="16" height="90" width="680"> |
|
493 <position x="35" y="275"/> |
|
494 <content> |
|
495 <xhtml:p><![CDATA[This part of the example test that, despite of 2T period clock stimulating TRIG pin of pyth_eval blocks, blocks keep executing one after the other, in respect of execution order.]]></xhtml:p> |
|
496 </content> |
|
497 </comment> |
|
498 <block localId="17" width="80" height="120" typeName="MUX" executionOrderId="0"> |
|
499 <position x="1101" y="790"/> |
|
500 <inputVariables> |
|
501 <variable formalParameter="K"> |
|
502 <connectionPointIn> |
|
503 <relPosition x="0" y="30"/> |
|
504 <connection refLocalId="18"> |
|
505 <position x="1101" y="820"/> |
|
506 <position x="1076" y="820"/> |
|
507 <position x="1076" y="810"/> |
|
508 <position x="1060" y="810"/> |
|
509 </connection> |
|
510 </connectionPointIn> |
|
511 </variable> |
|
512 <variable formalParameter="IN0"> |
|
513 <connectionPointIn> |
|
514 <relPosition x="0" y="50"/> |
|
515 <connection refLocalId="5" formalParameter="RESULT"> |
|
516 <position x="1101" y="840"/> |
|
517 <position x="941" y="840"/> |
|
518 <position x="941" y="465"/> |
|
519 <position x="811" y="465"/> |
|
520 </connection> |
|
521 </connectionPointIn> |
|
522 </variable> |
|
523 <variable formalParameter="IN1"> |
|
524 <connectionPointIn> |
|
525 <relPosition x="0" y="70"/> |
|
526 <connection refLocalId="8" formalParameter="RESULT"> |
|
527 <position x="1101" y="860"/> |
|
528 <position x="926" y="860"/> |
|
529 <position x="926" y="610"/> |
|
530 <position x="811" y="610"/> |
|
531 </connection> |
|
532 </connectionPointIn> |
|
533 </variable> |
|
534 <variable formalParameter="IN2"> |
|
535 <connectionPointIn> |
|
536 <relPosition x="0" y="90"/> |
|
537 <connection refLocalId="12" formalParameter="RESULT"> |
|
538 <position x="1101" y="880"/> |
|
539 <position x="911" y="880"/> |
|
540 <position x="911" y="750"/> |
|
541 <position x="811" y="750"/> |
|
542 </connection> |
|
543 </connectionPointIn> |
|
544 </variable> |
|
545 <variable formalParameter="IN3"> |
|
546 <connectionPointIn> |
|
547 <relPosition x="0" y="110"/> |
|
548 <connection refLocalId="15" formalParameter="RESULT"> |
|
549 <position x="1101" y="900"/> |
|
550 <position x="811" y="900"/> |
|
551 </connection> |
|
552 </connectionPointIn> |
|
553 </variable> |
|
554 </inputVariables> |
|
555 <inOutVariables/> |
|
556 <outputVariables> |
|
557 <variable formalParameter="OUT"> |
|
558 <connectionPointOut> |
|
559 <relPosition x="80" y="30"/> |
|
560 </connectionPointOut> |
|
561 </variable> |
|
562 </outputVariables> |
|
563 </block> |
|
564 <outVariable localId="19" height="35" width="125" executionOrderId="0" negated="false"> |
|
565 <position x="1271" y="805"/> |
|
566 <connectionPointIn> |
|
567 <relPosition x="0" y="15"/> |
|
568 <connection refLocalId="17" formalParameter="OUT"> |
|
569 <position x="1271" y="820"/> |
|
570 <position x="1181" y="820"/> |
|
571 </connection> |
|
572 </connectionPointIn> |
|
573 <expression>pytest_var1</expression> |
|
574 </outVariable> |
|
575 <block localId="21" width="80" height="120" typeName="MUX" executionOrderId="0"> |
|
576 <position x="1106" y="385"/> |
|
577 <inputVariables> |
|
578 <variable formalParameter="K"> |
|
579 <connectionPointIn> |
|
580 <relPosition x="0" y="30"/> |
|
581 <connection refLocalId="22"> |
|
582 <position x="1106" y="415"/> |
|
583 <position x="1076" y="415"/> |
|
584 <position x="1076" y="405"/> |
|
585 <position x="1055" y="405"/> |
|
586 </connection> |
|
587 </connectionPointIn> |
|
588 </variable> |
|
589 <variable formalParameter="IN0"> |
|
590 <connectionPointIn> |
|
591 <relPosition x="0" y="50"/> |
|
592 <connection refLocalId="5" formalParameter="ACK"> |
|
593 <position x="1106" y="435"/> |
|
594 <position x="811" y="435"/> |
|
595 </connection> |
|
596 </connectionPointIn> |
|
597 </variable> |
|
598 <variable formalParameter="IN1"> |
|
599 <connectionPointIn> |
|
600 <relPosition x="0" y="70"/> |
|
601 <connection refLocalId="8" formalParameter="ACK"> |
|
602 <position x="1106" y="455"/> |
|
603 <position x="841" y="455"/> |
|
604 <position x="841" y="580"/> |
|
605 <position x="811" y="580"/> |
|
606 </connection> |
|
607 </connectionPointIn> |
|
608 </variable> |
|
609 <variable formalParameter="IN2"> |
|
610 <connectionPointIn> |
|
611 <relPosition x="0" y="90"/> |
|
612 <connection refLocalId="12" formalParameter="ACK"> |
|
613 <position x="1106" y="475"/> |
|
614 <position x="856" y="475"/> |
|
615 <position x="856" y="720"/> |
|
616 <position x="811" y="720"/> |
|
617 </connection> |
|
618 </connectionPointIn> |
|
619 </variable> |
|
620 <variable formalParameter="IN3"> |
|
621 <connectionPointIn> |
|
622 <relPosition x="0" y="110"/> |
|
623 <connection refLocalId="15" formalParameter="ACK"> |
|
624 <position x="1106" y="495"/> |
|
625 <position x="871" y="495"/> |
|
626 <position x="871" y="870"/> |
|
627 <position x="811" y="870"/> |
|
628 </connection> |
|
629 </connectionPointIn> |
|
630 </variable> |
|
631 </inputVariables> |
|
632 <inOutVariables/> |
|
633 <outputVariables> |
|
634 <variable formalParameter="OUT"> |
|
635 <connectionPointOut> |
|
636 <relPosition x="80" y="30"/> |
|
637 </connectionPointOut> |
|
638 </variable> |
|
639 </outputVariables> |
|
640 </block> |
|
641 <inVariable localId="22" height="30" width="74" executionOrderId="0" negated="false"> |
|
642 <position x="981" y="390"/> |
|
643 <connectionPointOut> |
|
644 <relPosition x="74" y="15"/> |
|
645 </connectionPointOut> |
|
646 <expression>mux1_sel</expression> |
|
647 </inVariable> |
|
648 <outVariable localId="23" height="35" width="125" executionOrderId="0" negated="false"> |
|
649 <position x="1271" y="400"/> |
|
650 <connectionPointIn> |
|
651 <relPosition x="0" y="15"/> |
|
652 <connection refLocalId="21" formalParameter="OUT"> |
|
653 <position x="1271" y="415"/> |
|
654 <position x="1186" y="415"/> |
|
655 </connection> |
|
656 </connectionPointIn> |
|
657 <expression>pytest_var3</expression> |
|
658 </outVariable> |
|
659 <outVariable localId="25" height="30" width="60" executionOrderId="0" negated="false"> |
|
660 <position x="320" y="1075"/> |
|
661 <connectionPointIn> |
|
662 <relPosition x="0" y="15"/> |
|
663 <connection refLocalId="26" formalParameter="OUT"> |
|
664 <position x="320" y="1090"/> |
|
665 <position x="265" y="1090"/> |
|
666 </connection> |
|
667 </connectionPointIn> |
|
668 <expression>FromC</expression> |
|
669 </outVariable> |
|
670 <inVariable localId="1" height="30" width="30" executionOrderId="0" negated="false"> |
|
671 <position x="105" y="1075"/> |
|
672 <connectionPointOut> |
|
673 <relPosition x="30" y="15"/> |
|
674 </connectionPointOut> |
|
675 <expression>23</expression> |
|
676 </inVariable> |
|
677 <block localId="26" width="80" height="45" typeName="C_Pragma" instanceName="C_Pragma0" executionOrderId="0"> |
|
678 <position x="185" y="1060"/> |
|
679 <inputVariables> |
|
680 <variable formalParameter="IN"> |
|
681 <connectionPointIn> |
|
682 <relPosition x="0" y="30"/> |
|
683 <connection refLocalId="1"> |
|
684 <position x="185" y="1090"/> |
|
685 <position x="135" y="1090"/> |
|
686 </connection> |
|
687 </connectionPointIn> |
|
688 </variable> |
|
689 </inputVariables> |
|
690 <inOutVariables/> |
|
691 <outputVariables> |
|
692 <variable formalParameter="OUT"> |
|
693 <connectionPointOut> |
|
694 <relPosition x="80" y="30"/> |
|
695 </connectionPointOut> |
|
696 </variable> |
|
697 </outputVariables> |
|
698 </block> |
|
699 <inVariable localId="27" height="30" width="90" executionOrderId="0" negated="false"> |
|
700 <position x="100" y="1190"/> |
|
701 <connectionPointOut> |
|
702 <relPosition x="90" y="15"/> |
|
703 </connectionPointOut> |
|
704 <expression>TestInput</expression> |
|
705 </inVariable> |
|
706 <outVariable localId="28" height="30" width="105" executionOrderId="0" negated="false"> |
|
707 <position x="195" y="1125"/> |
|
708 <connectionPointIn> |
|
709 <relPosition x="0" y="15"/> |
|
710 <connection refLocalId="2"> |
|
711 <position x="195" y="1140"/> |
|
712 <position x="140" y="1140"/> |
|
713 </connection> |
|
714 </connectionPointIn> |
|
715 <expression>TestOutput</expression> |
|
716 </outVariable> |
|
717 <outVariable localId="29" height="30" width="85" executionOrderId="0" negated="false"> |
|
718 <position x="215" y="1190"/> |
|
719 <connectionPointIn> |
|
720 <relPosition x="0" y="15"/> |
|
721 <connection refLocalId="27"> |
|
722 <position x="215" y="1205"/> |
|
723 <position x="190" y="1205"/> |
|
724 </connection> |
|
725 </connectionPointIn> |
|
726 <expression>FromInput</expression> |
|
727 </outVariable> |
|
728 <inVariable localId="2" height="30" width="30" executionOrderId="0" negated="false"> |
|
729 <position x="110" y="1125"/> |
|
730 <connectionPointOut> |
|
731 <relPosition x="30" y="15"/> |
|
732 </connectionPointOut> |
|
733 <expression>10</expression> |
|
734 </inVariable> |
|
735 <comment localId="30" height="105" width="465"> |
|
736 <position x="50" y="925"/> |
|
737 <content> |
|
738 <xhtml:p><![CDATA[You will be ready to use beremiz with C and Python when you will understand why "FromInput" is equal to 75. |
|
739 Happy hacking! ]]></xhtml:p> |
|
740 </content> |
|
741 </comment> |
|
742 <comment localId="31" height="90" width="345"> |
|
743 <position x="295" y="485"/> |
|
744 <content> |
|
745 <xhtml:p><![CDATA[Sleep here is bad. It blocks other py_eval instances. Whith a wxGlade GUI, GUI freeze for a second.]]></xhtml:p> |
|
746 </content> |
|
747 </comment> |
|
748 <comment localId="6" height="80" width="345"> |
|
749 <position x="295" y="630"/> |
|
750 <content> |
|
751 <xhtml:p><![CDATA[Prints FBID to stdout of PLC runtime. FBID is a unique reference to py_eval instance.]]></xhtml:p> |
|
752 </content> |
|
753 </comment> |
|
754 <comment localId="10" height="85" width="345"> |
|
755 <position x="295" y="770"/> |
|
756 <content> |
|
757 <xhtml:p><![CDATA[Simple_C_Call is declared in C_File "1.x:c_code". See python ctypes manual for details on typing.]]></xhtml:p> |
|
758 </content> |
|
759 </comment> |
|
760 <comment localId="32" height="145" width="235"> |
|
761 <position x="25" y="505"/> |
|
762 <content> |
|
763 <xhtml:p><![CDATA[Fast clock, at least faster that sleep(1). See what happens when python takes time to answer : PLC continues.]]></xhtml:p> |
|
764 </content> |
|
765 </comment> |
|
766 <outVariable localId="33" height="30" width="133" executionOrderId="0" negated="false"> |
|
767 <position x="580" y="1564"/> |
|
768 <connectionPointIn> |
|
769 <relPosition x="0" y="16"/> |
|
770 <connection refLocalId="35" formalParameter="OUT"> |
|
771 <position x="580" y="1580"/> |
|
772 <position x="371" y="1580"/> |
|
773 </connection> |
|
774 </connectionPointIn> |
|
775 <expression>Test_BCD_RESULT</expression> |
|
776 </outVariable> |
|
777 <inVariable localId="34" height="30" width="75" executionOrderId="0" negated="false"> |
|
778 <position x="60" y="1564"/> |
|
779 <connectionPointOut> |
|
780 <relPosition x="75" y="16"/> |
|
781 </connectionPointOut> |
|
782 <expression>Test_BCD</expression> |
|
783 </inVariable> |
|
784 <block localId="35" width="106" height="60" typeName="BCD_TO_UINT" executionOrderId="0"> |
|
785 <position x="265" y="1539"/> |
|
786 <inputVariables> |
|
787 <variable formalParameter="IN"> |
|
788 <connectionPointIn> |
|
789 <relPosition x="0" y="41"/> |
|
790 <connection refLocalId="34"> |
|
791 <position x="265" y="1580"/> |
|
792 <position x="135" y="1580"/> |
|
793 </connection> |
|
794 </connectionPointIn> |
|
795 </variable> |
|
796 </inputVariables> |
|
797 <inOutVariables/> |
|
798 <outputVariables> |
|
799 <variable formalParameter="OUT"> |
|
800 <connectionPointOut> |
|
801 <relPosition x="106" y="41"/> |
|
802 </connectionPointOut> |
|
803 </variable> |
|
804 </outputVariables> |
|
805 </block> |
|
806 <inVariable localId="36" height="30" width="66" executionOrderId="0" negated="false"> |
|
807 <position x="60" y="1774"/> |
|
808 <connectionPointOut> |
|
809 <relPosition x="66" y="16"/> |
|
810 </connectionPointOut> |
|
811 <expression>Test_DT</expression> |
|
812 </inVariable> |
|
813 <block localId="37" width="255" height="45" typeName="DATE_AND_TIME_TO_TIME_OF_DAY" executionOrderId="0"> |
|
814 <position x="265" y="1759"/> |
|
815 <inputVariables> |
|
816 <variable formalParameter="IN"> |
|
817 <connectionPointIn> |
|
818 <relPosition x="0" y="31"/> |
|
819 <connection refLocalId="36"> |
|
820 <position x="265" y="1790"/> |
|
821 <position x="125" y="1790"/> |
|
822 </connection> |
|
823 </connectionPointIn> |
|
824 </variable> |
|
825 </inputVariables> |
|
826 <inOutVariables/> |
|
827 <outputVariables> |
|
828 <variable formalParameter="OUT"> |
|
829 <connectionPointOut> |
|
830 <relPosition x="255" y="31"/> |
|
831 </connectionPointOut> |
|
832 </variable> |
|
833 </outputVariables> |
|
834 </block> |
|
835 <block localId="38" width="195" height="45" typeName="DATE_AND_TIME_TO_DATE" executionOrderId="0"> |
|
836 <position x="265" y="1834"/> |
|
837 <inputVariables> |
|
838 <variable formalParameter="IN"> |
|
839 <connectionPointIn> |
|
840 <relPosition x="0" y="31"/> |
|
841 <connection refLocalId="36"> |
|
842 <position x="265" y="1865"/> |
|
843 <position x="242" y="1865"/> |
|
844 <position x="242" y="1790"/> |
|
845 <position x="125" y="1790"/> |
|
846 </connection> |
|
847 </connectionPointIn> |
|
848 </variable> |
|
849 </inputVariables> |
|
850 <inOutVariables/> |
|
851 <outputVariables> |
|
852 <variable formalParameter="OUT"> |
|
853 <connectionPointOut> |
|
854 <relPosition x="195" y="31"/> |
|
855 </connectionPointOut> |
|
856 </variable> |
|
857 </outputVariables> |
|
858 </block> |
|
859 <outVariable localId="40" height="30" width="82" executionOrderId="0" negated="false"> |
|
860 <position x="580" y="1849"/> |
|
861 <connectionPointIn> |
|
862 <relPosition x="0" y="16"/> |
|
863 <connection refLocalId="38" formalParameter="OUT"> |
|
864 <position x="580" y="1865"/> |
|
865 <position x="460" y="1865"/> |
|
866 </connection> |
|
867 </connectionPointIn> |
|
868 <expression>Test_Date</expression> |
|
869 </outVariable> |
|
870 <outVariable localId="42" height="30" width="98" executionOrderId="0" negated="false"> |
|
871 <position x="465" y="1944"/> |
|
872 <connectionPointIn> |
|
873 <relPosition x="0" y="16"/> |
|
874 <connection refLocalId="46" formalParameter="OUT"> |
|
875 <position x="465" y="1960"/> |
|
876 <position x="395" y="1960"/> |
|
877 </connection> |
|
878 </connectionPointIn> |
|
879 <expression>Test_String</expression> |
|
880 </outVariable> |
|
881 <outVariable localId="43" height="30" width="82" executionOrderId="0" negated="false"> |
|
882 <position x="465" y="2014"/> |
|
883 <connectionPointIn> |
|
884 <relPosition x="0" y="16"/> |
|
885 <connection refLocalId="44" formalParameter="OUT"> |
|
886 <position x="465" y="2030"/> |
|
887 <position x="400" y="2030"/> |
|
888 </connection> |
|
889 </connectionPointIn> |
|
890 <expression>Test_Bool</expression> |
|
891 </outVariable> |
|
892 <block localId="44" width="135" height="45" typeName="STRING_TO_BOOL" executionOrderId="0"> |
|
893 <position x="265" y="1999"/> |
|
894 <inputVariables> |
|
895 <variable formalParameter="IN"> |
|
896 <connectionPointIn> |
|
897 <relPosition x="0" y="31"/> |
|
898 <connection refLocalId="45"> |
|
899 <position x="265" y="2030"/> |
|
900 <position x="115" y="2030"/> |
|
901 </connection> |
|
902 </connectionPointIn> |
|
903 </variable> |
|
904 </inputVariables> |
|
905 <inOutVariables/> |
|
906 <outputVariables> |
|
907 <variable formalParameter="OUT"> |
|
908 <connectionPointOut> |
|
909 <relPosition x="135" y="31"/> |
|
910 </connectionPointOut> |
|
911 </variable> |
|
912 </outputVariables> |
|
913 </block> |
|
914 <inVariable localId="45" height="30" width="58" executionOrderId="0" negated="false"> |
|
915 <position x="60" y="2014"/> |
|
916 <connectionPointOut> |
|
917 <relPosition x="58" y="16"/> |
|
918 </connectionPointOut> |
|
919 <expression>'True'</expression> |
|
920 </inVariable> |
|
921 <block localId="46" width="130" height="45" typeName="INT_TO_STRING" executionOrderId="0"> |
|
922 <position x="265" y="1929"/> |
|
923 <inputVariables> |
|
924 <variable formalParameter="IN"> |
|
925 <connectionPointIn> |
|
926 <relPosition x="0" y="31"/> |
|
927 <connection refLocalId="58"> |
|
928 <position x="265" y="1960"/> |
|
929 <position x="205" y="1960"/> |
|
930 </connection> |
|
931 </connectionPointIn> |
|
932 </variable> |
|
933 </inputVariables> |
|
934 <inOutVariables/> |
|
935 <outputVariables> |
|
936 <variable formalParameter="OUT"> |
|
937 <connectionPointOut> |
|
938 <relPosition x="130" y="31"/> |
|
939 </connectionPointOut> |
|
940 </variable> |
|
941 </outputVariables> |
|
942 </block> |
|
943 <inVariable localId="50" height="30" width="106" executionOrderId="0" negated="false"> |
|
944 <position x="75" y="2275"/> |
|
945 <connectionPointOut> |
|
946 <relPosition x="106" y="15"/> |
|
947 </connectionPointOut> |
|
948 <expression>Global_RS.Q1</expression> |
|
949 </inVariable> |
|
950 <block localId="51" width="70" height="85" typeName="AND" executionOrderId="0"> |
|
951 <position x="240" y="2255"/> |
|
952 <inputVariables> |
|
953 <variable formalParameter="IN1" negated="true"> |
|
954 <connectionPointIn> |
|
955 <relPosition x="0" y="35"/> |
|
956 <connection refLocalId="50"> |
|
957 <position x="240" y="2290"/> |
|
958 <position x="180" y="2290"/> |
|
959 </connection> |
|
960 </connectionPointIn> |
|
961 </variable> |
|
962 <variable formalParameter="IN2"> |
|
963 <connectionPointIn> |
|
964 <relPosition x="0" y="70"/> |
|
965 <connection refLocalId="52"> |
|
966 <position x="240" y="2325"/> |
|
967 <position x="180" y="2325"/> |
|
968 </connection> |
|
969 </connectionPointIn> |
|
970 </variable> |
|
971 </inputVariables> |
|
972 <inOutVariables/> |
|
973 <outputVariables> |
|
974 <variable formalParameter="OUT"> |
|
975 <connectionPointOut> |
|
976 <relPosition x="70" y="35"/> |
|
977 </connectionPointOut> |
|
978 </variable> |
|
979 </outputVariables> |
|
980 </block> |
|
981 <inVariable localId="52" height="30" width="105" executionOrderId="0" negated="false"> |
|
982 <position x="75" y="2310"/> |
|
983 <connectionPointOut> |
|
984 <relPosition x="105" y="15"/> |
|
985 </connectionPointOut> |
|
986 <expression>BOOL#TRUE</expression> |
|
987 </inVariable> |
|
988 <outVariable localId="13" height="30" width="105" executionOrderId="0" negated="false"> |
|
989 <position x="385" y="2275"/> |
|
990 <connectionPointIn> |
|
991 <relPosition x="0" y="15"/> |
|
992 <connection refLocalId="51" formalParameter="OUT"> |
|
993 <position x="385" y="2290"/> |
|
994 <position x="310" y="2290"/> |
|
995 </connection> |
|
996 </connectionPointIn> |
|
997 <expression>Global_RS.S</expression> |
|
998 </outVariable> |
|
999 <outVariable localId="20" height="30" width="106" executionOrderId="0" negated="false"> |
|
1000 <position x="385" y="2390"/> |
|
1001 <connectionPointIn> |
|
1002 <relPosition x="0" y="15"/> |
|
1003 <connection refLocalId="41" formalParameter="OUT"> |
|
1004 <position x="385" y="2405"/> |
|
1005 <position x="310" y="2405"/> |
|
1006 </connection> |
|
1007 </connectionPointIn> |
|
1008 <expression>Global_RS.R1</expression> |
|
1009 </outVariable> |
|
1010 <inVariable localId="24" height="30" width="106" executionOrderId="0" negated="false"> |
|
1011 <position x="75" y="2390"/> |
|
1012 <connectionPointOut> |
|
1013 <relPosition x="106" y="15"/> |
|
1014 </connectionPointOut> |
|
1015 <expression>Global_RS.Q1</expression> |
|
1016 </inVariable> |
|
1017 <block localId="41" width="70" height="85" typeName="OR" executionOrderId="0"> |
|
1018 <position x="240" y="2370"/> |
|
1019 <inputVariables> |
|
1020 <variable formalParameter="IN1"> |
|
1021 <connectionPointIn> |
|
1022 <relPosition x="0" y="35"/> |
|
1023 <connection refLocalId="24"> |
|
1024 <position x="240" y="2405"/> |
|
1025 <position x="180" y="2405"/> |
|
1026 </connection> |
|
1027 </connectionPointIn> |
|
1028 </variable> |
|
1029 <variable formalParameter="IN2"> |
|
1030 <connectionPointIn> |
|
1031 <relPosition x="0" y="70"/> |
|
1032 <connection refLocalId="48"> |
|
1033 <position x="240" y="2440"/> |
|
1034 <position x="180" y="2440"/> |
|
1035 </connection> |
|
1036 </connectionPointIn> |
|
1037 </variable> |
|
1038 </inputVariables> |
|
1039 <inOutVariables/> |
|
1040 <outputVariables> |
|
1041 <variable formalParameter="OUT"> |
|
1042 <connectionPointOut> |
|
1043 <relPosition x="70" y="35"/> |
|
1044 </connectionPointOut> |
|
1045 </variable> |
|
1046 </outputVariables> |
|
1047 </block> |
|
1048 <inVariable localId="48" height="30" width="105" executionOrderId="0" negated="false"> |
|
1049 <position x="75" y="2425"/> |
|
1050 <connectionPointOut> |
|
1051 <relPosition x="105" y="15"/> |
|
1052 </connectionPointOut> |
|
1053 <expression>BOOL#FALSE</expression> |
|
1054 </inVariable> |
|
1055 <outVariable localId="54" height="30" width="135" executionOrderId="0" negated="false"> |
|
1056 <position x="930" y="1774"/> |
|
1057 <connectionPointIn> |
|
1058 <relPosition x="0" y="16"/> |
|
1059 <connection refLocalId="55" formalParameter="OUT"> |
|
1060 <position x="930" y="1790"/> |
|
1061 <position x="855" y="1790"/> |
|
1062 </connection> |
|
1063 </connectionPointIn> |
|
1064 <expression>Test_TOD_STRING</expression> |
|
1065 </outVariable> |
|
1066 <block localId="55" width="125" height="45" typeName="TOD_TO_STRING" executionOrderId="0"> |
|
1067 <position x="730" y="1759"/> |
|
1068 <inputVariables> |
|
1069 <variable formalParameter="IN"> |
|
1070 <connectionPointIn> |
|
1071 <relPosition x="0" y="31"/> |
|
1072 <connection refLocalId="39"> |
|
1073 <position x="730" y="1790"/> |
|
1074 <position x="655" y="1790"/> |
|
1075 </connection> |
|
1076 </connectionPointIn> |
|
1077 </variable> |
|
1078 </inputVariables> |
|
1079 <inOutVariables/> |
|
1080 <outputVariables> |
|
1081 <variable formalParameter="OUT"> |
|
1082 <connectionPointOut> |
|
1083 <relPosition x="125" y="31"/> |
|
1084 </connectionPointOut> |
|
1085 </variable> |
|
1086 </outputVariables> |
|
1087 </block> |
|
1088 <inOutVariable localId="39" height="30" width="75" executionOrderId="0" negatedOut="false" negatedIn="false"> |
|
1089 <position x="580" y="1774"/> |
|
1090 <connectionPointIn> |
|
1091 <relPosition x="0" y="16"/> |
|
1092 <connection refLocalId="37" formalParameter="OUT"> |
|
1093 <position x="580" y="1790"/> |
|
1094 <position x="520" y="1790"/> |
|
1095 </connection> |
|
1096 </connectionPointIn> |
|
1097 <connectionPointOut> |
|
1098 <relPosition x="75" y="16"/> |
|
1099 </connectionPointOut> |
|
1100 <expression>Test_TOD</expression> |
|
1101 </inOutVariable> |
|
1102 <inVariable localId="49" height="30" width="30" executionOrderId="0" negated="false"> |
|
1103 <position x="160" y="2510"/> |
|
1104 <connectionPointOut> |
|
1105 <relPosition x="30" y="15"/> |
|
1106 </connectionPointOut> |
|
1107 <expression>42</expression> |
|
1108 </inVariable> |
|
1109 <outVariable localId="57" height="30" width="50" executionOrderId="0" negated="false"> |
|
1110 <position x="240" y="2510"/> |
|
1111 <connectionPointIn> |
|
1112 <relPosition x="0" y="15"/> |
|
1113 <connection refLocalId="49"> |
|
1114 <position x="240" y="2525"/> |
|
1115 <position x="190" y="2525"/> |
|
1116 </connection> |
|
1117 </connectionPointIn> |
|
1118 <expression>TOTO</expression> |
|
1119 </outVariable> |
|
1120 <outVariable localId="56" height="30" width="50" executionOrderId="0" negated="false"> |
|
1121 <position x="240" y="2550"/> |
|
1122 <connectionPointIn> |
|
1123 <relPosition x="0" y="15"/> |
|
1124 <connection refLocalId="49"> |
|
1125 <position x="240" y="2565"/> |
|
1126 <position x="215" y="2565"/> |
|
1127 <position x="215" y="2525"/> |
|
1128 <position x="190" y="2525"/> |
|
1129 </connection> |
|
1130 </connectionPointIn> |
|
1131 <expression>TUTU</expression> |
|
1132 </outVariable> |
|
1133 <inVariable localId="58" height="30" width="146" executionOrderId="0" negated="false"> |
|
1134 <position x="60" y="1944"/> |
|
1135 <connectionPointOut> |
|
1136 <relPosition x="146" y="16"/> |
|
1137 </connectionPointOut> |
|
1138 <expression>Second_Python_Var</expression> |
|
1139 </inVariable> |
|
1140 <inVariable localId="59" height="30" width="30" executionOrderId="0" negated="false"> |
|
1141 <position x="100" y="1385"/> |
|
1142 <connectionPointOut> |
|
1143 <relPosition x="30" y="15"/> |
|
1144 </connectionPointOut> |
|
1145 <expression>1</expression> |
|
1146 </inVariable> |
|
1147 <block localId="61" typeName="function0" executionOrderId="0" height="45" width="111"> |
|
1148 <position x="760" y="1170"/> |
|
1149 <inputVariables> |
|
1150 <variable formalParameter="LocalVar0"> |
|
1151 <connectionPointIn> |
|
1152 <relPosition x="0" y="30"/> |
|
1153 <connection refLocalId="62"> |
|
1154 <position x="760" y="1200"/> |
|
1155 <position x="723" y="1200"/> |
|
1156 </connection> |
|
1157 </connectionPointIn> |
|
1158 </variable> |
|
1159 </inputVariables> |
|
1160 <inOutVariables/> |
|
1161 <outputVariables> |
|
1162 <variable formalParameter="OUT"> |
|
1163 <connectionPointOut> |
|
1164 <relPosition x="111" y="30"/> |
|
1165 </connectionPointOut> |
|
1166 </variable> |
|
1167 </outputVariables> |
|
1168 </block> |
|
1169 <inVariable localId="62" executionOrderId="0" height="30" width="58" negated="false"> |
|
1170 <position x="665" y="1185"/> |
|
1171 <connectionPointOut> |
|
1172 <relPosition x="58" y="15"/> |
|
1173 </connectionPointOut> |
|
1174 <expression>fefvsd</expression> |
|
1175 </inVariable> |
|
1176 <outVariable localId="63" executionOrderId="0" height="30" width="58" negated="false"> |
|
1177 <position x="905" y="1185"/> |
|
1178 <connectionPointIn> |
|
1179 <relPosition x="0" y="15"/> |
|
1180 <connection refLocalId="61" formalParameter="OUT"> |
|
1181 <position x="905" y="1200"/> |
|
1182 <position x="871" y="1200"/> |
|
1183 </connection> |
|
1184 </connectionPointIn> |
|
1185 <expression>fefvsd</expression> |
|
1186 </outVariable> |
|
1187 <comment localId="53" height="80" width="420"> |
|
1188 <position x="75" y="2160"/> |
|
1189 <content> |
|
1190 <xhtml:p><![CDATA[Shows global variables access from resource configuration (res_pytest) and from project's configuration.]]></xhtml:p> |
|
1191 </content> |
|
1192 </comment> |
|
1193 <inVariable localId="18" height="30" width="74" executionOrderId="0" negated="false"> |
|
1194 <position x="986" y="795"/> |
|
1195 <connectionPointOut> |
|
1196 <relPosition x="74" y="15"/> |
|
1197 </connectionPointOut> |
|
1198 <expression>mux2_sel</expression> |
|
1199 </inVariable> |
|
1200 <comment localId="60" height="45" width="930"> |
|
1201 <position x="60" y="1480"/> |
|
1202 <content> |
|
1203 <xhtml:p><![CDATA[Here is shown how to convert values between different types (BCD, DT, TOD, STRING and others) using standard functions.]]></xhtml:p> |
|
1204 </content> |
|
1205 </comment> |
|
1206 <comment localId="64" height="55" width="300"> |
|
1207 <position x="665" y="1095"/> |
|
1208 <content> |
|
1209 <xhtml:p><![CDATA[Example of usage of user-defined function.]]></xhtml:p> |
|
1210 </content> |
|
1211 </comment> |
|
1212 <comment localId="65" height="45" width="410"> |
|
1213 <position x="55" y="1315"/> |
|
1214 <content> |
|
1215 <xhtml:p><![CDATA[Shows access variable defined in python extension. ]]></xhtml:p> |
|
1216 </content> |
|
1217 </comment> |
|
1218 <inVariable localId="66" height="30" width="137" executionOrderId="0" negated="false"> |
|
1219 <position x="60" y="1685"/> |
|
1220 <connectionPointOut> |
|
1221 <relPosition x="137" y="15"/> |
|
1222 </connectionPointOut> |
|
1223 <expression>Test_BCD_WRONG</expression> |
|
1224 </inVariable> |
|
1225 <block localId="67" width="106" height="100" typeName="BCD_TO_UINT" executionOrderId="0"> |
|
1226 <position x="265" y="1620"/> |
|
1227 <inputVariables> |
|
1228 <variable formalParameter="EN"> |
|
1229 <connectionPointIn> |
|
1230 <relPosition x="0" y="40"/> |
|
1231 </connectionPointIn> |
|
1232 </variable> |
|
1233 <variable formalParameter="IN"> |
|
1234 <connectionPointIn> |
|
1235 <relPosition x="0" y="80"/> |
|
1236 <connection refLocalId="66"> |
|
1237 <position x="265" y="1700"/> |
|
1238 <position x="255" y="1700"/> |
|
1239 <position x="255" y="1700"/> |
|
1240 <position x="345" y="1700"/> |
|
1241 <position x="345" y="1700"/> |
|
1242 <position x="197" y="1700"/> |
|
1243 </connection> |
|
1244 </connectionPointIn> |
|
1245 </variable> |
|
1246 </inputVariables> |
|
1247 <inOutVariables/> |
|
1248 <outputVariables> |
|
1249 <variable formalParameter="ENO"> |
|
1250 <connectionPointOut> |
|
1251 <relPosition x="106" y="40"/> |
|
1252 </connectionPointOut> |
|
1253 </variable> |
|
1254 <variable formalParameter="OUT"> |
|
1255 <connectionPointOut> |
|
1256 <relPosition x="106" y="80"/> |
|
1257 </connectionPointOut> |
|
1258 </variable> |
|
1259 </outputVariables> |
|
1260 </block> |
|
1261 <outVariable localId="68" height="30" width="196" executionOrderId="0" negated="false"> |
|
1262 <position x="580" y="1685"/> |
|
1263 <connectionPointIn> |
|
1264 <relPosition x="0" y="15"/> |
|
1265 <connection refLocalId="67" formalParameter="OUT"> |
|
1266 <position x="580" y="1700"/> |
|
1267 <position x="371" y="1700"/> |
|
1268 </connection> |
|
1269 </connectionPointIn> |
|
1270 <expression>Test_BCD_WRONG_RESULT</expression> |
|
1271 </outVariable> |
|
1272 <comment localId="69" height="165" width="375"> |
|
1273 <position x="795" y="1590"/> |
|
1274 <content> |
|
1275 <xhtml:p><![CDATA[Incorrect BCD number is not converted to UINT. |
|
1276 |
|
1277 151 (16#97) is good BCD number , but |
|
1278 154 (16#9A) is not. |
|
1279 |
|
1280 Try this out and look at value of Test_BCD_CONVERTED variable. |
|
1281 |
|
1282 |
|
1283 ]]></xhtml:p> |
|
1284 </content> |
|
1285 </comment> |
|
1286 <outVariable localId="70" height="30" width="185" executionOrderId="0" negated="false"> |
|
1287 <position x="580" y="1645"/> |
|
1288 <connectionPointIn> |
|
1289 <relPosition x="0" y="15"/> |
|
1290 <connection refLocalId="67" formalParameter="ENO"> |
|
1291 <position x="580" y="1660"/> |
|
1292 <position x="370" y="1660"/> |
|
1293 </connection> |
|
1294 </connectionPointIn> |
|
1295 <expression>Test_BCD_CONVERTED</expression> |
|
1296 </outVariable> |
|
1297 <comment localId="71" height="215" width="680"> |
|
1298 <position x="35" y="30"/> |
|
1299 <content> |
|
1300 <xhtml:p><![CDATA[This example shows many features in Beremiz: |
|
1301 |
|
1302 1. How to implement python extensions. |
|
1303 2. How to implement basic C extension. |
|
1304 3. How to use C code in IEC POUs. |
|
1305 4. How to call C functions from python code. |
|
1306 5. How to avoid race conditions between IEC, C and python code. |
|
1307 6. How to convert betweet different IEC types. |
|
1308 ]]></xhtml:p> |
|
1309 </content> |
|
1310 </comment> |
|
1311 <outVariable localId="72" executionOrderId="0" height="30" width="60" negated="false"> |
|
1312 <position x="1065" y="1970"/> |
|
1313 <connectionPointIn> |
|
1314 <relPosition x="0" y="15"/> |
|
1315 <connection refLocalId="76" formalParameter="OUT"> |
|
1316 <position x="1065" y="1985"/> |
|
1317 <position x="1025" y="1985"/> |
|
1318 <position x="1025" y="1995"/> |
|
1319 <position x="985" y="1995"/> |
|
1320 </connection> |
|
1321 </connectionPointIn> |
|
1322 <expression>Grumpf</expression> |
|
1323 </outVariable> |
|
1324 <inVariable localId="73" executionOrderId="0" height="30" width="85" negated="false"> |
|
1325 <position x="625" y="1940"/> |
|
1326 <connectionPointOut> |
|
1327 <relPosition x="85" y="15"/> |
|
1328 </connectionPointOut> |
|
1329 <expression>BOOL#TRUE</expression> |
|
1330 </inVariable> |
|
1331 <inVariable localId="74" executionOrderId="0" height="30" width="70" negated="false"> |
|
1332 <position x="625" y="1975"/> |
|
1333 <connectionPointOut> |
|
1334 <relPosition x="70" y="15"/> |
|
1335 </connectionPointOut> |
|
1336 <expression>Test_DT</expression> |
|
1337 </inVariable> |
|
1338 <block localId="75" typeName="RTC" instanceName="RTC0" executionOrderId="0" height="90" width="65"> |
|
1339 <position x="760" y="1925"/> |
|
1340 <inputVariables> |
|
1341 <variable formalParameter="IN"> |
|
1342 <connectionPointIn> |
|
1343 <relPosition x="0" y="35"/> |
|
1344 <connection refLocalId="73"> |
|
1345 <position x="760" y="1960"/> |
|
1346 <position x="735" y="1960"/> |
|
1347 <position x="735" y="1955"/> |
|
1348 <position x="710" y="1955"/> |
|
1349 </connection> |
|
1350 </connectionPointIn> |
|
1351 </variable> |
|
1352 <variable formalParameter="PDT"> |
|
1353 <connectionPointIn> |
|
1354 <relPosition x="0" y="70"/> |
|
1355 <connection refLocalId="74"> |
|
1356 <position x="760" y="1995"/> |
|
1357 <position x="727" y="1995"/> |
|
1358 <position x="727" y="1990"/> |
|
1359 <position x="695" y="1990"/> |
|
1360 </connection> |
|
1361 </connectionPointIn> |
|
1362 </variable> |
|
1363 </inputVariables> |
|
1364 <inOutVariables/> |
|
1365 <outputVariables> |
|
1366 <variable formalParameter="Q"> |
|
1367 <connectionPointOut> |
|
1368 <relPosition x="65" y="35"/> |
|
1369 </connectionPointOut> |
|
1370 </variable> |
|
1371 <variable formalParameter="CDT"> |
|
1372 <connectionPointOut> |
|
1373 <relPosition x="65" y="70"/> |
|
1374 </connectionPointOut> |
|
1375 </variable> |
|
1376 </outputVariables> |
|
1377 </block> |
|
1378 <block localId="76" typeName="DT_TO_STRING" executionOrderId="0" height="40" width="110"> |
|
1379 <position x="875" y="1965"/> |
|
1380 <inputVariables> |
|
1381 <variable formalParameter="IN"> |
|
1382 <connectionPointIn> |
|
1383 <relPosition x="0" y="30"/> |
|
1384 <connection refLocalId="75" formalParameter="CDT"> |
|
1385 <position x="875" y="1995"/> |
|
1386 <position x="825" y="1995"/> |
|
1387 </connection> |
|
1388 </connectionPointIn> |
|
1389 </variable> |
|
1390 </inputVariables> |
|
1391 <inOutVariables/> |
|
1392 <outputVariables> |
|
1393 <variable formalParameter="OUT"> |
|
1394 <connectionPointOut> |
|
1395 <relPosition x="110" y="30"/> |
|
1396 </connectionPointOut> |
|
1397 </variable> |
|
1398 </outputVariables> |
|
1399 </block> |
|
1400 <block localId="77" typeName="ADD" executionOrderId="0" height="60" width="65"> |
|
1401 <position x="170" y="1370"/> |
|
1402 <inputVariables> |
|
1403 <variable formalParameter="IN1"> |
|
1404 <connectionPointIn> |
|
1405 <relPosition x="0" y="30"/> |
|
1406 <connection refLocalId="59"> |
|
1407 <position x="170" y="1400"/> |
|
1408 <position x="130" y="1400"/> |
|
1409 </connection> |
|
1410 </connectionPointIn> |
|
1411 </variable> |
|
1412 <variable formalParameter="IN2"> |
|
1413 <connectionPointIn> |
|
1414 <relPosition x="0" y="50"/> |
|
1415 <connection refLocalId="78"> |
|
1416 <position x="170" y="1420"/> |
|
1417 <position x="160" y="1420"/> |
|
1418 <position x="160" y="1450"/> |
|
1419 <position x="390" y="1450"/> |
|
1420 <position x="390" y="1400"/> |
|
1421 <position x="380" y="1400"/> |
|
1422 </connection> |
|
1423 </connectionPointIn> |
|
1424 </variable> |
|
1425 </inputVariables> |
|
1426 <inOutVariables/> |
|
1427 <outputVariables> |
|
1428 <variable formalParameter="OUT"> |
|
1429 <connectionPointOut> |
|
1430 <relPosition x="65" y="30"/> |
|
1431 </connectionPointOut> |
|
1432 </variable> |
|
1433 </outputVariables> |
|
1434 </block> |
|
1435 <outVariable localId="47" executionOrderId="0" height="30" width="130" negated="false"> |
|
1436 <position x="625" y="1335"/> |
|
1437 <connectionPointIn> |
|
1438 <relPosition x="0" y="15"/> |
|
1439 <connection refLocalId="79"> |
|
1440 <position x="625" y="1350"/> |
|
1441 <position x="590" y="1350"/> |
|
1442 </connection> |
|
1443 </connectionPointIn> |
|
1444 <expression>Test_Python_Var</expression> |
|
1445 </outVariable> |
|
1446 <inVariable localId="79" executionOrderId="0" height="25" width="30" negated="false"> |
|
1447 <position x="560" y="1340"/> |
|
1448 <connectionPointOut> |
|
1449 <relPosition x="30" y="10"/> |
|
1450 </connectionPointOut> |
|
1451 <expression>23</expression> |
|
1452 </inVariable> |
|
1453 <inOutVariable localId="78" executionOrderId="0" height="30" width="100" negatedOut="false" negatedIn="false"> |
|
1454 <position x="280" y="1385"/> |
|
1455 <connectionPointIn> |
|
1456 <relPosition x="0" y="15"/> |
|
1457 <connection refLocalId="77" formalParameter="OUT"> |
|
1458 <position x="280" y="1400"/> |
|
1459 <position x="235" y="1400"/> |
|
1460 </connection> |
|
1461 </connectionPointIn> |
|
1462 <connectionPointOut> |
|
1463 <relPosition x="100" y="15"/> |
|
1464 </connectionPointOut> |
|
1465 <expression>SomeVarName</expression> |
|
1466 </inOutVariable> |
|
1467 </FBD> |
|
1468 </body> |
|
1469 </pou> |
|
1470 <pou name="C_Pragma" pouType="functionBlock"> |
|
1471 <interface> |
|
1472 <outputVars> |
|
1473 <variable name="OUT"> |
|
1474 <type> |
|
1475 <SINT/> |
|
1476 </type> |
|
1477 </variable> |
|
1478 </outputVars> |
|
1479 <inputVars> |
|
1480 <variable name="IN"> |
|
1481 <type> |
|
1482 <SINT/> |
|
1483 </type> |
|
1484 </variable> |
|
1485 </inputVars> |
|
1486 <localVars> |
|
1487 <variable name="COORDS"> |
|
1488 <type> |
|
1489 <array> |
|
1490 <dimension lower="0" upper="5"/> |
|
1491 <baseType> |
|
1492 <SINT/> |
|
1493 </baseType> |
|
1494 </array> |
|
1495 </type> |
|
1496 <initialValue> |
|
1497 <arrayValue> |
|
1498 <value> |
|
1499 <simpleValue value="54"/> |
|
1500 </value> |
|
1501 <value> |
|
1502 <simpleValue value="55"/> |
|
1503 </value> |
|
1504 <value> |
|
1505 <simpleValue value="56"/> |
|
1506 </value> |
|
1507 <value> |
|
1508 <simpleValue value="57"/> |
|
1509 </value> |
|
1510 <value> |
|
1511 <simpleValue value="58"/> |
|
1512 </value> |
|
1513 <value> |
|
1514 <simpleValue value="59"/> |
|
1515 </value> |
|
1516 </arrayValue> |
|
1517 </initialValue> |
|
1518 </variable> |
|
1519 <variable name="SMURF"> |
|
1520 <type> |
|
1521 <derived name="CPLX_TYPE"/> |
|
1522 </type> |
|
1523 </variable> |
|
1524 </localVars> |
|
1525 <externalVars> |
|
1526 <variable name="Global_RS"> |
|
1527 <type> |
|
1528 <derived name="RS"/> |
|
1529 </type> |
|
1530 </variable> |
|
1531 <variable name="Dudiduda"> |
|
1532 <type> |
|
1533 <derived name="blups"/> |
|
1534 </type> |
|
1535 </variable> |
|
1536 </externalVars> |
|
1537 </interface> |
|
1538 <body> |
|
1539 <ST> |
|
1540 <xhtml:p><![CDATA[(* hereafter is a C pragma accessing FB interface in a clean way *) |
|
1541 {{ |
|
1542 char toPLC; |
|
1543 char fromPLC = GetFbVar(IN); |
|
1544 extern int PLC_C_Call(char, char *); |
|
1545 if(PLC_C_Call(fromPLC, &toPLC)){ |
|
1546 SetFbVar(OUT, toPLC); |
|
1547 } |
|
1548 if(0){ |
|
1549 /* that code demonstrate C access to complex types */ |
|
1550 char somebyte = GetFbVar(COORDS, .table[3]); |
|
1551 SetFbVar(SMURF, somebyte, .FIRSTBYTE); |
|
1552 SetFbVar(COORDS, somebyte, .table[4]); |
|
1553 } |
|
1554 }} |
|
1555 (* If you do not use GetFbVar and SetFbVar macros, expect unexpected behaviour*) |
|
1556 Global_RS(); |
|
1557 |
|
1558 (* testing access to global struct array *) |
|
1559 Dudiduda[2].FIRSTBYTE := 0; |
|
1560 ]]></xhtml:p> |
|
1561 </ST> |
|
1562 </body> |
|
1563 </pou> |
|
1564 <pou name="norm" pouType="function"> |
|
1565 <interface> |
|
1566 <returnType> |
|
1567 <REAL/> |
|
1568 </returnType> |
|
1569 <inputVars> |
|
1570 <variable name="IN1"> |
|
1571 <type> |
|
1572 <REAL/> |
|
1573 </type> |
|
1574 </variable> |
|
1575 <variable name="IN2"> |
|
1576 <type> |
|
1577 <REAL/> |
|
1578 </type> |
|
1579 </variable> |
|
1580 </inputVars> |
|
1581 </interface> |
|
1582 <body> |
|
1583 <ST> |
|
1584 <xhtml:p><![CDATA[NORM := SQRT(IN1 * IN1 + IN2 * IN2);]]></xhtml:p> |
|
1585 </ST> |
|
1586 </body> |
|
1587 </pou> |
|
1588 <pou name="function0" pouType="function"> |
|
1589 <interface> |
|
1590 <returnType> |
|
1591 <derived name="datatype0"/> |
|
1592 </returnType> |
|
1593 <inputVars> |
|
1594 <variable name="LocalVar0"> |
|
1595 <type> |
|
1596 <derived name="datatype0"/> |
|
1597 </type> |
|
1598 </variable> |
|
1599 </inputVars> |
|
1600 </interface> |
|
1601 <body> |
|
1602 <ST> |
|
1603 <xhtml:p><![CDATA[function0 := LocalVar0; |
|
1604 ]]></xhtml:p> |
|
1605 </ST> |
|
1606 </body> |
|
1607 </pou> |
|
1608 </pous> |
|
1609 </types> |
|
1610 <instances> |
|
1611 <configurations> |
|
1612 <configuration name="config"> |
|
1613 <resource name="res_pytest"> |
|
1614 <task name="pytest_task" priority="0" interval="T#500ms"/> |
|
1615 <globalVars> |
|
1616 <variable name="TOTO"> |
|
1617 <type> |
|
1618 <INT/> |
|
1619 </type> |
|
1620 </variable> |
|
1621 </globalVars> |
|
1622 <pouInstance name="pytest_instance" typeName="main_pytest"/> |
|
1623 </resource> |
|
1624 <globalVars> |
|
1625 <variable name="Global_RS"> |
|
1626 <type> |
|
1627 <derived name="RS"/> |
|
1628 </type> |
|
1629 </variable> |
|
1630 <variable name="Dudiduda"> |
|
1631 <type> |
|
1632 <derived name="blups"/> |
|
1633 </type> |
|
1634 </variable> |
|
1635 <variable name="TUTU"> |
|
1636 <type> |
|
1637 <INT/> |
|
1638 </type> |
|
1639 </variable> |
|
1640 </globalVars> |
|
1641 </configuration> |
|
1642 </configurations> |
|
1643 </instances> |
|
1644 </project> |