Changes in the std library + std lib PLCOpen test (broken)
authoretisserant
Thu, 12 Jul 2007 11:27:43 +0200
changeset 36 e7d67b27877f
parent 35 d0ee8397dc4c
child 37 256eedd275d0
Changes in the std library + std lib PLCOpen test (broken)
examples/STD_TEST.xml
generate_IEC_std.py
plcopen/iec_std.csv
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/STD_TEST.xml	Thu Jul 12 11:27:43 2007 +0200
@@ -0,0 +1,1331 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://www.plcopen.org/xml/tc6.xsd"
+         xmlns:xhtml="http://www.w3.org/1999/xhtml"
+         xsi:schemaLocation="http://www.plcopen.org/xml/tc6.xsd http://www.plcopen.org/xml/tc6.xsd">
+  <fileHeader contentDescription="This tests as most as possible IEC standard library"
+              companyName="LOLITECH"
+              companyURL="www.lolitech.com"
+              productName="BREMIZ"
+              productRelease="1"
+              productVersion="1"
+              creationDateTime="2007-07-07 11:58:26"/>
+  <contentHeader name="STD_TEST">
+    <coordinateInfo>
+      <fbd>
+        <scaling y="0" x="0"/>
+      </fbd>
+      <ld>
+        <scaling y="0" x="0"/>
+      </ld>
+      <sfc>
+        <scaling y="0" x="0"/>
+      </sfc>
+    </coordinateInfo>
+  </contentHeader>
+  <types>
+    <dataTypes/>
+    <pous>
+      <pou name="TEST_STRINGS" pouType="functionBlock">
+        <interface>
+          <inputVars>
+            <variable name="IN1">
+              <type>
+                <STRING/>
+              </type>
+            </variable>
+            <variable name="IN2">
+              <type>
+                <STRING/>
+              </type>
+            </variable>
+            <variable name="IN3">
+              <type>
+                <STRING/>
+              </type>
+            </variable>
+            <variable name="TESTNR">
+              <type>
+                <INT/>
+              </type>
+            </variable>
+          </inputVars>
+          <outputVars>
+            <variable name="STRRES">
+              <type>
+                <STRING/>
+              </type>
+            </variable>
+            <variable name="INTRES">
+              <type>
+                <INT/>
+              </type>
+            </variable>
+          </outputVars>
+          <inputVars>
+            <variable name="K">
+              <type>
+                <INT/>
+              </type>
+            </variable>
+            <variable name="P">
+              <type>
+                <INT/>
+              </type>
+            </variable>
+            <variable name="L">
+              <type>
+                <INT/>
+              </type>
+            </variable>
+          </inputVars>
+        </interface>
+        <body>
+          <FBD>
+            <block localId="1" height="242" width="93" typeName="MUX">
+              <position y="240" x="696"/>
+              <inputVariables>
+                <variable formalParameter="K">
+                  <connectionPointIn>
+                    <relPosition y="30" x="0"/>
+                    <connection refLocalId="6" formalParameter="K">
+                      <position y="270" x="696"/>
+                      <position y="270" x="455"/>
+                      <position y="256" x="455"/>
+                      <position y="256" x="331"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN0">
+                  <connectionPointIn>
+                    <relPosition y="50" x="0"/>
+                    <connection refLocalId="20" formalParameter="IN0">
+                      <position y="290" x="696"/>
+                      <position y="290" x="444"/>
+                      <position y="300" x="444"/>
+                      <position y="300" x="258"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN1">
+                  <connectionPointIn>
+                    <relPosition y="70" x="0"/>
+                    <connection refLocalId="21" formalParameter="IN1">
+                      <position y="310" x="696"/>
+                      <position y="310" x="467"/>
+                      <position y="331" x="467"/>
+                      <position y="331" x="257"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN2">
+                  <connectionPointIn>
+                    <relPosition y="90" x="0"/>
+                    <connection refLocalId="22" formalParameter="IN2">
+                      <position y="330" x="696"/>
+                      <position y="330" x="492"/>
+                      <position y="368" x="492"/>
+                      <position y="368" x="208"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN3">
+                  <connectionPointIn>
+                    <relPosition y="110" x="0"/>
+                    <connection refLocalId="27" formalParameter="IN3">
+                      <position y="350" x="696"/>
+                      <position y="350" x="510"/>
+                      <position y="415" x="510"/>
+                      <position y="415" x="360"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN4">
+                  <connectionPointIn>
+                    <relPosition y="130" x="0"/>
+                    <connection refLocalId="31" formalParameter="IN4">
+                      <position y="370" x="696"/>
+                      <position y="370" x="528"/>
+                      <position y="504" x="528"/>
+                      <position y="504" x="341"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN5">
+                  <connectionPointIn>
+                    <relPosition y="150" x="0"/>
+                    <connection refLocalId="34" formalParameter="IN5">
+                      <position y="390" x="696"/>
+                      <position y="390" x="543"/>
+                      <position y="580" x="543"/>
+                      <position y="580" x="338"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN6">
+                  <connectionPointIn>
+                    <relPosition y="170" x="0"/>
+                    <connection refLocalId="39" formalParameter="IN6">
+                      <position y="410" x="696"/>
+                      <position y="410" x="562"/>
+                      <position y="690" x="562"/>
+                      <position y="690" x="352"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN7">
+                  <connectionPointIn>
+                    <relPosition y="190" x="0"/>
+                    <connection refLocalId="46" formalParameter="IN7">
+                      <position y="430" x="696"/>
+                      <position y="430" x="587"/>
+                      <position y="789" x="587"/>
+                      <position y="789" x="319"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN8">
+                  <connectionPointIn>
+                    <relPosition y="210" x="0"/>
+                    <connection refLocalId="48" formalParameter="IN8">
+                      <position y="450" x="696"/>
+                      <position y="450" x="605"/>
+                      <position y="885" x="605"/>
+                      <position y="885" x="309"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN9">
+                  <connectionPointIn>
+                    <relPosition y="230" x="0"/>
+                    <connection refLocalId="52" formalParameter="IN9">
+                      <position y="470" x="696"/>
+                      <position y="470" x="625"/>
+                      <position y="1040" x="625"/>
+                      <position y="1040" x="318"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="30" x="93"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <outVariable localId="2" width="105" height="61">
+              <position y="245" x="843"/>
+              <connectionPointIn>
+                <relPosition y="30" x="0"/>
+                <connection refLocalId="1">
+                  <position y="275" x="843"/>
+                  <position y="275" x="825"/>
+                  <position y="270" x="825"/>
+                  <position y="270" x="789"/>
+                </connection>
+              </connectionPointIn>
+              <expression>STRRES</expression>
+            </outVariable>
+            <inVariable localId="6" width="59" height="27">
+              <position y="243" x="272"/>
+              <connectionPointOut>
+                <relPosition y="13" x="59"/>
+              </connectionPointOut>
+              <expression>TESTNR</expression>
+            </inVariable>
+            <block localId="7" height="88" width="135" typeName="STRING_TO_INT">
+              <position y="718" x="1024"/>
+              <inputVariables>
+                <variable formalParameter="IN">
+                  <connectionPointIn>
+                    <relPosition y="54" x="0"/>
+                    <connection refLocalId="25" formalParameter="IN">
+                      <position y="772" x="1024"/>
+                      <position y="772" x="1006"/>
+                      <position y="771" x="1006"/>
+                      <position y="771" x="989"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="54" x="135"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <outVariable localId="8" width="92" height="47">
+              <position y="533" x="1459"/>
+              <connectionPointIn>
+                <relPosition y="23" x="0"/>
+                <connection refLocalId="16">
+                  <position y="556" x="1459"/>
+                  <position y="556" x="1442"/>
+                  <position y="563" x="1442"/>
+                  <position y="563" x="1425"/>
+                </connection>
+              </connectionPointIn>
+              <expression>INTRES</expression>
+            </outVariable>
+            <block localId="9" height="99" width="120" typeName="STRING_TO_REAL">
+              <position y="607" x="798"/>
+              <inputVariables>
+                <variable formalParameter="IN">
+                  <connectionPointIn>
+                    <relPosition y="59" x="0"/>
+                    <connection refLocalId="23" formalParameter="IN">
+                      <position y="666" x="798"/>
+                      <position y="666" x="772"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="59" x="120"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <block localId="11" height="114" width="115" typeName="LEN">
+              <position y="524" x="958"/>
+              <inputVariables>
+                <variable formalParameter="IN">
+                  <connectionPointIn>
+                    <relPosition y="67" x="0"/>
+                    <connection refLocalId="24" formalParameter="IN">
+                      <position y="591" x="958"/>
+                      <position y="591" x="937"/>
+                      <position y="579" x="937"/>
+                      <position y="579" x="916"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="67" x="115"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <block localId="16" height="240" width="107" typeName="MUX">
+              <position y="521" x="1318"/>
+              <inputVariables>
+                <variable formalParameter="K">
+                  <connectionPointIn>
+                    <relPosition y="42" x="0"/>
+                    <connection refLocalId="60" formalParameter="K">
+                      <position y="563" x="1318"/>
+                      <position y="563" x="1275"/>
+                      <position y="501" x="1275"/>
+                      <position y="501" x="1247"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN0">
+                  <connectionPointIn>
+                    <relPosition y="86" x="0"/>
+                    <connection refLocalId="11" formalParameter="IN0">
+                      <position y="607" x="1318"/>
+                      <position y="607" x="1195"/>
+                      <position y="591" x="1195"/>
+                      <position y="591" x="1073"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN1">
+                  <connectionPointIn>
+                    <relPosition y="130" x="0"/>
+                    <connection refLocalId="19" formalParameter="IN1">
+                      <position y="651" x="1318"/>
+                      <position y="651" x="1251"/>
+                      <position y="668" x="1251"/>
+                      <position y="668" x="1184"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN2">
+                  <connectionPointIn>
+                    <relPosition y="174" x="0"/>
+                    <connection refLocalId="7" formalParameter="IN2">
+                      <position y="695" x="1318"/>
+                      <position y="695" x="1238"/>
+                      <position y="772" x="1238"/>
+                      <position y="772" x="1159"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN3">
+                  <connectionPointIn>
+                    <relPosition y="218" x="0"/>
+                    <connection refLocalId="57" formalParameter="IN3">
+                      <position y="739" x="1318"/>
+                      <position y="739" x="1265"/>
+                      <position y="851" x="1265"/>
+                      <position y="851" x="1105"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="42" x="107"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <block localId="17" height="60" width="100" typeName="MUL">
+              <position y="646" x="953"/>
+              <inputVariables>
+                <variable formalParameter="IN1">
+                  <connectionPointIn>
+                    <relPosition y="30" x="0"/>
+                    <connection refLocalId="9" formalParameter="IN1">
+                      <position y="676" x="953"/>
+                      <position y="676" x="930"/>
+                      <position y="666" x="930"/>
+                      <position y="666" x="918"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN2">
+                  <connectionPointIn>
+                    <relPosition y="50" x="0"/>
+                    <connection refLocalId="64">
+                      <position y="696" x="953"/>
+                      <position y="696" x="938"/>
+                      <position y="728" x="938"/>
+                      <position y="728" x="876"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="30" x="100"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <block localId="19" height="43" width="97" typeName="REAL_TO_INT">
+              <position y="637" x="1087"/>
+              <inputVariables>
+                <variable formalParameter="IN">
+                  <connectionPointIn>
+                    <relPosition y="31" x="0"/>
+                    <connection refLocalId="17" formalParameter="IN">
+                      <position y="668" x="1087"/>
+                      <position y="668" x="1070"/>
+                      <position y="676" x="1070"/>
+                      <position y="676" x="1053"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="31" x="97"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="20" width="31" height="27">
+              <position y="287" x="227"/>
+              <connectionPointOut>
+                <relPosition y="13" x="31"/>
+              </connectionPointOut>
+              <expression>IN1</expression>
+            </inVariable>
+            <inVariable localId="21" width="32" height="29">
+              <position y="317" x="225"/>
+              <connectionPointOut>
+                <relPosition y="14" x="32"/>
+              </connectionPointOut>
+              <expression>IN2</expression>
+            </inVariable>
+            <inVariable localId="22" width="48" height="29">
+              <position y="354" x="160"/>
+              <connectionPointOut>
+                <relPosition y="14" x="48"/>
+              </connectionPointOut>
+              <expression>IN3</expression>
+            </inVariable>
+            <inVariable localId="23" width="89" height="30">
+              <position y="651" x="683"/>
+              <connectionPointOut>
+                <relPosition y="15" x="89"/>
+              </connectionPointOut>
+              <expression>IN1</expression>
+            </inVariable>
+            <inVariable localId="24" width="75" height="33">
+              <position y="563" x="841"/>
+              <connectionPointOut>
+                <relPosition y="16" x="75"/>
+              </connectionPointOut>
+              <expression>IN1</expression>
+            </inVariable>
+            <inVariable localId="25" width="71" height="29">
+              <position y="757" x="918"/>
+              <connectionPointOut>
+                <relPosition y="14" x="71"/>
+              </connectionPointOut>
+              <expression>IN1</expression>
+            </inVariable>
+            <block localId="27" height="61" width="75" typeName="LEFT">
+              <position y="385" x="285"/>
+              <inputVariables>
+                <variable formalParameter="IN">
+                  <connectionPointIn>
+                    <relPosition y="30" x="0"/>
+                    <connection refLocalId="28" formalParameter="IN">
+                      <position y="415" x="285"/>
+                      <position y="415" x="264"/>
+                      <position y="407" x="264"/>
+                      <position y="407" x="193"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="L">
+                  <connectionPointIn>
+                    <relPosition y="50" x="0"/>
+                    <connection refLocalId="29" formalParameter="L">
+                      <position y="435" x="285"/>
+                      <position y="435" x="265"/>
+                      <position y="445" x="265"/>
+                      <position y="445" x="181"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="30" x="75"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="28" width="35" height="30">
+              <position y="392" x="158"/>
+              <connectionPointOut>
+                <relPosition y="15" x="35"/>
+              </connectionPointOut>
+              <expression>IN1</expression>
+            </inVariable>
+            <inVariable localId="29" width="21" height="27">
+              <position y="432" x="160"/>
+              <connectionPointOut>
+                <relPosition y="13" x="21"/>
+              </connectionPointOut>
+              <expression>L</expression>
+            </inVariable>
+            <block localId="31" height="60" width="55" typeName="RIGHT">
+              <position y="474" x="286"/>
+              <inputVariables>
+                <variable formalParameter="IN">
+                  <connectionPointIn>
+                    <relPosition y="30" x="0"/>
+                    <connection refLocalId="32" formalParameter="IN">
+                      <position y="504" x="286"/>
+                      <position y="504" x="261"/>
+                      <position y="489" x="261"/>
+                      <position y="489" x="237"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="L">
+                  <connectionPointIn>
+                    <relPosition y="50" x="0"/>
+                    <connection refLocalId="33" formalParameter="L">
+                      <position y="524" x="286"/>
+                      <position y="524" x="250"/>
+                      <position y="537" x="250"/>
+                      <position y="537" x="215"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="30" x="55"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="32" width="31" height="28">
+              <position y="475" x="206"/>
+              <connectionPointOut>
+                <relPosition y="14" x="31"/>
+              </connectionPointOut>
+              <expression>IN1</expression>
+            </inVariable>
+            <inVariable localId="33" width="17" height="27">
+              <position y="524" x="198"/>
+              <connectionPointOut>
+                <relPosition y="13" x="17"/>
+              </connectionPointOut>
+              <expression>L</expression>
+            </inVariable>
+            <block localId="34" height="80" width="55" typeName="MID">
+              <position y="550" x="283"/>
+              <inputVariables>
+                <variable formalParameter="IN">
+                  <connectionPointIn>
+                    <relPosition y="30" x="0"/>
+                    <connection refLocalId="35" formalParameter="IN">
+                      <position y="580" x="283"/>
+                      <position y="580" x="258"/>
+                      <position y="576" x="258"/>
+                      <position y="576" x="234"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="L">
+                  <connectionPointIn>
+                    <relPosition y="50" x="0"/>
+                    <connection refLocalId="38" formalParameter="L">
+                      <position y="600" x="283"/>
+                      <position y="600" x="232"/>
+                      <position y="594" x="232"/>
+                      <position y="594" x="182"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="P">
+                  <connectionPointIn>
+                    <relPosition y="70" x="0"/>
+                    <connection refLocalId="37" formalParameter="P">
+                      <position y="620" x="283"/>
+                      <position y="620" x="255"/>
+                      <position y="616" x="255"/>
+                      <position y="616" x="227"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="30" x="55"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="35" width="31" height="27">
+              <position y="563" x="203"/>
+              <connectionPointOut>
+                <relPosition y="13" x="31"/>
+              </connectionPointOut>
+              <expression>IN1</expression>
+            </inVariable>
+            <inVariable localId="37" width="18" height="27">
+              <position y="603" x="209"/>
+              <connectionPointOut>
+                <relPosition y="13" x="18"/>
+              </connectionPointOut>
+              <expression>P</expression>
+            </inVariable>
+            <inVariable localId="38" width="17" height="27">
+              <position y="581" x="165"/>
+              <connectionPointOut>
+                <relPosition y="13" x="17"/>
+              </connectionPointOut>
+              <expression>L</expression>
+            </inVariable>
+            <block localId="39" height="83" width="67" typeName="CONCAT">
+              <position y="660" x="285"/>
+              <inputVariables>
+                <variable formalParameter="IN1">
+                  <connectionPointIn>
+                    <relPosition y="30" x="0"/>
+                    <connection refLocalId="40" formalParameter="IN1">
+                      <position y="690" x="285"/>
+                      <position y="690" x="252"/>
+                      <position y="664" x="252"/>
+                      <position y="664" x="219"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN2">
+                  <connectionPointIn>
+                    <relPosition y="51" x="0"/>
+                    <connection refLocalId="41" formalParameter="IN2">
+                      <position y="711" x="285"/>
+                      <position y="711" x="252"/>
+                      <position y="702" x="252"/>
+                      <position y="702" x="220"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN3">
+                  <connectionPointIn>
+                    <relPosition y="72" x="0"/>
+                    <connection refLocalId="42" formalParameter="IN3">
+                      <position y="732" x="285"/>
+                      <position y="732" x="252"/>
+                      <position y="737" x="252"/>
+                      <position y="737" x="219"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="30" x="67"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="40" width="31" height="27">
+              <position y="651" x="188"/>
+              <connectionPointOut>
+                <relPosition y="13" x="31"/>
+              </connectionPointOut>
+              <expression>IN1</expression>
+            </inVariable>
+            <inVariable localId="41" width="31" height="27">
+              <position y="689" x="189"/>
+              <connectionPointOut>
+                <relPosition y="13" x="31"/>
+              </connectionPointOut>
+              <expression>IN2</expression>
+            </inVariable>
+            <inVariable localId="42" width="31" height="27">
+              <position y="724" x="188"/>
+              <connectionPointOut>
+                <relPosition y="13" x="31"/>
+              </connectionPointOut>
+              <expression>IN3</expression>
+            </inVariable>
+            <inVariable localId="44" width="31" height="27">
+              <position y="773" x="182"/>
+              <connectionPointOut>
+                <relPosition y="13" x="31"/>
+              </connectionPointOut>
+              <expression>IN1</expression>
+            </inVariable>
+            <inVariable localId="45" width="31" height="27">
+              <position y="802" x="178"/>
+              <connectionPointOut>
+                <relPosition y="13" x="31"/>
+              </connectionPointOut>
+              <expression>IN2</expression>
+            </inVariable>
+            <block localId="46" height="80" width="63" typeName="INSERT">
+              <position y="759" x="256"/>
+              <inputVariables>
+                <variable formalParameter="IN1">
+                  <connectionPointIn>
+                    <relPosition y="30" x="0"/>
+                    <connection refLocalId="44" formalParameter="IN1">
+                      <position y="789" x="256"/>
+                      <position y="789" x="234"/>
+                      <position y="786" x="234"/>
+                      <position y="786" x="213"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN2">
+                  <connectionPointIn>
+                    <relPosition y="50" x="0"/>
+                    <connection refLocalId="45" formalParameter="IN2">
+                      <position y="809" x="256"/>
+                      <position y="809" x="232"/>
+                      <position y="815" x="232"/>
+                      <position y="815" x="209"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="P">
+                  <connectionPointIn>
+                    <relPosition y="70" x="0"/>
+                    <connection refLocalId="47" formalParameter="P">
+                      <position y="829" x="256"/>
+                      <position y="829" x="228"/>
+                      <position y="852" x="228"/>
+                      <position y="852" x="200"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="30" x="63"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="47" width="18" height="27">
+              <position y="839" x="182"/>
+              <connectionPointOut>
+                <relPosition y="13" x="18"/>
+              </connectionPointOut>
+              <expression>P</expression>
+            </inVariable>
+            <block localId="48" height="80" width="58" typeName="DELETE">
+              <position y="855" x="251"/>
+              <inputVariables>
+                <variable formalParameter="IN">
+                  <connectionPointIn>
+                    <relPosition y="30" x="0"/>
+                    <connection refLocalId="49" formalParameter="IN">
+                      <position y="885" x="251"/>
+                      <position y="885" x="228"/>
+                      <position y="892" x="228"/>
+                      <position y="892" x="205"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="L">
+                  <connectionPointIn>
+                    <relPosition y="50" x="0"/>
+                    <connection refLocalId="50" formalParameter="L">
+                      <position y="905" x="251"/>
+                      <position y="905" x="226"/>
+                      <position y="927" x="226"/>
+                      <position y="927" x="202"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="P">
+                  <connectionPointIn>
+                    <relPosition y="70" x="0"/>
+                    <connection refLocalId="51" formalParameter="P">
+                      <position y="925" x="251"/>
+                      <position y="925" x="233"/>
+                      <position y="968" x="233"/>
+                      <position y="968" x="216"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="30" x="58"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="49" width="31" height="27">
+              <position y="879" x="174"/>
+              <connectionPointOut>
+                <relPosition y="13" x="31"/>
+              </connectionPointOut>
+              <expression>IN1</expression>
+            </inVariable>
+            <inVariable localId="50" width="17" height="27">
+              <position y="914" x="185"/>
+              <connectionPointOut>
+                <relPosition y="13" x="17"/>
+              </connectionPointOut>
+              <expression>L</expression>
+            </inVariable>
+            <inVariable localId="51" width="18" height="27">
+              <position y="955" x="198"/>
+              <connectionPointOut>
+                <relPosition y="13" x="18"/>
+              </connectionPointOut>
+              <expression>P</expression>
+            </inVariable>
+            <block localId="52" height="100" width="67" typeName="REPLACE">
+              <position y="1010" x="251"/>
+              <inputVariables>
+                <variable formalParameter="IN1">
+                  <connectionPointIn>
+                    <relPosition y="30" x="0"/>
+                    <connection refLocalId="53" formalParameter="IN1">
+                      <position y="1040" x="251"/>
+                      <position y="1040" x="227"/>
+                      <position y="1025" x="227"/>
+                      <position y="1025" x="203"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN2">
+                  <connectionPointIn>
+                    <relPosition y="50" x="0"/>
+                    <connection refLocalId="54" formalParameter="IN2">
+                      <position y="1060" x="251"/>
+                      <position y="1060" x="220"/>
+                      <position y="1055" x="220"/>
+                      <position y="1055" x="190"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="L">
+                  <connectionPointIn>
+                    <relPosition y="70" x="0"/>
+                    <connection refLocalId="55">
+                      <position y="1080" x="251"/>
+                      <position y="1080" x="224"/>
+                      <position y="1096" x="224"/>
+                      <position y="1096" x="197"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="P">
+                  <connectionPointIn>
+                    <relPosition y="90" x="0"/>
+                    <connection refLocalId="56" formalParameter="P">
+                      <position y="1100" x="251"/>
+                      <position y="1100" x="219"/>
+                      <position y="1134" x="219"/>
+                      <position y="1134" x="187"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="30" x="67"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="53" width="31" height="27">
+              <position y="1012" x="172"/>
+              <connectionPointOut>
+                <relPosition y="13" x="31"/>
+              </connectionPointOut>
+              <expression>IN1</expression>
+            </inVariable>
+            <inVariable localId="54" width="31" height="27">
+              <position y="1042" x="159"/>
+              <connectionPointOut>
+                <relPosition y="13" x="31"/>
+              </connectionPointOut>
+              <expression>IN2</expression>
+            </inVariable>
+            <inVariable localId="55" width="31" height="27">
+              <position y="1083" x="166"/>
+              <connectionPointOut>
+                <relPosition y="13" x="31"/>
+              </connectionPointOut>
+              <expression>L</expression>
+            </inVariable>
+            <inVariable localId="56" width="18" height="27">
+              <position y="1121" x="169"/>
+              <connectionPointOut>
+                <relPosition y="13" x="18"/>
+              </connectionPointOut>
+              <expression>P</expression>
+            </inVariable>
+            <block localId="57" height="60" width="63" typeName="FIND">
+              <position y="821" x="1042"/>
+              <inputVariables>
+                <variable formalParameter="IN1">
+                  <connectionPointIn>
+                    <relPosition y="30" x="0"/>
+                    <connection refLocalId="58" formalParameter="IN1">
+                      <position y="851" x="1042"/>
+                      <position y="851" x="1028"/>
+                      <position y="839" x="1028"/>
+                      <position y="839" x="1004"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN2">
+                  <connectionPointIn>
+                    <relPosition y="50" x="0"/>
+                    <connection refLocalId="59" formalParameter="IN2">
+                      <position y="871" x="1042"/>
+                      <position y="871" x="1028"/>
+                      <position y="874" x="1028"/>
+                      <position y="874" x="1005"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="30" x="63"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="58" width="31" height="27">
+              <position y="826" x="973"/>
+              <connectionPointOut>
+                <relPosition y="13" x="31"/>
+              </connectionPointOut>
+              <expression>IN1</expression>
+            </inVariable>
+            <inVariable localId="59" width="31" height="27">
+              <position y="861" x="974"/>
+              <connectionPointOut>
+                <relPosition y="13" x="31"/>
+              </connectionPointOut>
+              <expression>IN2</expression>
+            </inVariable>
+            <block localId="60" height="80" width="63" typeName="LIMIT">
+              <position y="471" x="1184"/>
+              <inputVariables>
+                <variable formalParameter="MN">
+                  <connectionPointIn>
+                    <relPosition y="30" x="0"/>
+                    <connection refLocalId="65">
+                      <position y="501" x="1184"/>
+                      <position y="501" x="1156"/>
+                      <position y="484" x="1156"/>
+                      <position y="484" x="1129"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN">
+                  <connectionPointIn>
+                    <relPosition y="50" x="0"/>
+                    <connection refLocalId="6" formalParameter="IN">
+                      <position y="521" x="1184"/>
+                      <position y="521" x="1093"/>
+                      <position y="223" x="1093"/>
+                      <position y="223" x="454"/>
+                      <position y="256" x="454"/>
+                      <position y="256" x="331"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="MX">
+                  <connectionPointIn>
+                    <relPosition y="70" x="0"/>
+                    <connection refLocalId="62">
+                      <position y="541" x="1184"/>
+                      <position y="541" x="1165"/>
+                      <position y="553" x="1165"/>
+                      <position y="553" x="1146"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="OUT">
+                  <connectionPointOut>
+                    <relPosition y="30" x="63"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="62" width="38" height="27">
+              <position y="540" x="1108"/>
+              <connectionPointOut>
+                <relPosition y="13" x="38"/>
+              </connectionPointOut>
+              <expression>3</expression>
+            </inVariable>
+            <comment localId="63" height="87" width="209">
+              <position y="32" x="34"/>
+              <content>The STRING test machine</content>
+            </comment>
+            <inVariable localId="64" width="28" height="27">
+              <position y="715" x="848"/>
+              <connectionPointOut>
+                <relPosition y="13" x="28"/>
+              </connectionPointOut>
+              <expression>10</expression>
+            </inVariable>
+            <inVariable localId="65" width="18" height="27">
+              <position y="471" x="1111"/>
+              <connectionPointOut>
+                <relPosition y="13" x="18"/>
+              </connectionPointOut>
+              <expression>0</expression>
+            </inVariable>
+          </FBD>
+        </body>
+      </pou>
+      <pou name="MAIN_TEST" pouType="program">
+        <interface>
+          <localVars>
+            <variable name="STR1">
+              <type>
+                <STRING/>
+              </type>
+              <initialValue>
+                <simpleValue value="1.2345"/>
+              </initialValue>
+            </variable>
+            <variable name="STR2">
+              <type>
+                <STRING/>
+              </type>
+              <initialValue>
+                <simpleValue value="4.5678"/>
+              </initialValue>
+            </variable>
+            <variable name="STR3">
+              <type>
+                <STRING/>
+              </type>
+              <initialValue>
+                <simpleValue value="abcdefg"/>
+              </initialValue>
+            </variable>
+            <variable name="INT1">
+              <type>
+                <INT/>
+              </type>
+              <initialValue>
+                <simpleValue value="2"/>
+              </initialValue>
+            </variable>
+            <variable name="INT2">
+              <type>
+                <INT/>
+              </type>
+              <initialValue>
+                <simpleValue value="3"/>
+              </initialValue>
+            </variable>
+            <variable name="INT3">
+              <type>
+                <INT/>
+              </type>
+              <initialValue>
+                <simpleValue value="4"/>
+              </initialValue>
+            </variable>
+          </localVars>
+          <localVars>
+            <variable name="TEST_NB" address="%IW0">
+              <type>
+                <INT/>
+              </type>
+            </variable>
+            <variable name="RES_STR" address="%QB0">
+              <type>
+                <STRING/>
+              </type>
+            </variable>
+            <variable name="RES_INT" address="%QW1">
+              <type>
+                <INT/>
+              </type>
+            </variable>
+          </localVars>
+        </interface>
+        <body>
+          <FBD>
+            <inVariable localId="2" width="42" height="27">
+              <position y="186" x="188"/>
+              <connectionPointOut>
+                <relPosition y="13" x="42"/>
+              </connectionPointOut>
+              <expression>STR1</expression>
+            </inVariable>
+            <inVariable localId="3" width="42" height="27">
+              <position y="217" x="188"/>
+              <connectionPointOut>
+                <relPosition y="13" x="42"/>
+              </connectionPointOut>
+              <expression>STR2</expression>
+            </inVariable>
+            <inVariable localId="4" width="42" height="27">
+              <position y="250" x="187"/>
+              <connectionPointOut>
+                <relPosition y="13" x="42"/>
+              </connectionPointOut>
+              <expression>STR3</expression>
+            </inVariable>
+            <inVariable localId="5" width="38" height="27">
+              <position y="320" x="188"/>
+              <connectionPointOut>
+                <relPosition y="13" x="38"/>
+              </connectionPointOut>
+              <expression>INT1</expression>
+            </inVariable>
+            <inVariable localId="6" width="38" height="27">
+              <position y="354" x="187"/>
+              <connectionPointOut>
+                <relPosition y="13" x="38"/>
+              </connectionPointOut>
+              <expression>INT2</expression>
+            </inVariable>
+            <inVariable localId="7" width="38" height="27">
+              <position y="387" x="187"/>
+              <connectionPointOut>
+                <relPosition y="13" x="38"/>
+              </connectionPointOut>
+              <expression>INT3</expression>
+            </inVariable>
+            <block localId="11" height="266" width="113" instanceName="test_str1" typeName="TEST_STRINGS">
+              <position y="154" x="348"/>
+              <inputVariables>
+                <variable formalParameter="IN1">
+                  <connectionPointIn>
+                    <relPosition y="37" x="0"/>
+                    <connection refLocalId="2">
+                      <position y="191" x="348"/>
+                      <position y="191" x="289"/>
+                      <position y="199" x="289"/>
+                      <position y="199" x="230"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN2">
+                  <connectionPointIn>
+                    <relPosition y="72" x="0"/>
+                    <connection refLocalId="3">
+                      <position y="226" x="348"/>
+                      <position y="226" x="289"/>
+                      <position y="230" x="289"/>
+                      <position y="230" x="230"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="IN3">
+                  <connectionPointIn>
+                    <relPosition y="107" x="0"/>
+                    <connection refLocalId="4">
+                      <position y="261" x="348"/>
+                      <position y="261" x="288"/>
+                      <position y="263" x="288"/>
+                      <position y="263" x="229"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="TESTNR">
+                  <connectionPointIn>
+                    <relPosition y="142" x="0"/>
+                    <connection refLocalId="12">
+                      <position y="296" x="348"/>
+                      <position y="296" x="253"/>
+                      <position y="309" x="253"/>
+                      <position y="309" x="159"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="K">
+                  <connectionPointIn>
+                    <relPosition y="177" x="0"/>
+                    <connection refLocalId="5">
+                      <position y="331" x="348"/>
+                      <position y="331" x="287"/>
+                      <position y="333" x="287"/>
+                      <position y="333" x="226"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="P">
+                  <connectionPointIn>
+                    <relPosition y="212" x="0"/>
+                    <connection refLocalId="6">
+                      <position y="366" x="348"/>
+                      <position y="366" x="286"/>
+                      <position y="367" x="286"/>
+                      <position y="367" x="225"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+                <variable formalParameter="L">
+                  <connectionPointIn>
+                    <relPosition y="247" x="0"/>
+                    <connection refLocalId="7">
+                      <position y="401" x="348"/>
+                      <position y="401" x="286"/>
+                      <position y="400" x="286"/>
+                      <position y="400" x="225"/>
+                    </connection>
+                  </connectionPointIn>
+                </variable>
+              </inputVariables>
+              <inOutVariables/>
+              <outputVariables>
+                <variable formalParameter="STRRES">
+                  <connectionPointOut>
+                    <relPosition y="37" x="113"/>
+                  </connectionPointOut>
+                </variable>
+                <variable formalParameter="INTRES">
+                  <connectionPointOut>
+                    <relPosition y="72" x="113"/>
+                  </connectionPointOut>
+                </variable>
+              </outputVariables>
+            </block>
+            <inVariable localId="12" width="67" height="27">
+              <position y="296" x="92"/>
+              <connectionPointOut>
+                <relPosition y="13" x="67"/>
+              </connectionPointOut>
+              <expression>TEST_NB</expression>
+            </inVariable>
+            <outVariable localId="13" width="66" height="27">
+              <position y="170" x="541"/>
+              <connectionPointIn>
+                <relPosition y="13" x="0"/>
+                <connection refLocalId="11" formalParameter="STRRES">
+                  <position y="183" x="541"/>
+                  <position y="183" x="501"/>
+                  <position y="191" x="501"/>
+                  <position y="191" x="461"/>
+                </connection>
+              </connectionPointIn>
+              <expression>RES_STR</expression>
+            </outVariable>
+            <outVariable localId="14" width="62" height="27">
+              <position y="234" x="574"/>
+              <connectionPointIn>
+                <relPosition y="13" x="0"/>
+                <connection refLocalId="11" formalParameter="INTRES">
+                  <position y="247" x="574"/>
+                  <position y="247" x="517"/>
+                  <position y="226" x="517"/>
+                  <position y="226" x="461"/>
+                </connection>
+              </connectionPointIn>
+              <expression>RES_INT</expression>
+            </outVariable>
+          </FBD>
+        </body>
+      </pou>
+    </pous>
+  </types>
+  <instances>
+    <configurations>
+      <configuration name="STD_CONF">
+        <resource name="STD_RESSOURCE">
+          <task interval="00:10:00" name="STD_TASK" priority="0"/>
+          <pouInstance type="MAIN_TEST" name="MAIN_INSTANCE"/>
+        </resource>
+        <globalVars>
+          <variable name="LOC1" address="%QW2">
+            <type>
+              <INT/>
+            </type>
+          </variable>
+        </globalVars>
+      </configuration>
+    </configurations>
+  </instances>
+</project>
--- a/generate_IEC_std.py	Tue Jul 10 19:22:42 2007 +0200
+++ b/generate_IEC_std.py	Thu Jul 12 11:27:43 2007 +0200
@@ -1,3 +1,19 @@
+"""
+
+ THIS CODE GENARATES C++ CODE FOR IEC2CC COMPILER
+ GENERATED CODE IS :
+ 
+function_type_decl.h - the long enumeration of std function types
+get_function_type_decl.c - the funct that return enumerated according function name
+st_code_gen.c - part of generate_cc_st_c::visit(function_invocation)
+                responsible to generate C code for std lib calls
+il_code_gen.c - part of generate_cc_il_c::visit(il_function_call)
+                responsible to generate C code for std lib calls
+search_type_code.c - called by search_expression_type_c::visit(function_invocation) 
+                     return type symbol for std function invocation
+ 
+"""
+
 # Get definitions
 from plcopen.structures import *
 
@@ -373,6 +389,29 @@
 ###################################################################
 ###################################################################
 """
+Generate the standard_function_names[] for inclusion in bizon generated code
+"""
+standard_function_names = """
+/****
+ * IEC 61131-3 standard function lib
+ * generated code, do not edit by hand
+ */
+
+const char *standard_function_names[] = {
+"""
+for fname, fdecls in [ (fname,std_fdecls[fname]) for fname in official_order ]:
+    standard_function_names += "\""+fname+"\",\n"
+standard_function_names += """
+/* end of array marker! Do not remove! */
+NULL
+};
+
+"""
+
+###################################################################
+###################################################################
+###################################################################
+"""
 Generate the C implementation of the IEC standard function library.
 """
 iec_std_lib_generated =  """
@@ -401,14 +440,19 @@
     sys.exit(0)
 
 # Now, print that out, or write to files from sys.argv
-for name, ext in [
-        ('function_type_decl','h'),
-        ('get_function_type_decl','c'),
-        ('st_code_gen','c'),
-        ('il_code_gen','c'),
-        ('search_type_code','c')#,
-        #('iec_std_lib_generated','h')
+for path, name, ext in [
+        ('stage4/generate_cc','function_type_decl','h'),
+        ('stage4/generate_cc','get_function_type_decl','c'),
+        ('stage4/generate_cc','st_code_gen','c'),
+        ('stage4/generate_cc','il_code_gen','c'),
+        ('stage4/generate_cc','search_type_code','c'),
+        ('stage1_2','standard_function_names','c'),
+        ('lib', 'iec_std_lib_generated','h')
         ]:
-    fd = open(os.path.join(sys.argv[1],name+'.'+ext),'w')
+    fd = open(os.path.join(sys.argv[1], path, name+'.'+ext),'w')
     fd.write(eval(name))
     fd.close()
+    
+#print "/* Code to eventually paste in iec_std_lib.h if type hierarchy changed */"
+#print "/* you also have to change iec_std_lib.h according to new types        */\n\n"
+#print iec_std_lib_generated
--- a/plcopen/iec_std.csv	Tue Jul 10 19:22:42 2007 +0200
+++ b/plcopen/iec_std.csv	Thu Jul 12 11:27:43 2007 +0200
@@ -1,7 +1,7 @@
 Standard_functions_variables_types;name;type;comment;;;;;;
-;N;UINT;Number of bits to be shifted;;;;;;
-;L;UINT;Left position within character string;;;;;;
-;P;UINT;Position within character string;;;;;;
+;N;ANY_INT;Number of bits to be shifted;;;;;;
+;L;ANY_INT;Left position within character string;;;;;;
+;P;ANY_INT;Position within character string;;;;;;
 ;G;BOOL;Selection out of 2 inputs (gate);;;;;;
 ;K;ANY_INT;Selection out of n inputs;;;;;;
 ;MN;ANY;Minimum value for limitation;;;;;;