6 <fileHeader companyName="beremiz" |
6 <fileHeader companyName="beremiz" |
7 productName="Beremiz" |
7 productName="Beremiz" |
8 productVersion="0.0" |
8 productVersion="0.0" |
9 creationDateTime="2008-12-14T16:21:19"/> |
9 creationDateTime="2008-12-14T16:21:19"/> |
10 <contentHeader name="Beremiz Python Support Tests" |
10 <contentHeader name="Beremiz Python Support Tests" |
11 modificationDateTime="2012-06-08T23:11:45"> |
11 modificationDateTime="2012-10-18T20:21:28"> |
12 <coordinateInfo> |
12 <coordinateInfo> |
13 <pageSize x="1024" y="1024"/> |
13 <pageSize x="1024" y="1024"/> |
14 <fbd> |
14 <fbd> |
15 <scaling x="5" y="5"/> |
15 <scaling x="5" y="5"/> |
16 </fbd> |
16 </fbd> |
200 <inVariable localId="11" height="30" width="290"> |
210 <inVariable localId="11" height="30" width="290"> |
201 <position x="290" y="465"/> |
211 <position x="290" y="465"/> |
202 <connectionPointOut> |
212 <connectionPointOut> |
203 <relPosition x="290" y="15"/> |
213 <relPosition x="290" y="15"/> |
204 </connectionPointOut> |
214 </connectionPointOut> |
205 <expression>'PLCBinary.Python_to_C_Call(5678)'</expression> |
215 <expression>'PLCBinary.Simple_C_Call(5678)'</expression> |
206 </inVariable> |
216 </inVariable> |
207 <block localId="12" width="125" height="80" typeName="python_eval" instanceName="Block2"> |
217 <block localId="12" width="125" height="80" typeName="python_eval" instanceName="Block2"> |
208 <position x="650" y="417"/> |
218 <position x="650" y="417"/> |
209 <inputVariables> |
219 <inputVariables> |
210 <variable formalParameter="TRIG"> |
220 <variable formalParameter="TRIG"> |
455 <position x="1065" y="200"/> |
465 <position x="1065" y="200"/> |
456 </connection> |
466 </connection> |
457 </connectionPointIn> |
467 </connectionPointIn> |
458 <expression>pytest_var3</expression> |
468 <expression>pytest_var3</expression> |
459 </outVariable> |
469 </outVariable> |
|
470 <outVariable localId="25" height="30" width="60"> |
|
471 <position x="820" y="750"/> |
|
472 <connectionPointIn> |
|
473 <relPosition x="0" y="15"/> |
|
474 <connection refLocalId="26" formalParameter="OUT"> |
|
475 <position x="820" y="765"/> |
|
476 <position x="765" y="765"/> |
|
477 </connection> |
|
478 </connectionPointIn> |
|
479 <expression>FromC</expression> |
|
480 </outVariable> |
|
481 <inVariable localId="1" height="30" width="30"> |
|
482 <position x="605" y="750"/> |
|
483 <connectionPointOut> |
|
484 <relPosition x="30" y="15"/> |
|
485 </connectionPointOut> |
|
486 <expression>23</expression> |
|
487 </inVariable> |
|
488 <block localId="26" width="80" height="45" typeName="C_Pragma" instanceName="C_Pragma0"> |
|
489 <position x="685" y="735"/> |
|
490 <inputVariables> |
|
491 <variable formalParameter="IN"> |
|
492 <connectionPointIn> |
|
493 <relPosition x="0" y="30"/> |
|
494 <connection refLocalId="1"> |
|
495 <position x="685" y="765"/> |
|
496 <position x="635" y="765"/> |
|
497 </connection> |
|
498 </connectionPointIn> |
|
499 </variable> |
|
500 </inputVariables> |
|
501 <inOutVariables/> |
|
502 <outputVariables> |
|
503 <variable formalParameter="OUT"> |
|
504 <connectionPointOut> |
|
505 <relPosition x="80" y="30"/> |
|
506 </connectionPointOut> |
|
507 </variable> |
|
508 </outputVariables> |
|
509 </block> |
460 </FBD> |
510 </FBD> |
|
511 </body> |
|
512 </pou> |
|
513 <pou name="C_Pragma" pouType="functionBlock"> |
|
514 <interface> |
|
515 <outputVars> |
|
516 <variable name="OUT"> |
|
517 <type> |
|
518 <SINT/> |
|
519 </type> |
|
520 </variable> |
|
521 </outputVars> |
|
522 <inputVars> |
|
523 <variable name="IN"> |
|
524 <type> |
|
525 <SINT/> |
|
526 </type> |
|
527 </variable> |
|
528 </inputVars> |
|
529 </interface> |
|
530 <body> |
|
531 <ST> |
|
532 <![CDATA[(* hereafter is a C pragma accessing FB interface in a clean way *) |
|
533 { |
|
534 int toPLC; |
|
535 int fromPLC = __GET_VAR(data__->IN); |
|
536 if(PLC_C_Call(fromPLC, &toPLC))__SET_VAR(data__->,OUT,toPLC); |
|
537 } |
|
538 (* If you do not use __GET_VAR and _SET_VAR macro, expect unexpected *) |
|
539 ]]> |
|
540 </ST> |
461 </body> |
541 </body> |
462 </pou> |
542 </pou> |
463 </pous> |
543 </pous> |
464 </types> |
544 </types> |
465 <instances> |
545 <instances> |