<!DOCTYPE Tree SYSTEM "IPSA.dtd">
<Tree chk="811535831" type="Script" onEnd="default" onBackExit="back">
<Header>
<IFile>
<FileName name="INVERSION_LSB_MSB">
</FileName>
<Modif user="E377646" site="Actia" date="27/11/2018">
</Modif>
</IFile>
<ITool revision="7.2.0.201809241046" name="fr.actia.flowchart.editor.model.engineID" exedate="12/11/2018">
</ITool>
</Header>
<precel>
</precel>
<cel>
<Start posc=1 posl=1 destc="1" destl="3" ident=10>
<Comment>Flowchart permettant d'inverser les octets d'une trame
</Comment>
<Comment>Données d'entrée :
</Comment>
<Comment>* GlobalTextBuffer DATA_IN = contient les octets à inverser
</Comment>
<Comment>* GlobalTextBuffer DATA_OUT = contient les octets inversés
</Comment>
<Comment>Exemple: DATA_IN=01020304; DATA_OUT=04030201
</Comment>
</Start>
<End posc=1 posl=17 ident=86>
</End>
<Act posc=1 posl=3 destc="1" destl="5" ident=19>
<MathAndLogic>
<Clear>
<Destination>
<GlobalTextBuffer name="DATA_OUT">
</GlobalTextBuffer>
</Destination>
<Destination>
<FloatVar name="V0">
</FloatVar>
</Destination>
<Destination>
<FloatVar name="V1">
</FloatVar>
</Destination>
<Destination>
<FloatVar name="V2">
</FloatVar>
</Destination>
<Destination>
<FloatVar name="V3">
</FloatVar>
</Destination>
</Clear>
</MathAndLogic>
</Act>
<Act posc=1 posl=5 destc="1" destl="7" ident=20>
<Comment>Récupération du nombre d'octets en entrée
</Comment>
<MathAndLogic>
<Assignment>
<Source>
<GlobalTextBuffer name="DATA_IN">
<Position>
<ValPos>0
</ValPos>
</Position>
<Length>1
</Length>
</GlobalTextBuffer>
</Source>
<Destination>
<FloatVar name="V0">
</FloatVar>
</Destination>
</Assignment>
</MathAndLogic>
</Act>
<Act posc=1 posl=13 destc="1" destl="15" ident=21>
<Comment>Récupération de l'octet de la donnée d'entrée dans la donnée de sortie
</Comment>
<MathAndLogic>
<Assignment>
<Source>
<GlobalTextBuffer name="DATA_IN">
<Position>
<FloatVar name="V1">
</FloatVar>
</Position>
<Length>2
</Length>
</GlobalTextBuffer>
</Source>
<Destination>
<GlobalTextBuffer name="DATA_OUT">
<Position>
<FloatVar name="V2">
</FloatVar>
</Position>
<Length>2
</Length>
</GlobalTextBuffer>
</Destination>
</Assignment>
</MathAndLogic>
</Act>
<Act posc=1 posl=11 destc="1" destl="13" ident=22>
<Comment>Détermination de la position du premier octet à inverser (dernier octet de la donnée d'entrée)
</Comment>
<MathAndLogic>
<Subtraction>
<Source>
<FloatNumber>1
</FloatNumber>
</Source>
<Destination>
<FloatVariable>
<FloatVar name="V0">
</FloatVar>
</FloatVariable>
</Destination>
</Subtraction>
<Assignment>
<Source>
<FloatVar name="V0">
</FloatVar>
</Source>
<Destination>
<FloatVar name="V1">
</FloatVar>
</Destination>
</Assignment>
<Assignment>
<Source>
<FloatNumber>1
</FloatNumber>
</Source>
<Destination>
<FloatVar name="V2">
</FloatVar>
</Destination>
</Assignment>
</MathAndLogic>
</Act>
<Act posc=3 posl=13 destc="1" destl="13" ident=23>
<Comment>Incrémentation des variables
</Comment>
<MathAndLogic>
<Subtraction>
<Source>
<FloatNumber>2
</FloatNumber>
</Source>
<Destination>
<FloatVar name="V1">
</FloatVar>
</Destination>
</Subtraction>
<Addition>
<Source>
<FloatNumber>2
</FloatNumber>
</Source>
<Destination>
<FloatVar name="V2">
</FloatVar>
</Destination>
</Addition>
</MathAndLogic>
</Act>
<Test posc=1 posl=15 destyesc=3 destyesl=13 destnoc=1 destnol=17 ident=24>
<Comment>Test s'il reste des octets à inverser
</Comment>
<MathAndLogic>
<LogicalTest>
<For>
<DataComparison type="INF" case="SENSITIVE">
<Source>
<FloatVar name="V2">
</FloatVar>
</Source>
<Source>
<FloatVar name="V0">
</FloatVar>
</Source>
</DataComparison>
</For>
</LogicalTest>
</MathAndLogic>
</Test>
<Test posc=1 posl=9 destyesc=1 destyesl=11 destnoc=3 destnol=9 ident=26>
<MathAndLogic>
<LogicalTest>
<For>
<DataComparison type="EQUAL" case="SENSITIVE">
<Source>
<FloatVar name="VCHK">
</FloatVar>
</Source>
<Source>
<StandardValue name="SUCCESS">
</StandardValue>
</Source>
</DataComparison>
<DataComparison type="EQUAL" case="SENSITIVE">
<Source>
<FloatVar name="V3">
</FloatVar>
</Source>
<Source>
<FloatNumber>0
</FloatNumber>
</Source>
</DataComparison>
<DataComparison type="DIFFERENT" case="SENSITIVE">
<Source>
<FloatVar name="V0">
</FloatVar>
</Source>
<Source>
<FloatNumber>0
</FloatNumber>
</Source>
</DataComparison>
</For>
</LogicalTest>
</MathAndLogic>
</Test>
<Act posc=1 posl=7 destc="1" destl="9" ident=27>
<Comment>Vérification de la donnée d'entrée qui doit être un nombre pair
</Comment>
<MathAndLogic>
<Modulo>
<Source>
<FloatVar name="V0">
</FloatVar>
</Source>
<Source>
<FloatNumber>2
</FloatNumber>
</Source>
<Destination>
<FloatVar name="V3">
</FloatVar>
</Destination>
</Modulo>
</MathAndLogic>
</Act>
<End posc=5 posl=9 ident=28>
</End>
<Act posc=3 posl=9 destc="5" destl="9" ident=11>
<MathAndLogic>
<Assignment>
<Source>
<FloatNumber>9
</FloatNumber>
</Source>
<Destination>
<FloatVar name="VCHK">
</FloatVar>
</Destination>
</Assignment>
</MathAndLogic>
</Act>
</cel>
</Tree>
