tests/python/plc.xml
changeset 2626 39d78c530cbb
parent 2346 ac16bad593cf
child 2680 6bfed6757495
equal deleted inserted replaced
2625:e5ce6c4a8672 2626:39d78c530cbb
     1 <?xml version='1.0' encoding='utf-8'?>
     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">
     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:&#10;&#10;   1. How to implement python extensions.&#10;   2. How to implement basic C extension.&#10;   3. How to use C code in IEC POUs.&#10;   4. How to call C functions from python code.&#10;   5. How to avoid race conditions between IEC, C and python code.&#10;   6. How to convert betweet different IEC types.&#10;"/>
     3   <fileHeader companyName="" productName="Beremiz" productVersion="0.0" creationDateTime="2008-12-14T16:21:19" contentDescription="This example shows many features in Beremiz:&#10;&#10;   1. How to implement python extensions.&#10;   2. How to implement basic C extension.&#10;   3. How to use C code in IEC POUs.&#10;   4. How to call C functions from python code.&#10;   5. How to avoid race conditions between IEC, C and python code.&#10;   6. How to convert betweet different IEC types.&#10;"/>
     4   <contentHeader name="Beremiz Python Support Tests" modificationDateTime="2018-09-26T13:15:28">
     4   <contentHeader name="Beremiz Python Support Tests" modificationDateTime="2019-09-24T11:49:14">
     5     <coordinateInfo>
     5     <coordinateInfo>
     6       <pageSize x="1024" y="1024"/>
     6       <pageSize x="1024" y="1024"/>
     7       <fbd>
     7       <fbd>
     8         <scaling x="5" y="5"/>
     8         <scaling x="5" y="5"/>
     9       </fbd>
     9       </fbd>
    47       <dataType name="datatype0">
    47       <dataType name="datatype0">
    48         <baseType>
    48         <baseType>
    49           <BOOL/>
    49           <BOOL/>
    50         </baseType>
    50         </baseType>
    51       </dataType>
    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>
    52     </dataTypes>
    62     </dataTypes>
    53     <pous>
    63     <pous>
    54       <pou name="main_pytest" pouType="program">
    64       <pou name="main_pytest" pouType="program">
    55         <interface>
    65         <interface>
    56           <localVars>
    66           <localVars>
    59                 <INT/>
    69                 <INT/>
    60               </type>
    70               </type>
    61               <initialValue>
    71               <initialValue>
    62                 <simpleValue value="3"/>
    72                 <simpleValue value="3"/>
    63               </initialValue>
    73               </initialValue>
       
    74               <documentation>
       
    75                 <xhtml:p><![CDATA[blah]]></xhtml:p>
       
    76               </documentation>
    64             </variable>
    77             </variable>
    65             <variable name="mux2_sel">
    78             <variable name="mux2_sel">
    66               <type>
    79               <type>
    67                 <INT/>
    80                 <INT/>
    68               </type>
    81               </type>
  1349             <variable name="Global_RS">
  1362             <variable name="Global_RS">
  1350               <type>
  1363               <type>
  1351                 <derived name="RS"/>
  1364                 <derived name="RS"/>
  1352               </type>
  1365               </type>
  1353             </variable>
  1366             </variable>
       
  1367             <variable name="Dudiduda">
       
  1368               <type>
       
  1369                 <derived name="blups"/>
       
  1370               </type>
       
  1371             </variable>
  1354           </externalVars>
  1372           </externalVars>
  1355         </interface>
  1373         </interface>
  1356         <body>
  1374         <body>
  1357           <ST>
  1375           <ST>
  1358             <xhtml:p><![CDATA[(* hereafter is a C pragma accessing FB interface in a clean way *)
  1376             <xhtml:p><![CDATA[(* hereafter is a C pragma accessing FB interface in a clean way *)
  1370     SetFbVar(COORDS, somebyte, .table[4]);
  1388     SetFbVar(COORDS, somebyte, .table[4]);
  1371   }
  1389   }
  1372 }}
  1390 }}
  1373 (* If you do not use GetFbVar and SetFbVar macros, expect unexpected behaviour*)
  1391 (* If you do not use GetFbVar and SetFbVar macros, expect unexpected behaviour*)
  1374 Global_RS();
  1392 Global_RS();
       
  1393 
       
  1394 (* testing access to global struct array *)
       
  1395 Dudiduda[2].FIRSTBYTE := 0;
  1375 ]]></xhtml:p>
  1396 ]]></xhtml:p>
  1376           </ST>
  1397           </ST>
  1377         </body>
  1398         </body>
  1378       </pou>
  1399       </pou>
  1379       <pou name="norm" pouType="function">
  1400       <pou name="norm" pouType="function">
  1440           <variable name="Global_RS">
  1461           <variable name="Global_RS">
  1441             <type>
  1462             <type>
  1442               <derived name="RS"/>
  1463               <derived name="RS"/>
  1443             </type>
  1464             </type>
  1444           </variable>
  1465           </variable>
       
  1466           <variable name="Dudiduda">
       
  1467             <type>
       
  1468               <derived name="blups"/>
       
  1469             </type>
       
  1470           </variable>
  1445           <variable name="TUTU">
  1471           <variable name="TUTU">
  1446             <type>
  1472             <type>
  1447               <INT/>
  1473               <INT/>
  1448             </type>
  1474             </type>
  1449           </variable>
  1475           </variable>