examples/example.xml
changeset 1 e9d01d824086
parent 0 b622defdfd98
child 2 93bc4c2cf376
equal deleted inserted replaced
0:b622defdfd98 1:e9d01d824086
   133               <connectionPointOut>
   133               <connectionPointOut>
   134                 <relPosition y="14" x="90"/>
   134                 <relPosition y="14" x="90"/>
   135               </connectionPointOut>
   135               </connectionPointOut>
   136               <expression>IN3</expression>
   136               <expression>IN3</expression>
   137             </inVariable>
   137             </inVariable>
   138             <block localId="8" height="87" width="99" instanceName="" typeName="OR">
   138             <block localId="8" height="87" width="99" typeName="OR">
   139               <position y="246" x="235"/>
   139               <position y="246" x="235"/>
   140               <inputVariables>
   140               <inputVariables>
   141                 <variable formalParameter="IN1" negated="true">
   141                 <variable formalParameter="IN1" negated="true">
   142                   <connectionPointIn>
   142                   <connectionPointIn>
   143                     <relPosition y="36" x="0"/>
   143                     <relPosition y="36" x="0"/>
   347       <pou name="ILTest" pouType="function">
   347       <pou name="ILTest" pouType="function">
   348         <interface>
   348         <interface>
   349           <returnType>
   349           <returnType>
   350             <REAL/>
   350             <REAL/>
   351           </returnType>
   351           </returnType>
       
   352           <inputVars>
       
   353             <variable name="X1">
       
   354               <type>
       
   355                 <REAL/>
       
   356               </type>
       
   357             </variable>
       
   358           </inputVars>
   352           <localVars>
   359           <localVars>
   353             <variable name="Temp">
   360             <variable name="Temp">
   354               <type>
   361               <type>
   355                 <REAL/>
   362                 <REAL/>
   356               </type>
   363               </type>
   357             </variable>
   364             </variable>
   358           </localVars>
   365           </localVars>
   359           <inputVars>
   366           <inputVars>
   360             <variable name="X1">
       
   361               <type>
       
   362                 <REAL/>
       
   363               </type>
       
   364             </variable>
       
   365             <variable name="X2">
   367             <variable name="X2">
   366               <type>
   368               <type>
   367                 <REAL/>
   369                 <REAL/>
   368               </type>
   370               </type>
   369             </variable>
   371             </variable>
   391             </variable>
   393             </variable>
   392           </outputVars>
   394           </outputVars>
   393         </interface>
   395         </interface>
   394         <body>
   396         <body>
   395           <IL>
   397           <IL>
   396   LD   Y1
   398 LD   Y1
   397   SUB  Y2     (* Substract Y2 from Y1 *)
   399 SUB  Y2     (* Substract Y2 from Y1 *)
   398   ST   Temp   (* Store Y1-Y2 in Temp *)
   400 ST   Temp   (* Store Y1-Y2 in Temp *)
   399   MUL  Temp   (* Multiply by Temp to square *)
   401 MUL  Temp   (* Multiply by Temp to square *)
   400   ADD( X1     (* Defer ADD *)
   402 ADD( X1     (* Defer ADD *)
   401   SUB  X2     (* Substract X1 from X2 *)
   403 SUB  X2     (* Substract X1 from X2 *)
   402   ST   Temp   (* Store X1-X2 in Temp *)
   404 ST   Temp   (* Store X1-X2 in Temp *)
   403   MUL  Temp   (* Multiply by Temp to square *)
   405 MUL  Temp   (* Multiply by Temp to square *)
   404   )
   406 )
   405   CAL  SQRT   (* Call Square root fun *)
   407 CAL  SQRT   (* Call Square root fun *)
   406   ST   ILTest (* Setup function result *)
   408 ST   ILTest (* Setup function result *)
   407   GT   TMax   (* Greater than TMax ? *)
   409 GT   TMax   (* Greater than TMax ? *)
   408   JMPC ERR    (* Yes, Jump to Error *)
   410 JMPC ERR    (* Yes, Jump to Error *)
   409   S    ENO    (* Set ENO *)
   411 S    ENO    (* Set ENO *)
   410   RET         (* Normal return *)
   412 RET         (* Normal return *)
   411 
   413 
   412   ERR:
   414 ERR:
   413   RET         (* Error return, ENO not set *)
   415 RET         (* Error return, ENO not set *)
   414           </IL>
   416           </IL>
   415         </body>
   417         </body>
   416       </pou>
   418       </pou>
   417       <pou name="SFCTest" pouType="program">
   419       <pou name="SFCTest" pouType="program">
   418         <interface>
   420         <interface>
   446         </interface>
   448         </interface>
   447         <actions>
   449         <actions>
   448           <action name="ACT1">
   450           <action name="ACT1">
   449             <body>
   451             <body>
   450               <ST>
   452               <ST>
   451   IF IN1 THEN
   453 IF IN1 THEN
   452     IN2 := 1;
   454 	IN2 := 1;
   453   ELSE
   455 ELSE
   454     IN3 := 1;
   456 	IN3 := 1;
   455   END_IF;
   457 END_IF;
   456               </ST>
   458               </ST>
   457             </body>
   459             </body>
   458           </action>
   460           </action>
   459         </actions>
   461         </actions>
   460         <transitions>
   462         <transitions>
   724                   <position y="369" x="316"/>
   726                   <position y="369" x="316"/>
   725                   <position y="344" x="316"/>
   727                   <position y="344" x="316"/>
   726                 </connection>
   728                 </connection>
   727               </connectionPointIn>
   729               </connectionPointIn>
   728             </jumpStep>
   730             </jumpStep>
   729             <actionBlock localId="20" height="60" width="100">
   731             <actionBlock localId="20" height="60" width="181">
   730               <position y="232" x="441"/>
   732               <position y="232" x="441"/>
   731               <connectionPointIn>
   733               <connectionPointIn>
   732                 <relPosition y="15" x="0"/>
   734                 <relPosition y="15" x="0"/>
   733                 <connection refLocalId="10">
   735                 <connection refLocalId="10">
   734                   <position y="247" x="441"/>
   736                   <position y="247" x="441"/>
   735                   <position y="247" x="416"/>
   737                   <position y="247" x="416"/>
   736                 </connection>
   738                 </connection>
   737               </connectionPointIn>
   739               </connectionPointIn>
   738               <action qualifier="N">
   740               <action indicator="IN5" qualifier="N">
   739                 <reference name="ACT1"/>
   741                 <reference name="ACT1"/>
   740               </action>
   742               </action>
   741               <action qualifier="S">
   743               <action qualifier="D" duration="10s">
   742                 <reference name="IN1"/>
   744                 <reference name="IN1"/>
   743               </action>
   745               </action>
   744             </actionBlock>
   746             </actionBlock>
   745           </SFC>
   747           </SFC>
   746         </body>
   748         </body>
   792             </variable>
   794             </variable>
   793           </outputVars>
   795           </outputVars>
   794         </interface>
   796         </interface>
   795         <body>
   797         <body>
   796           <ST>
   798           <ST>
   797   IF Collision THEN
   799 IF Collision THEN
   798     Speed := 0;
   800 	Speed := 0;
   799     Brakes := ON;
   801 	Brakes := ON;
   800   END_IF;
   802 END_IF;
   801 
   803 
   802   IF (Gate = CLOSED) AND
   804 IF (Gate = CLOSED) AND
   803       (Pump = ON) AND (Temp > 200.0) THEN
   805 		(Pump = ON) AND (Temp > 200.0) THEN
   804     Control_State := Active;
   806 	Control_State := Active;
   805   ELSE
   807 ELSE
   806     Control_State := Hold;
   808 	Control_State := Hold;
   807     PumpSpeed := 10.0;
   809 	PumpSpeed := 10.0;
   808   END_IF;
   810 END_IF;
   809           </ST>
   811           </ST>
   810         </body>
   812         </body>
   811       </pou>
   813       </pou>
   812     </pous>
   814     </pous>
   813   </types>
   815   </types>