tests/python/plc.xml
changeset 2680 6bfed6757495
parent 2626 39d78c530cbb
child 2692 d4bede6cd3f1
equal deleted inserted replaced
2679:2783906d5792 2680:6bfed6757495
     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="2019-09-24T11:49:14">
     4   <contentHeader name="Beremiz Python Support Tests" modificationDateTime="2020-06-17T13:19: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>
   244             <variable name="Second_Python_Var">
   244             <variable name="Second_Python_Var">
   245               <type>
   245               <type>
   246                 <INT/>
   246                 <INT/>
   247               </type>
   247               </type>
   248             </variable>
   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>
   249           </externalVars>
   268           </externalVars>
   250         </interface>
   269         </interface>
   251         <body>
   270         <body>
   252           <FBD>
   271           <FBD>
   253             <inVariable localId="4" height="30" width="160" executionOrderId="0" negated="false">
   272             <inVariable localId="4" height="30" width="160" executionOrderId="0" negated="false">
   254               <position x="295" y="450"/>
   273               <position x="295" y="450"/>
   255               <connectionPointOut>
   274               <connectionPointOut>
   256                 <relPosition x="160" y="15"/>
   275                 <relPosition x="160" y="15"/>
   257               </connectionPointOut>
   276               </connectionPointOut>
   258               <expression>'time.sleep(1)'</expression>
   277               <expression>'666'</expression>
   259             </inVariable>
   278             </inVariable>
   260             <block localId="5" width="125" height="80" typeName="python_eval" instanceName="py1" executionOrderId="0">
   279             <block localId="5" width="125" height="80" typeName="python_eval" instanceName="py1" executionOrderId="0">
   261               <position x="686" y="400"/>
   280               <position x="686" y="400"/>
   262               <inputVariables>
   281               <inputVariables>
   263                 <variable formalParameter="TRIG">
   282                 <variable formalParameter="TRIG">
  1116               <connectionPointOut>
  1135               <connectionPointOut>
  1117                 <relPosition x="146" y="16"/>
  1136                 <relPosition x="146" y="16"/>
  1118               </connectionPointOut>
  1137               </connectionPointOut>
  1119               <expression>Second_Python_Var</expression>
  1138               <expression>Second_Python_Var</expression>
  1120             </inVariable>
  1139             </inVariable>
  1121             <outVariable localId="47" height="30" width="130" executionOrderId="0" negated="false">
       
  1122               <position x="200" y="1385"/>
       
  1123               <connectionPointIn>
       
  1124                 <relPosition x="0" y="15"/>
       
  1125                 <connection refLocalId="59">
       
  1126                   <position x="200" y="1400"/>
       
  1127                   <position x="130" y="1400"/>
       
  1128                 </connection>
       
  1129               </connectionPointIn>
       
  1130               <expression>Test_Python_Var</expression>
       
  1131             </outVariable>
       
  1132             <inVariable localId="59" height="30" width="30" executionOrderId="0" negated="false">
  1140             <inVariable localId="59" height="30" width="30" executionOrderId="0" negated="false">
  1133               <position x="100" y="1385"/>
  1141               <position x="100" y="1385"/>
  1134               <connectionPointOut>
  1142               <connectionPointOut>
  1135                 <relPosition x="30" y="15"/>
  1143                 <relPosition x="30" y="15"/>
  1136               </connectionPointOut>
  1144               </connectionPointOut>
  1137               <expression>23</expression>
  1145               <expression>1</expression>
  1138             </inVariable>
  1146             </inVariable>
  1139             <block localId="61" typeName="function0" executionOrderId="0" height="45" width="111">
  1147             <block localId="61" typeName="function0" executionOrderId="0" height="45" width="111">
  1140               <position x="760" y="1170"/>
  1148               <position x="760" y="1170"/>
  1141               <inputVariables>
  1149               <inputVariables>
  1142                 <variable formalParameter="LocalVar0">
  1150                 <variable formalParameter="LocalVar0">
  1298    5. How to avoid race conditions between IEC, C and python code.
  1306    5. How to avoid race conditions between IEC, C and python code.
  1299    6. How to convert betweet different IEC types.
  1307    6. How to convert betweet different IEC types.
  1300 ]]></xhtml:p>
  1308 ]]></xhtml:p>
  1301               </content>
  1309               </content>
  1302             </comment>
  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>
  1303           </FBD>
  1467           </FBD>
  1304         </body>
  1468         </body>
  1305       </pou>
  1469       </pou>
  1306       <pou name="C_Pragma" pouType="functionBlock">
  1470       <pou name="C_Pragma" pouType="functionBlock">
  1307         <interface>
  1471         <interface>
  1445   </types>
  1609   </types>
  1446   <instances>
  1610   <instances>
  1447     <configurations>
  1611     <configurations>
  1448       <configuration name="config">
  1612       <configuration name="config">
  1449         <resource name="res_pytest">
  1613         <resource name="res_pytest">
  1450           <task name="pytest_task" interval="T#1ms" priority="0"/>
  1614           <task name="pytest_task" priority="0" interval="T#500ms"/>
  1451           <globalVars>
  1615           <globalVars>
  1452             <variable name="TOTO">
  1616             <variable name="TOTO">
  1453               <type>
  1617               <type>
  1454                 <INT/>
  1618                 <INT/>
  1455               </type>
  1619               </type>