09 limbaj text structurat

Upload: vlad-nistor

Post on 08-Jul-2018

257 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/19/2019 09 Limbaj Text Structurat

    1/18

     

    1

    Automate programabile

    Limbajul de programare

    de tip “Text structurat”

    (ST)

  • 8/19/2019 09 Limbaj Text Structurat

    2/18

     

    Operatori în ST

    Simbol Operaţie

    (expresie) Evaluarea parantezei

    identificator(listă de parametri) Evaluarea funcţiei

    Exemple:LN(A), MAX(X,), etc!

    "" #idicare la putereExponentiation

    $ Ne%are

    N&' omplement

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    3/18

     

    Operatori în ST

    " nmulţire

    * mpărţire

    M&+ Modulo

    Adunare

    $ -cădere

    . , / , .0 , /0 omparare

    0 E%alitate./ 1ne%alitate

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    4/18

     

    Operatori în ST

    2 -1 lo%ic

    AN+ -1 lo%ic

    X -A3$EXL3-14 -A3 lo%ic

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    5/18

     

    Instrucţiunea de atribuire

    A := B;

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    6/18

     

    Instrucţiunea de atribuire

    A := B;

    Tip dată la tip dată

    INT la INT

    sau

    Confiuratie!Canal!Analoi" laConfiuratie!Canal!Analoi"

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    7/18

     

    Instrucţiuni de control şi buclare

    IF .. THEN .. ELSE

    !SE

    F"#

    $HILE %

    #E&E!T 'NTIL

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    8/18

     

    Instrucţiunile IF .. THEN .. ESE

    I# "onditie= true

    T$EN a"tiune%

    E&SE a"tiune' ("ondiţia nu e ade)arată*

    I# ploua T$EN Stai!a"asa E&SE

    +eri!&a!,limbare

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    9/18

     

    Instrucţiunile IF .. THEN .. ESE

    - := B.B / 0.A.C ;

    I# - 1 232 T$EN N4OOTS := 2 ;

    E&SI# - = 232 T$EN

      N4OOTS := % ;

      5% := / B6('32.A* ;E&SE

      N4OOTS := ' ;

      5% := (/ B 7 S84T(-**6('32.A* ;

      5' := (/ B / S84T(-**6('32.A* ;

    EN-!I# ;

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    10/18

     

    Instrucţiunea !ASE " IF repetiti#

    CASE sele"tor O#

    )aloare!sele"tor : a"tiune

     E&SE 933

    EN-!CASE;

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    11/18

     

    Instrucţiunea !ASE " IF repetiti#

    T := BC-!TO!INT(T$+B$EE&*;

    T!E44O4 := 2;

    CASE T O#

      % := O?EN!TE+,;

      ': -IS,&A> := +OTO4!S,EE-;  @: -IS,&A> := 4OSS / TA4E;

      0 := STATS(T / 0*;

    E&SE -IS,&A> := 2 ;

      T!E44O4 := %;

    EN-!CASE;8%22 := INT!TO!BC-(-IS,&A>*;

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    12/18

     

    Instrucţiunea FO$

    SUM := 0 ;

    FOR valoare_initiala TO valoare_finala DO

    END_FOR ;

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    13/18

     

    Instrucţiunea FO$

    SUM := 0 ;

    FOR I := 1 TO 3 DO

      FOR J := 1 TO 2 DO

      SUM := SUM + J ;

      END_FOR ;

      SUM := SUM + I ;

    END_FOR ;

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    14/18

     

    Instrucţiunea FO$

    := %2% ;

    #O4 I := % TO %22 B> ' -O

      I# O4-SDI = FGE>F T$EN  := I ;

      E5IT ;

      EN-!I# ;

    EN-!#O4 ;

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    15/18

     

    Instrucţiunea %HIE

    := %;

    $I&E 1= %22 H O4-SD 1 FGE>F -O  := 7' ;

    EN-!$I&E ;

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    16/18

     

    Instrucţiunile $E&EAT ' (NTI

    := /% ;

    4E,EAT

      := 7' ;

    NTI& = %2% O4 O4-SD = FGE>F

    EN-!4E,EAT ;

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    17/18

     

    Instrucţiunile E)IT şi $ET($N

    1nstrucţiunea EX1' va fi folosită pentru a termina interaţiile 5nainte săfie satisfăcută condiţia de 5nc6eiere a iteraţiilor!

    SUM := 0 ;

    FOR I := 1 TO 3 DO

      FOR J := 1 TO 2 DO

      IF FLAG THEN EXIT ; END_IF

      SUM := SUM + J ;

      END_FOR ;

      SUM := SUM + I ;

    END_FOR ;

    http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.html

  • 8/19/2019 09 Limbaj Text Structurat

    18/18

     

    *ibliogra+ie

    E. a der $al* Structured Text + a ,ig, leel laguage*

    ---.plcope.org

    S# EN //0/+0* !utomate programabile. &artea 0.

    Limbaje de programare

    .1.Haba* Sisteme de comad2 a ma3iilor electrice* Ed.

    1,.!sac,i* Ia3i

    http://www.plcopen.org/http://www.mitsubishi-automation.com/products/microcontrollers_ALPHAXL.htmlhttp://www.plcopen.org/