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-10-18T20:37:52"> |
11 modificationDateTime="2012-10-19T11:54:13"> |
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> |
586 <type> |
603 <type> |
587 <SINT/> |
604 <SINT/> |
588 </type> |
605 </type> |
589 </variable> |
606 </variable> |
590 </inputVars> |
607 </inputVars> |
|
608 <localVars> |
|
609 <variable name="COORDS"> |
|
610 <type> |
|
611 <array> |
|
612 <dimension lower="0" upper="5"/> |
|
613 <baseType> |
|
614 <SINT/> |
|
615 </baseType> |
|
616 </array> |
|
617 </type> |
|
618 <initialValue> |
|
619 <arrayValue> |
|
620 <value> |
|
621 <simpleValue value="54"/> |
|
622 </value> |
|
623 <value> |
|
624 <simpleValue value="55"/> |
|
625 </value> |
|
626 <value> |
|
627 <simpleValue value="56"/> |
|
628 </value> |
|
629 <value> |
|
630 <simpleValue value="57"/> |
|
631 </value> |
|
632 <value> |
|
633 <simpleValue value="58"/> |
|
634 </value> |
|
635 <value> |
|
636 <simpleValue value="59"/> |
|
637 </value> |
|
638 </arrayValue> |
|
639 </initialValue> |
|
640 </variable> |
|
641 <variable name="SMURF"> |
|
642 <type> |
|
643 <derived name="CPLX_TYPE"/> |
|
644 </type> |
|
645 </variable> |
|
646 </localVars> |
591 </interface> |
647 </interface> |
592 <body> |
648 <body> |
593 <ST> |
649 <ST> |
594 <![CDATA[(* hereafter is a C pragma accessing FB interface in a clean way *) |
650 <![CDATA[(* hereafter is a C pragma accessing FB interface in a clean way *) |
595 { |
651 {{ |
596 int toPLC; |
652 char toPLC; |
597 int fromPLC = __GET_VAR(data__->IN); |
653 char fromPLC = GetFbVar(IN); |
598 if(PLC_C_Call(fromPLC, &toPLC))__SET_VAR(data__->,OUT,toPLC); |
654 if(PLC_C_Call(fromPLC, &toPLC)){ |
599 } |
655 SetFbVar(OUT, toPLC); |
|
656 } |
|
657 if(0){ |
|
658 /* that code demonstrate C access to complex types */ |
|
659 char somebyte = GetFbVar(COORDS, .table[3]); |
|
660 SetFbVar(SMURF, somebyte, .FIRSTBYTE); |
|
661 SetFbVar(COORDS, somebyte, .table[4]); |
|
662 } |
|
663 }} |
600 (* If you do not use __GET_VAR and _SET_VAR macro, expect unexpected *) |
664 (* If you do not use __GET_VAR and _SET_VAR macro, expect unexpected *) |
601 ]]> |
665 ]]> |
602 </ST> |
666 </ST> |
603 </body> |
667 </body> |
604 </pou> |
668 </pou> |