Ajout des fonctions standard
This commit is contained in:
485
Cpt/fCptHoraire.xml
Normal file
485
Cpt/fCptHoraire.xml
Normal file
@@ -0,0 +1,485 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Document>
|
||||
<Engineering version="V19" />
|
||||
<SW.Blocks.FC ID="0">
|
||||
<AttributeList>
|
||||
<HeaderAuthor>MAUGAIN</HeaderAuthor>
|
||||
<HeaderVersion>1.0</HeaderVersion>
|
||||
<Interface><Sections xmlns="http://www.siemens.com/automation/Openness/SW/Interface/v5">
|
||||
<Section Name="Input">
|
||||
<Member Name="On" Datatype="Bool" />
|
||||
</Section>
|
||||
<Section Name="Output" />
|
||||
<Section Name="InOut">
|
||||
<Member Name="Struct" Datatype=""sCptHoraire"" />
|
||||
</Section>
|
||||
<Section Name="Temp">
|
||||
<Member Name="An" Datatype="Int">
|
||||
<Comment>
|
||||
<MultiLanguageText Lang="fr-FR">Nombre d'années</MultiLanguageText>
|
||||
</Comment>
|
||||
</Member>
|
||||
<Member Name="Jrs" Datatype="Int">
|
||||
<Comment>
|
||||
<MultiLanguageText Lang="fr-FR">Nombre de jours</MultiLanguageText>
|
||||
</Comment>
|
||||
</Member>
|
||||
<Member Name="Hrs" Datatype="Int">
|
||||
<Comment>
|
||||
<MultiLanguageText Lang="fr-FR">Nombre d'heures</MultiLanguageText>
|
||||
</Comment>
|
||||
</Member>
|
||||
<Member Name="Min" Datatype="Int">
|
||||
<Comment>
|
||||
<MultiLanguageText Lang="fr-FR">Nombre de minutes</MultiLanguageText>
|
||||
</Comment>
|
||||
</Member>
|
||||
<Member Name="Sec" Datatype="Int">
|
||||
<Comment>
|
||||
<MultiLanguageText Lang="fr-FR">Nombre de secondes</MultiLanguageText>
|
||||
</Comment>
|
||||
</Member>
|
||||
</Section>
|
||||
<Section Name="Constant" />
|
||||
<Section Name="Return">
|
||||
<Member Name="Ret_Val" Datatype="Void" />
|
||||
</Section>
|
||||
</Sections></Interface>
|
||||
<MemoryLayout>Optimized</MemoryLayout>
|
||||
<Name>fCptHoraire</Name>
|
||||
<Namespace />
|
||||
<Number>10</Number>
|
||||
<ProgrammingLanguage>SCL</ProgrammingLanguage>
|
||||
<SetENOAutomatically>false</SetENOAutomatically>
|
||||
</AttributeList>
|
||||
<ObjectList>
|
||||
<MultilingualText ID="1" CompositionName="Comment">
|
||||
<ObjectList>
|
||||
<MultilingualTextItem ID="2" CompositionName="Items">
|
||||
<AttributeList>
|
||||
<Culture>fr-FR</Culture>
|
||||
<Text>Ce bloc doit être executé par une tache cyclique 1sec</Text>
|
||||
</AttributeList>
|
||||
</MultilingualTextItem>
|
||||
</ObjectList>
|
||||
</MultilingualText>
|
||||
<SW.Blocks.CompileUnit ID="3" CompositionName="CompileUnits">
|
||||
<AttributeList>
|
||||
<NetworkSource><StructuredText xmlns="http://www.siemens.com/automation/Openness/SW/NetworkSource/StructuredText/v4">
|
||||
<LineComment UId="21">
|
||||
<Text UId="22"> Recopie de l'entrée physique en mémoire du bloc</Text>
|
||||
</LineComment>
|
||||
<NewLine UId="23" />
|
||||
<Access Scope="LocalVariable" UId="24">
|
||||
<Symbol UId="25">
|
||||
<Component Name="Struct" UId="26" />
|
||||
<Token Text="." UId="27" />
|
||||
<Component Name="On" UId="28" />
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="29" />
|
||||
<Token Text=":=" UId="30" />
|
||||
<Blank UId="31" />
|
||||
<Access Scope="LocalVariable" UId="32">
|
||||
<Symbol UId="33">
|
||||
<Component Name="On" UId="34" />
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Token Text=";" UId="35" />
|
||||
<NewLine UId="36" />
|
||||
<LineComment Inserted="true" UId="37">
|
||||
<Text UId="38"> Remise à zéro sur front montant</Text>
|
||||
</LineComment>
|
||||
<NewLine UId="39" />
|
||||
<Token Text="IF" UId="40" />
|
||||
<Blank UId="41" />
|
||||
<Access Scope="LocalVariable" UId="42">
|
||||
<Symbol UId="43">
|
||||
<Component Name="Struct" UId="44" />
|
||||
<Token Text="." UId="45" />
|
||||
<Component Name="Raz" UId="46">
|
||||
<BooleanAttribute Name="HasHash" UId="47">true</BooleanAttribute>
|
||||
</Component>
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="48" />
|
||||
<Token Text="THEN" UId="49" />
|
||||
<NewLine UId="50" />
|
||||
<Blank Num="4" UId="51" />
|
||||
<Access Scope="LocalVariable" UId="52">
|
||||
<Symbol UId="53">
|
||||
<Component Name="Struct" UId="54" />
|
||||
<Token Text="." UId="55" />
|
||||
<Component Name="ValSec" UId="56">
|
||||
<BooleanAttribute Name="HasHash" UId="57">true</BooleanAttribute>
|
||||
</Component>
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="58" />
|
||||
<Token Text=":=" UId="59" />
|
||||
<Blank UId="60" />
|
||||
<Access Scope="LiteralConstant" UId="61">
|
||||
<Constant UId="62">
|
||||
<ConstantValue UId="64">0</ConstantValue>
|
||||
</Constant>
|
||||
</Access>
|
||||
<Token Text=";" UId="65" />
|
||||
<NewLine UId="66" />
|
||||
<Blank Num="4" UId="67" />
|
||||
<Access Scope="LocalVariable" UId="68">
|
||||
<Symbol UId="69">
|
||||
<Component Name="Struct" UId="70" />
|
||||
<Token Text="." UId="71" />
|
||||
<Component Name="Raz" UId="72" />
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="73" />
|
||||
<Token Text=":=" UId="74" />
|
||||
<Blank UId="75" />
|
||||
<Access Scope="LiteralConstant" UId="76">
|
||||
<Constant UId="77">
|
||||
<ConstantValue UId="79">FALSE</ConstantValue>
|
||||
</Constant>
|
||||
</Access>
|
||||
<Token Text=";" UId="80" />
|
||||
<NewLine UId="81" />
|
||||
<Token Text="END_IF" UId="82" />
|
||||
<Token Text=";" UId="83" />
|
||||
<NewLine Num="2" UId="84" />
|
||||
<LineComment Inserted="true" UId="85">
|
||||
<Text UId="86"> Increment comptage </Text>
|
||||
</LineComment>
|
||||
<NewLine UId="87" />
|
||||
<Token Text="IF" UId="88" />
|
||||
<Blank UId="89" />
|
||||
<Access Scope="LocalVariable" UId="90">
|
||||
<Symbol UId="91">
|
||||
<Component Name="Struct" UId="92" />
|
||||
<Token Text="." UId="93" />
|
||||
<Component Name="On" UId="94">
|
||||
<BooleanAttribute Name="HasHash" UId="95">true</BooleanAttribute>
|
||||
</Component>
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="96" />
|
||||
<Token Text="THEN" UId="97" />
|
||||
<NewLine UId="98" />
|
||||
<Blank Num="4" UId="99" />
|
||||
<Access Scope="LocalVariable" UId="100">
|
||||
<Symbol UId="101">
|
||||
<Component Name="Struct" UId="102" />
|
||||
<Token Text="." UId="103" />
|
||||
<Component Name="ValSec" UId="104">
|
||||
<BooleanAttribute Name="HasHash" UId="105">true</BooleanAttribute>
|
||||
</Component>
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="106" />
|
||||
<Token Text=":=" UId="107" />
|
||||
<Blank UId="108" />
|
||||
<Access Scope="LocalVariable" UId="109">
|
||||
<Symbol UId="110">
|
||||
<Component Name="Struct" UId="111" />
|
||||
<Token Text="." UId="112" />
|
||||
<Component Name="ValSec" UId="113">
|
||||
<BooleanAttribute Name="HasHash" UId="114">true</BooleanAttribute>
|
||||
</Component>
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="115" />
|
||||
<Token Text="+" UId="116" />
|
||||
<Blank UId="117" />
|
||||
<Access Scope="LiteralConstant" UId="118">
|
||||
<Constant UId="119">
|
||||
<ConstantValue UId="121">1</ConstantValue>
|
||||
</Constant>
|
||||
</Access>
|
||||
<Token Text=";" UId="122" />
|
||||
<NewLine UId="123" />
|
||||
<Token Text="END_IF" UId="124" />
|
||||
<Token Text=";" UId="125" />
|
||||
<NewLine Num="2" UId="126" />
|
||||
<Access Scope="LocalVariable" UId="127">
|
||||
<Symbol UId="128">
|
||||
<Component Name="An" UId="129" />
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="130" />
|
||||
<Token Text=":=" UId="131" />
|
||||
<Blank UId="132" />
|
||||
<Access Scope="Call" UId="133">
|
||||
<Instruction Name="UDINT_TO_INT" UId="134">
|
||||
<Token Text="(" UId="135" />
|
||||
<NamelessParameter UId="136">
|
||||
<Access Scope="LocalVariable" UId="137">
|
||||
<Symbol UId="138">
|
||||
<Component Name="Struct" UId="139" />
|
||||
<Token Text="." UId="140" />
|
||||
<Component Name="ValSec" UId="141">
|
||||
<BooleanAttribute Name="HasHash" UId="142">true</BooleanAttribute>
|
||||
</Component>
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="143" />
|
||||
<Token Text="/" UId="144" />
|
||||
<Blank UId="145" />
|
||||
<Access Scope="LiteralConstant" UId="146">
|
||||
<Constant UId="147">
|
||||
<ConstantValue UId="149">31536000</ConstantValue>
|
||||
</Constant>
|
||||
</Access>
|
||||
</NamelessParameter>
|
||||
<Token Text=")" UId="151" />
|
||||
</Instruction>
|
||||
</Access>
|
||||
<Token Text=";" UId="152" />
|
||||
<Blank UId="153" />
|
||||
<LineComment Inserted="true" UId="154">
|
||||
<Text UId="155"> 3600*24*365 Secondes divisées par ( heures * jours * années ) </Text>
|
||||
</LineComment>
|
||||
<NewLine UId="156" />
|
||||
<Access Scope="LocalVariable" UId="157">
|
||||
<Symbol UId="158">
|
||||
<Component Name="Jrs" UId="159" />
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="160" />
|
||||
<Token Text=":=" UId="161" />
|
||||
<Blank UId="162" />
|
||||
<Access Scope="Call" UId="163">
|
||||
<Instruction Name="UDINT_TO_INT" UId="164">
|
||||
<Token Text="(" UId="165" />
|
||||
<NamelessParameter UId="166">
|
||||
<Access Scope="LocalVariable" UId="167">
|
||||
<Symbol UId="168">
|
||||
<Component Name="Struct" UId="169" />
|
||||
<Token Text="." UId="170" />
|
||||
<Component Name="ValSec" UId="171">
|
||||
<BooleanAttribute Name="HasHash" UId="172">true</BooleanAttribute>
|
||||
</Component>
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="173" />
|
||||
<Token Text="/" UId="174" />
|
||||
<Blank UId="175" />
|
||||
<Access Scope="LiteralConstant" UId="176">
|
||||
<Constant UId="177">
|
||||
<ConstantValue UId="179">86400</ConstantValue>
|
||||
</Constant>
|
||||
</Access>
|
||||
<Blank UId="180" />
|
||||
<Token Text="MOD" UId="181" />
|
||||
<Blank UId="182" />
|
||||
<Access Scope="LiteralConstant" UId="183">
|
||||
<Constant UId="184">
|
||||
<ConstantValue UId="186">365</ConstantValue>
|
||||
</Constant>
|
||||
</Access>
|
||||
</NamelessParameter>
|
||||
<Token Text=")" UId="188" />
|
||||
</Instruction>
|
||||
</Access>
|
||||
<Token Text=";" UId="189" />
|
||||
<Blank UId="190" />
|
||||
<LineComment Inserted="true" UId="191">
|
||||
<Text UId="192"> 3600*24 Reste de la division des secondes divisées par ( heures * jours </Text>
|
||||
</LineComment>
|
||||
<NewLine UId="193" />
|
||||
<Access Scope="LocalVariable" UId="194">
|
||||
<Symbol UId="195">
|
||||
<Component Name="Hrs" UId="196" />
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="197" />
|
||||
<Token Text=":=" UId="198" />
|
||||
<Blank UId="199" />
|
||||
<Access Scope="Call" UId="200">
|
||||
<Instruction Name="UDINT_TO_INT" UId="201">
|
||||
<Token Text="(" UId="202" />
|
||||
<NamelessParameter UId="203">
|
||||
<Access Scope="LocalVariable" UId="204">
|
||||
<Symbol UId="205">
|
||||
<Component Name="Struct" UId="206" />
|
||||
<Token Text="." UId="207" />
|
||||
<Component Name="ValSec" UId="208">
|
||||
<BooleanAttribute Name="HasHash" UId="209">true</BooleanAttribute>
|
||||
</Component>
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="210" />
|
||||
<Token Text="/" UId="211" />
|
||||
<Blank UId="212" />
|
||||
<Access Scope="LiteralConstant" UId="213">
|
||||
<Constant UId="214">
|
||||
<ConstantValue UId="216">3600</ConstantValue>
|
||||
</Constant>
|
||||
</Access>
|
||||
<Blank UId="217" />
|
||||
<Token Text="MOD" UId="218" />
|
||||
<Blank UId="219" />
|
||||
<Access Scope="LiteralConstant" UId="220">
|
||||
<Constant UId="221">
|
||||
<ConstantValue UId="223">24</ConstantValue>
|
||||
</Constant>
|
||||
</Access>
|
||||
</NamelessParameter>
|
||||
<Token Text=")" UId="225" />
|
||||
</Instruction>
|
||||
</Access>
|
||||
<Token Text=";" UId="226" />
|
||||
<Blank UId="227" />
|
||||
<LineComment Inserted="true" UId="228">
|
||||
<Text UId="229"> Reste de la division des secondes divisées par les heures </Text>
|
||||
</LineComment>
|
||||
<NewLine UId="230" />
|
||||
<Access Scope="LocalVariable" UId="231">
|
||||
<Symbol UId="232">
|
||||
<Component Name="Min" UId="233" />
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="234" />
|
||||
<Token Text=":=" UId="235" />
|
||||
<Blank UId="236" />
|
||||
<Access Scope="Call" UId="237">
|
||||
<Instruction Name="UDINT_TO_INT" UId="238">
|
||||
<Token Text="(" UId="239" />
|
||||
<NamelessParameter UId="240">
|
||||
<Access Scope="LocalVariable" UId="241">
|
||||
<Symbol UId="242">
|
||||
<Component Name="Struct" UId="243" />
|
||||
<Token Text="." UId="244" />
|
||||
<Component Name="ValSec" UId="245">
|
||||
<BooleanAttribute Name="HasHash" UId="246">true</BooleanAttribute>
|
||||
</Component>
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="247" />
|
||||
<Token Text="/" UId="248" />
|
||||
<Blank UId="249" />
|
||||
<Access Scope="LiteralConstant" UId="250">
|
||||
<Constant UId="251">
|
||||
<ConstantValue UId="253">60</ConstantValue>
|
||||
</Constant>
|
||||
</Access>
|
||||
<Blank UId="254" />
|
||||
<Token Text="MOD" UId="255" />
|
||||
<Blank UId="256" />
|
||||
<Access Scope="LiteralConstant" UId="257">
|
||||
<Constant UId="258">
|
||||
<ConstantValue UId="260">60</ConstantValue>
|
||||
</Constant>
|
||||
</Access>
|
||||
</NamelessParameter>
|
||||
<Token Text=")" UId="262" />
|
||||
</Instruction>
|
||||
</Access>
|
||||
<Token Text=";" UId="263" />
|
||||
<Blank UId="264" />
|
||||
<LineComment Inserted="true" UId="265">
|
||||
<Text UId="266"> Reste de la division des secondes divisées par les minutes </Text>
|
||||
</LineComment>
|
||||
<NewLine UId="267" />
|
||||
<Access Scope="LocalVariable" UId="268">
|
||||
<Symbol UId="269">
|
||||
<Component Name="Sec" UId="270" />
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="271" />
|
||||
<Token Text=":=" UId="272" />
|
||||
<Blank UId="273" />
|
||||
<Access Scope="Call" UId="274">
|
||||
<Instruction Name="UDINT_TO_INT" UId="275">
|
||||
<Token Text="(" UId="276" />
|
||||
<NamelessParameter UId="277">
|
||||
<Access Scope="LocalVariable" UId="278">
|
||||
<Symbol UId="279">
|
||||
<Component Name="Struct" UId="280" />
|
||||
<Token Text="." UId="281" />
|
||||
<Component Name="ValSec" UId="282">
|
||||
<BooleanAttribute Name="HasHash" UId="283">true</BooleanAttribute>
|
||||
</Component>
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="284" />
|
||||
<Token Text="MOD" UId="285" />
|
||||
<Blank UId="286" />
|
||||
<Access Scope="LiteralConstant" UId="287">
|
||||
<Constant UId="288">
|
||||
<ConstantValue UId="290">60</ConstantValue>
|
||||
</Constant>
|
||||
</Access>
|
||||
</NamelessParameter>
|
||||
<Token Text=")" UId="292" />
|
||||
</Instruction>
|
||||
</Access>
|
||||
<Token Text=";" UId="293" />
|
||||
<Blank UId="294" />
|
||||
<LineComment Inserted="true" UId="295">
|
||||
<Text UId="296"> reste en secondes </Text>
|
||||
</LineComment>
|
||||
<NewLine UId="297" />
|
||||
<Access Scope="LocalVariable" UId="298">
|
||||
<Symbol UId="299">
|
||||
<Component Name="Struct" UId="300" />
|
||||
<Token Text="." UId="301" />
|
||||
<Component Name="ValH" UId="302" />
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="303" />
|
||||
<Token Text=":=" UId="304" />
|
||||
<Blank UId="305" />
|
||||
<Access Scope="LocalVariable" UId="306">
|
||||
<Symbol UId="307">
|
||||
<Component Name="Struct" UId="308" />
|
||||
<Token Text="." UId="309" />
|
||||
<Component Name="ValSec" UId="310" />
|
||||
</Symbol>
|
||||
</Access>
|
||||
<Blank UId="311" />
|
||||
<Token Text="/" UId="312" />
|
||||
<Blank UId="313" />
|
||||
<Access Scope="LiteralConstant" UId="314">
|
||||
<Constant UId="315">
|
||||
<ConstantValue UId="317">3600</ConstantValue>
|
||||
</Constant>
|
||||
</Access>
|
||||
<Token Text=";" UId="318" />
|
||||
</StructuredText></NetworkSource>
|
||||
<ProgrammingLanguage>SCL</ProgrammingLanguage>
|
||||
</AttributeList>
|
||||
<ObjectList>
|
||||
<MultilingualText ID="4" CompositionName="Comment">
|
||||
<ObjectList>
|
||||
<MultilingualTextItem ID="5" CompositionName="Items">
|
||||
<AttributeList>
|
||||
<Culture>fr-FR</Culture>
|
||||
<Text />
|
||||
</AttributeList>
|
||||
</MultilingualTextItem>
|
||||
</ObjectList>
|
||||
</MultilingualText>
|
||||
<MultilingualText ID="6" CompositionName="Title">
|
||||
<ObjectList>
|
||||
<MultilingualTextItem ID="7" CompositionName="Items">
|
||||
<AttributeList>
|
||||
<Culture>fr-FR</Culture>
|
||||
<Text />
|
||||
</AttributeList>
|
||||
</MultilingualTextItem>
|
||||
</ObjectList>
|
||||
</MultilingualText>
|
||||
</ObjectList>
|
||||
</SW.Blocks.CompileUnit>
|
||||
<MultilingualText ID="8" CompositionName="Title">
|
||||
<ObjectList>
|
||||
<MultilingualTextItem ID="9" CompositionName="Items">
|
||||
<AttributeList>
|
||||
<Culture>fr-FR</Culture>
|
||||
<Text>Compteur horaire</Text>
|
||||
</AttributeList>
|
||||
</MultilingualTextItem>
|
||||
</ObjectList>
|
||||
</MultilingualText>
|
||||
</ObjectList>
|
||||
</SW.Blocks.FC>
|
||||
</Document>
|
||||
Reference in New Issue
Block a user