TIA SimaticML Format

Jochen Kühner

Level-3
Beiträge
4.484
Reaktionspunkte
727
Zuviel Werbung?
-> Hier kostenlos registrieren
Hallo, hat sich jemand schon mal mit AutomationML auseinandergesetzt? Bzw. gibt es eine genau spezifikation?

Was ich nicht verstehe:

folgender code:

Code:
#Block_14_Instance(l:=TRUE);
#IEC_Timer_0_Instance(IN:=true,
                      PT:=t#3s);

wir zu diesem AutomationML:

XML:
<Access Scope="Call" UId="21">
    <CallInfo UId="22" BlockType="FB" Name="Block_14">
      <Instance Scope="LocalVariable" UId="23">
        <Component Name="Block_14_Instance" UId="24" />
      </Instance>
      <Token Text="(" UId="25" />
      <Parameter Name="l" UId="26">
        <Token Text=":=" UId="27" />
        <Access Scope="LiteralConstant" UId="28">
          <Constant UId="29">
            <ConstantValue UId="31">TRUE</ConstantValue>
          </Constant>
        </Access>
      </Parameter>
      <Token Text=")" UId="32" />
    </CallInfo>
  </Access>
 
  <Token Text=";" UId="33" />
  <NewLine UId="34" />
  <Access Scope="LocalVariable" UId="35">
    <Symbol UId="36">
      <Component Name="IEC_Timer_0_Instance" UId="37" />
    </Symbol>
  </Access>
 
  <Access Scope="Call" UId="38">
    <Instruction UId="39">
      <Token Text="(" UId="40" />
      <Parameter Name="IN" UId="41">
        <Token Text=":=" UId="42" />
        <Access Scope="LiteralConstant" UId="43">
          <Constant UId="44">
            <ConstantValue UId="46">true</ConstantValue>
          </Constant>
        </Access>
      </Parameter>
      <Token Text="," UId="47" />
      <NewLine UId="48" />
      <Blank Num="22" UId="49" />
      <Parameter Name="PT" UId="50">
        <Token Text=":=" UId="51" />
        <Access Scope="TypedConstant" UId="52">
          <Constant UId="53">
            <ConstantValue UId="54">t#3s</ConstantValue>
          </Constant>
        </Access>
      </Parameter>
      <Token Text=")" UId="55" />
    </Instruction>
  </Access>
  <Token Text=";" UId="56" />
  <NewLine Num="3" UId="57" />

Wie Ihr seht, ist bei einem Multiinstanz FB Call, der Zugriff auf hier: "Block_14_Instance" innerhalb das "Access" Element mit dem Attribut "Call" gempappt.
Beim IEC Timer Call aber nicht...

Ich versuch das eigentlich aus dem TIA Projekt direkt zu erzeugen (da dort das ganze in einem komplett anderen Format gespeichert ist, dort ist aber jeder Call gewrappt wie beim Multiinstanzaufruf:

XML:
        <Statement UId="369" SI="STSub">
            <InstCa UId="374">
                <Sub UId="373" SI="FB" SyId="8" ODN="#Block_14_Instance" />
                <BracO UId="367" />
                <Fold UId="375">
                    <Param UId="377" SI="ParaIn">
                        <SymPa UId="378" SyId="10" ODN="l" FormalName="l" />
                        <OpAs UId="376" />
                        <Expression Result="Bool" UId="382" SI="ExprPrimC">
                            <Const TE="TRUE" UId="379" SI="ConstBool" SyId="30" />
                        </Expression>
                    </Param>
                    <BracC UId="381" />
                </Fold>
            </InstCa>
            <FiSt UId="383" />
        </Statement>
        <NL UId="333" />
        <Statement UId="337" SI="STSub">
            <InstCa UId="342">
                <Sub UId="341" SI="DB" SyId="17" ODN="#IEC_Timer_0_Instance" Deco="Instruction§17§Auto='True' TCV='True' Template0='time_type _x0033_3554443_x002C_Time_x002C_Time'§" />
                <BracO UId="335" />
                <Fold UId="343">
                    <Param UId="345" SI="ParaIn">
                        <SymPa UId="346" SyId="26" ODN="IN" Deco="InstructionParameter§26§0" FormalName="IN" />
                        <OpAs UId="344" />
                        <Expression Result="Bool" UId="350" SI="ExprPrimC">
                            <Const TE="true" UId="347" SI="ConstBool" SyId="19" />
                        </Expression>
                    </Param>
                    <Comma UId="349" />
                    <NL UId="351" />
                    <BL NumBLs="22" />
                    <Param UId="353" SI="ParaIn">
                        <SymPa UId="355" SyId="27" ODN="PT" Deco="InstructionParameter§27§1" FormalName="PT" />
                        <OpAs UId="354" />
                        <Expression Result="Time" UId="359" SI="ExprPrimC">
                            <Const TE="t#3s" UId="356" SI="ConstTime" SyId="21" />
                        </Expression>
                    </Param>
                    <BracC UId="358" />
                </Fold>
            </InstCa>
            <FiSt UId="360" />
        </Statement>
        <NL UId="361" />
        <NL UId="362" />
        <NL UId="363" />
 
Bzw. gibt es eine genau spezifikation?
Sicher, dass du AutomationML meinst?
Bausteine über die Openess-Schnittstelle laufen doch, soweit ich weiß, immer über SimaticML.

Ne Doku bzw. Spezifikationen dazu hab ich leider bisher auch noch nicht so wirklich gefunden.
Aber das wie Bausteine in SimaticML exportiert werden scheint generell etwas... eigenwillig zu sein...
Hab aber nur mal ein Tool geschrieben, welches DBs in Exel exportiert.
Also sind meine Erfahrungen da auch eher Übersichtlich.

Spezifikationen zu AutomationML findest du hier:
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Hast wohl recht... dachte das heißt AutomationML...
Ist SimaticML ....

Ich will ja aus dem TIA internen Format direkt SimaticML erzeugen... Aber das ist echt sehr eigenwillig....

Zumindest bei Calls in SCL....

Muss schauen ob das bei AWL/KOP/FUP auch noch ein Thema ist....

Mein erster primitiver Ansatz das TIA Format zu durchlaufen und für jedes XML Element das entsprechende SimaticML Element zu erzeugen wird immer schwieriger...

Und natürlich ist das interne Format noch in jeder TIA Version ein bisschen unterschiedlich...
 
Mache ich auch schon.
Bspw. aber wenn du die Bausteine wieder importieren willst.
In den SCL/AWL Quellen sind nicht alle Informationen enthalten. Bspw keine Übersetzungen....

Oder wenn du die Bausteine im Automation Compare Tool anzeigen willst.

Oder wenn du KOP/FUP Bausteine mit SCL/AWL Code hast.

usw....
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Ich hab mich damit heute auch kurz und auch nur oberflächlich beschäftigen müssen.
Siemens liefert doch die Schemata dafür mit. Über die xds.exe könntest du dir daraus eine klasse erstellen lassen, die wiederum das xml richtig erzeugen sollte. Soweit die Theorie. Vielleicht hilft dir das
 
Nö, würde nicht wirklich helfen, die klassen um es zu erzeugen hab ich ja, aber aber warum es bei manchen calls unterschiedlich erzeugt wird.... Dann muss ich ja auch die Klassen dazu unterschiedlich erzeugen.
 
Hab jetzt gerade noch was gefunden:
SCL Code:
Code:
#Block_14_Instance(l:=TRUE);

SimaticML:
XML:
  <Access Scope="Call" UId="21">
    <CallInfo UId="22" BlockType="FB" Name="Block_14">
      <Instance Scope="LocalVariable" UId="23">
        <Component Name="Block_14_Instance" UId="24" />
      </Instance>
      <Token Text="(" UId="25" />
      <Parameter Name="l" UId="26">
        <Token Text=":=" UId="27" />
        <Access Scope="LiteralConstant" UId="28">
          <Constant UId="29">
            <ConstantValue UId="31">TRUE</ConstantValue>
          </Constant>
        </Access>
      </Parameter>
      <Token Text=")" UId="32" />
    </CallInfo>
  </Access>
  <Token Text=";" UId="33" />

Darstellung im Automation Compare Tool:
Code:
Block14#Block_14_Instance(l:=TRUE);
 
Zurück
Oben