tests/logging/plc.xml
changeset 917 401e44bae7c0
parent 914 94436558f0ce
child 944 52a17be9c4d1
equal deleted inserted replaced
916:697d8b77d716 917:401e44bae7c0
     6   <fileHeader companyName="Unknown"
     6   <fileHeader companyName="Unknown"
     7               productName="Unnamed"
     7               productName="Unnamed"
     8               productVersion="1"
     8               productVersion="1"
     9               creationDateTime="2013-01-29T14:01:00"/>
     9               creationDateTime="2013-01-29T14:01:00"/>
    10   <contentHeader name="Unnamed"
    10   <contentHeader name="Unnamed"
    11                  modificationDateTime="2013-01-29T21:30:36">
    11                  modificationDateTime="2013-01-30T18:24:53">
    12     <coordinateInfo>
    12     <coordinateInfo>
    13       <fbd>
    13       <fbd>
    14         <scaling x="0" y="0"/>
    14         <scaling x="0" y="0"/>
    15       </fbd>
    15       </fbd>
    16       <ld>
    16       <ld>
    20         <scaling x="0" y="0"/>
    20         <scaling x="0" y="0"/>
    21       </sfc>
    21       </sfc>
    22     </coordinateInfo>
    22     </coordinateInfo>
    23   </contentHeader>
    23   </contentHeader>
    24   <types>
    24   <types>
    25     <dataTypes/>
    25     <dataTypes>
       
    26       <dataType name="LOGLEVEL">
       
    27         <baseType>
       
    28           <enum>
       
    29             <values>
       
    30               <value name="CRITICAL"/>
       
    31               <value name="WARNING"/>
       
    32               <value name="INFO"/>
       
    33               <value name="DEBUG"/>
       
    34             </values>
       
    35           </enum>
       
    36         </baseType>
       
    37         <initialValue>
       
    38           <simpleValue value="INFO"/>
       
    39         </initialValue>
       
    40       </dataType>
       
    41     </dataTypes>
    26     <pous>
    42     <pous>
    27       <pou name="LOGGER" pouType="functionBlock">
    43       <pou name="LOGGER" pouType="functionBlock">
    28         <interface>
    44         <interface>
    29           <inputVars>
    45           <inputVars>
    30             <variable name="TRIG">
    46             <variable name="TRIG">
    34             </variable>
    50             </variable>
    35             <variable name="MSG">
    51             <variable name="MSG">
    36               <type>
    52               <type>
    37                 <string/>
    53                 <string/>
    38               </type>
    54               </type>
       
    55             </variable>
       
    56             <variable name="LEVEL">
       
    57               <type>
       
    58                 <derived name="LOGLEVEL"/>
       
    59               </type>
       
    60               <initialValue>
       
    61                 <simpleValue value="INFO"/>
       
    62               </initialValue>
    39             </variable>
    63             </variable>
    40           </inputVars>
    64           </inputVars>
    41           <localVars>
    65           <localVars>
    42             <variable name="TRIG0">
    66             <variable name="TRIG0">
    43               <type>
    67               <type>
    48         </interface>
    72         </interface>
    49         <body>
    73         <body>
    50           <ST>
    74           <ST>
    51 <![CDATA[IF TRIG AND NOT TRIG0 THEN
    75 <![CDATA[IF TRIG AND NOT TRIG0 THEN
    52 {{
    76 {{
    53  LogMessage(GetFbVar(MSG, .body),GetFbVar(MSG, .len));
    77  LogMessage(GetFbVar(LEVEL),GetFbVar(MSG, .body),GetFbVar(MSG, .len));
    54 }}
    78 }}
    55 END_IF;
    79 END_IF;
    56 TRIG0:=TRIG;
    80 TRIG0:=TRIG;
    57 ]]>
    81 ]]>
    58           </ST>
    82           </ST>
    59         </body>
    83         </body>
    60       </pou>
    84       </pou>
    61       <pou name="program0" pouType="program">
    85       <pou name="program0" pouType="program">
    62         <interface>
    86         <interface>
    63           <localVars>
    87           <localVars>
       
    88             <variable name="beat">
       
    89               <type>
       
    90                 <BOOL/>
       
    91               </type>
       
    92             </variable>
       
    93             <variable name="count">
       
    94               <type>
       
    95                 <INT/>
       
    96               </type>
       
    97             </variable>
    64             <variable name="LOGGER0">
    98             <variable name="LOGGER0">
    65               <type>
    99               <type>
    66                 <derived name="LOGGER"/>
   100                 <derived name="LOGGER"/>
    67               </type>
       
    68             </variable>
       
    69             <variable name="beat">
       
    70               <type>
       
    71                 <BOOL/>
       
    72               </type>
       
    73             </variable>
       
    74             <variable name="count">
       
    75               <type>
       
    76                 <INT/>
       
    77               </type>
   101               </type>
    78             </variable>
   102             </variable>
    79           </localVars>
   103           </localVars>
    80         </interface>
   104         </interface>
    81         <body>
   105         <body>
    82           <FBD>
   106           <FBD>
    83             <block localId="1" width="65" height="71" typeName="LOGGER" instanceName="LOGGER0">
       
    84               <position x="1008" y="64"/>
       
    85               <inputVariables>
       
    86                 <variable formalParameter="TRIG">
       
    87                   <connectionPointIn>
       
    88                     <relPosition x="0" y="32"/>
       
    89                     <connection refLocalId="3" formalParameter="OUT">
       
    90                       <position x="1008" y="96"/>
       
    91                       <position x="640" y="96"/>
       
    92                       <position x="640" y="94"/>
       
    93                       <position x="272" y="94"/>
       
    94                     </connection>
       
    95                   </connectionPointIn>
       
    96                 </variable>
       
    97                 <variable formalParameter="MSG">
       
    98                   <connectionPointIn>
       
    99                     <relPosition x="0" y="57"/>
       
   100                     <connection refLocalId="8" formalParameter="OUT">
       
   101                       <position x="1008" y="121"/>
       
   102                       <position x="970" y="121"/>
       
   103                       <position x="970" y="204"/>
       
   104                       <position x="935" y="204"/>
       
   105                     </connection>
       
   106                   </connectionPointIn>
       
   107                 </variable>
       
   108               </inputVariables>
       
   109               <inOutVariables/>
       
   110               <outputVariables/>
       
   111             </block>
       
   112             <inVariable localId="2" height="27" width="85">
   107             <inVariable localId="2" height="27" width="85">
   113               <position x="732" y="188"/>
   108               <position x="732" y="188"/>
   114               <connectionPointOut>
   109               <connectionPointOut>
   115                 <relPosition x="85" y="13"/>
   110                 <relPosition x="85" y="13"/>
   116               </connectionPointOut>
   111               </connectionPointOut>
   290                     <relPosition x="105" y="30"/>
   285                     <relPosition x="105" y="30"/>
   291                   </connectionPointOut>
   286                   </connectionPointOut>
   292                 </variable>
   287                 </variable>
   293               </outputVariables>
   288               </outputVariables>
   294             </block>
   289             </block>
       
   290             <block localId="11" width="65" height="80" typeName="LOGGER" instanceName="LOGGER0">
       
   291               <position x="1183" y="64"/>
       
   292               <inputVariables>
       
   293                 <variable formalParameter="TRIG">
       
   294                   <connectionPointIn>
       
   295                     <relPosition x="0" y="30"/>
       
   296                     <connection refLocalId="3" formalParameter="OUT">
       
   297                       <position x="1183" y="94"/>
       
   298                       <position x="272" y="94"/>
       
   299                     </connection>
       
   300                   </connectionPointIn>
       
   301                 </variable>
       
   302                 <variable formalParameter="MSG">
       
   303                   <connectionPointIn>
       
   304                     <relPosition x="0" y="50"/>
       
   305                     <connection refLocalId="8" formalParameter="OUT">
       
   306                       <position x="1183" y="114"/>
       
   307                       <position x="979" y="114"/>
       
   308                       <position x="979" y="204"/>
       
   309                       <position x="935" y="204"/>
       
   310                     </connection>
       
   311                   </connectionPointIn>
       
   312                 </variable>
       
   313                 <variable formalParameter="LEVEL">
       
   314                   <connectionPointIn>
       
   315                     <relPosition x="0" y="70"/>
       
   316                   </connectionPointIn>
       
   317                 </variable>
       
   318               </inputVariables>
       
   319               <inOutVariables/>
       
   320               <outputVariables/>
       
   321             </block>
   295           </FBD>
   322           </FBD>
   296         </body>
   323         </body>
   297       </pou>
   324       </pou>
   298     </pous>
   325     </pous>
   299   </types>
   326   </types>