Adding execution order and complex data types
authorlbessard
Sun, 09 Dec 2007 16:59:15 +0100
changeset 126 4a76987f8a40
parent 125 394d9f168258
child 127 436268f31dae
Adding execution order and complex data types
examples/example.xml
--- a/examples/example.xml	Thu Dec 06 18:05:29 2007 +0100
+++ b/examples/example.xml	Sun Dec 09 16:59:15 2007 +0100
@@ -21,7 +21,69 @@
     </coordinateInfo>
   </contentHeader>
   <types>
-    <dataTypes/>
+    <dataTypes>
+      <dataType name="MyType">
+        <baseType>
+          <array>
+            <dimension upper="16" lower="1"/>
+            <dimension upper="2" lower="1"/>
+            <baseType>
+              <INT/>
+            </baseType>
+          </array>
+        </baseType>
+        <initialValue>
+          <arrayValue>
+            <value>
+              <simpleValue value="8([-100"/>
+            </value>
+            <value>
+              <simpleValue value="100])"/>
+            </value>
+            <value>
+              <simpleValue value="8([100"/>
+            </value>
+            <value>
+              <simpleValue value="-100])"/>
+            </value>
+          </arrayValue>
+        </initialValue>
+      </dataType>
+      <dataType name="MyType2">
+        <baseType>
+          <BYTE/>
+        </baseType>
+        <initialValue>
+          <simpleValue value="0"/>
+        </initialValue>
+      </dataType>
+      <dataType name="MyType3">
+        <baseType>
+          <enum>
+            <values>
+              <value name="OPEN"/>
+              <value name="CLOSED"/>
+            </values>
+          </enum>
+        </baseType>
+        <initialValue>
+          <simpleValue value="CLOSED"/>
+        </initialValue>
+      </dataType>
+      <dataType name="MyType4">
+        <baseType>
+          <subrangeSigned>
+            <range upper="4500" lower="-4500"/>
+            <baseType>
+              <DINT/>
+            </baseType>
+          </subrangeSigned>
+        </baseType>
+        <initialValue>
+          <simpleValue value="0"/>
+        </initialValue>
+      </dataType>
+    </dataTypes>
     <pous>
       <pou name="FBDTest" pouType="functionBlock">
         <interface>
@@ -79,7 +141,7 @@
               </connectionPointOut>
               <expression>IN2</expression>
             </inVariable>
-            <outVariable localId="4" width="95" height="33">
+            <outVariable localId="4" width="95" height="33" executionOrderId="2">
               <position y="182" x="587"/>
               <connectionPointIn>
                 <relPosition y="16" x="0"/>
@@ -90,7 +152,7 @@
               </connectionPointIn>
               <expression>OUT</expression>
             </outVariable>
-            <block localId="6" height="84" width="99" typeName="AND">
+            <block localId="6" height="84" width="99" executionOrderId="3" typeName="AND">
               <position y="105" x="235"/>
               <inputVariables>
                 <variable formalParameter="IN1" edge="rising">
@@ -132,7 +194,7 @@
               </connectionPointOut>
               <expression>IN3</expression>
             </inVariable>
-            <block localId="8" height="87" width="99" typeName="OR">
+            <block localId="8" height="87" width="99" executionOrderId="4" typeName="OR">
               <position y="246" x="235"/>
               <inputVariables>
                 <variable formalParameter="IN1" negated="true">
@@ -171,7 +233,7 @@
               <position y="32" x="243"/>
               <content><![CDATA[POU used for testing PLCOpenEditor.]]></content>
             </comment>
-            <block localId="11" height="97" width="105" instanceName="SR1" typeName="SR">
+            <block localId="11" height="97" width="105" executionOrderId="1" instanceName="SR1" typeName="SR">
               <position y="159" x="418"/>
               <inputVariables>
                 <variable formalParameter="S1" negated="true">
@@ -1005,7 +1067,7 @@
   Brakes := TRUE;
 END_IF;
 
-IF (Gate = TRUE) AND
+IF (Gate = open) AND
     (Pump = TRUE) AND (Temp > 200.0) THEN
   Control_State := TRUE;
 ELSE