Plc Programming Manual

Embed Size (px)

Citation preview

  • 7/26/2019 Plc Programming Manual

    1/17

    Programming Manual for PLC FP-2

    Ladder and FBD Editors

    In the Ladder Diagram (LD) and Function Block Diagram (FBD) editors, programs are presented

    graphically. The LD editor can portray everything the FBD can, but in addition the LD

    can incorporate Boolean variables in the !orm o! contacts and coils

    has a po"er rail that connects all net"orks and to "hich contacts, etc. are connected

    "ithin net"orks.

    LD symbols include contacts, coils, input variables, output variables, #umps and back"ard #umps. $n

    FBD program consists o! blocks, #umps, input variables and output variables.

    LD program, "hich includes a po"er rail and Boolean contact

    % &et"ork in!o area "ith net"ork number

    ' o"er rail

    &et"ork "ith Boolean contacts

    * +omment !ield

    rogramming "indo"

  • 7/26/2019 Plc Programming Manual

    2/17

    FBD program.

    % &et"ork in!o area "ith net"ork number

    ' +omment !ield rograming -indo"

    ach /0 body consists o! one or more net"orks. The net"ork in!o area is displayed on the le!t.

    1ere you can !ind the net"ork number, labels and statuses, e.g. !or breakpoints (debug), net"ork

    selection and error messages. The program is displayed in the right o! the programming "indo".

    +omments can be inserted using the symbol.

    +onnecting /b#ects

    The LD and FBD contain t"o editing modes selection mode (cursor 2 arro") and

    interconnector mode (cursor 2 pen). In selection mode, you can select programming symbols, e.g.

    contacts, and position or edit them in the programming "indo". In interconnect mode, you can

    dra" the lines that connect the programming symbols to each other. The selection mode is the

    de!ault mode. 3ou can change to the interconnect mode via

    dit 4 Dra" Line, the 5Dra" Line5 command is checked i! active

    +lick in the tool bar, or select the 5Dra" Line5 command in the pop6up menu

    (right mouse button)

    ress 78+9 or double6click on an empty space "ithin the programming "indo" to leave the

    interconnect mode. rogramming symbols that do not have any connection points cannot be

    selected in interconnect mode. Logical elements, input and output variables, #umps and

    back"ard #umps can also be positioned in interconnect mode.

  • 7/26/2019 Plc Programming Manual

    3/17

    Time6saver !eatures o! the gra!ical editors

    -hen inserting !unctions, !unction blocks and operators in the /0 body, these

    programming symbols are automatically e:uipped "ith empty input;output variables

    and name bo 7a9 to select all net"orks "ithin one /

    0se 7Tab9 to #ump "ithin one net"ork !rom a editing !ield, e.g. variable name to

    another. ?ump back"ards "ith 78hi!t9 > 7Tab9.

    Tools 4 @inimiAe &et"ork enables you to optimiAe the height o! the net"ork.

    Double6click on an empty space "ithin the programming "indo" to change !rom the

    interconnect mode to select mode and vice versa.

    ress 78+9 to leave the interconnect mode.

    +ommand Buttons in the Tool Bar

  • 7/26/2019 Plc Programming Manual

    4/17

    -hen you open an LD or FBD body, the !ollo"ing buttons appear in the tool bar

    I+

    /&

    Description

    Inserts a ne" net"ork be!ore the selected net"ork.

    Inserts a ne" net"ork a!ter the selected net"ork.

    Deactivates;activates the selected net"ork. Deactivated net"orks are treated like comments and

    are there!ore not compiled.

    8"itches bet"een interconnect mode (Dra" Line) and selection mode.

    /pens the Cariable 8election dialog bo< i! a name bo< !or an input;output variable is selected.

    /pens the /;F0&;FB 8election dialog bo< !rom "hich you can select operators, !unctions or

    !unction blocks and insert them in the programming "indo" "ith a le!t6click at the desired

    position.

    Inserts a name bo< !or an variable in the programming "indo". Le!t6click at the desired

    position.Inserts a #ump.

    Inserts a back"ard #ump (return).

    Inserts a comment.

    +hanges the vertical distance.

    +hanges the horiAontal distance.

    In addition, LD includes the !ollo"ing symbols in the tool bar

    Inserts a contact in the programming "indo". Le!t6click at the desired position.

    Inserts a coil in the programming "indo". Le!t6click at the desired position.

    op6up @enu

    -hen you click the right mouse button any"here in the programming "indo", a pop6up menu opens.

    This menu contains many use!ul commands. $ list o! the last operators, !unctions or !unction blocks

    used appears in the bottom part o! the pop6up menu.

    nable Input and nable /utput

  • 7/26/2019 Plc Programming Manual

    5/17

    In FBD and LD you can program !or conditions by using &;&/ !unctions and !unction blocks.

    & stands !or enable input, &/ !or enable output.

    $ll I+ !unctions and !unction blocks are available both "ith and "ithout & and &/. The

    E@/C !unction does and the @/C !unction does not have an &;&/, !or e

  • 7/26/2019 Plc Programming Manual

    6/17

    enter;change variable names

    e

  • 7/26/2019 Plc Programming Manual

    7/17

    IF Send THEN(* Copy characters of the variable SendString to the SendBuffer!"*#(* SendBuffer$" %ill be used by F!&&'TNS) The nuber of bytes notyet transitted is stored in SendBuffer$" at each transission *#

    F10_BKMV( s1_Start+, Adr_Of_VarOffs( SendString- StringHeaderSize#-

    s2_End+, AdrLast_Of_Var( SendString#- d_Start+,SendBuffer!"#.(* Send the inforation of the SendBuffer *#

    F144_TRNS( s_Start+, SendBuffer$"- n_Control+, LEN(SendString##.EN/'IF.

  • 7/26/2019 Plc Programming Manual

    8/17

    8tring

    Time

    JThis is a teG

    Function +all !unction Fun%(a,b,c)

    /perators

    /perator Description recedence

    ( ) arentheses, +all up !unction 1igh

    Lo"est

    6

    &/T

    &egation

    +omplement

    MM

    M

    ;

    @/D

    Haise to a po"er

    @ultiplication

    Division

    @odulo (Hemainder)

    >

    6

    $ddition

    8ubtraction

    9,7 92,72 +omparison2

    7 9

    :ual

    &ot :ual

    N, $&D Boolean $&D

    O/H Boolean e

  • 7/26/2019 Plc Programming Manual

    9/17

    . the identi!ier on the le!t

    +alling

    Functions

    Y+,SIN(x).

    Y+,LIMIT(MN+,$-IN+,X-

    MX:=!$$).

    FunctionPs argument in shorthand

    Function arguments "ith !ormal

    parameters

    &ote

    The order does not matter !or arguments"ith !ormal parameters.

    -ith user !unctions, the & input and

    output can be omitted. /mitted & "ill

    be interpreted as TH0.Y+,LIMIT($- X- !$$). Function arguments "ithout !ormal

    parameters

    &ote

    The order matters !or arguments "ithout

    !ormal parameters.

    The case o! letters is not signi!icant+alling FBs TON1( IN+, Start1-

    PT+,T:;$$s -

    Q,< End1 -

    EV,< EV_1 ).

    Function block arguments "ith

    !ormal parameters

    &ote

    The order does not matter !or arguments

    "ith !ormal parameters.Ton1(IN+,Start1-

    PT+,T:;$$s#.

    End1+,Ton1.Q.

    Ev1+,Ton1.EV.

    Function block arguments "ithout

    !ormal parameters

    &ote

    The order matters !or arguments "ithout

    !ormal parameters.

    The case o! letters is not signi!icant.Ton1.IN+,Start1.

    Ton1.PT+,T:;$$s.

    Ton1(#.

    IF Ton1.Q THEN....

    EN/'IF.

    0nlimited use o! !ormal parameters

    in program called

    IF +onditional

    divergence

    IF a i+,$ T> !$$ />SUM+,SUM 2 ai"

    EN/'F>.

    F> i+,$ T> !$$ B? !$/>

    De!ined number o! loops "ith preset

    step "idth %

    or "ith user6de!ined step "idth

    &ote

  • 7/26/2019 Plc Programming Manual

    10/17

    IF ai".

    Do not use the value o! the control

    variable (i in this e

    ai"

  • 7/26/2019 Plc Programming Manual

    11/17

    Insertion 8hortcuts

    The !ollo"ing shortcuts "ill save your time in programming.

    Insertion template !or OP/F)%/FB

    . Enter te instru+tion into te programming (indo(0 e.g ,1L

    2. Press ,trg3 4 F3

    -ith a !unction. e.g 81L, the !ollo"ing could appearSH=( IN+, 1N?'BIT - N+, 1N?'BIT #.

    . 1igligt te data tpes #et(een te "uestionsmar50 e.g. # dou#le +li+5ing.

    *. Enter operands

    For help, you can also place the cursor on the name o! a !unction or a !unction block and then

    press 7F%9.

    !nsertion template for spe+ifi+ation or repeating instru+tions'

    For the instructions IF, +$8, F/H, -1IL, H$T, OIT, HT0H&, an insertion template is at

    your disposal. This "ill ease your "orking "ith the 8T ditor.

    %. Pla+e te +ursor on or dire+tl #eind te instru+tion0 e.g. !F

    '. Press Ctrl3 4 F3

    -ith the instruction IF, the !ollo"ing could appear

    IF B>>= THEN E=SIF B>>= THEN E=SE

    EN/'IF.

    . 1igligt te parameter #et(een te "uestionmar5s0 e.g. # dou#le +li+5ing

    *. Enter te desired parameter

    /;F0&;FB 8election

    3ou can enter the name o! an operator a !unction directly in the editor. $ !unction block is entered by

    the name o! its instance in the dialog variable selection.

    rocedure.

    . Cli+5 or ools OP/F)%/FB ,ele+tion or ,ift3 4 F23

    The dialog bo< /;F0&;FB 8election is opened.

    2. Coose OP0 F)% or FB

    6. !nsert (it 7!nsert -3 Bod8 or # dou#le-+li+5ing in te editor

    9. Create parameter list (it te insertion template or enter parameters dire+tl into te

    editor

    Insert /perands

  • 7/26/2019 Plc Programming Manual

    12/17

    3ou can enter the name o! the variable or instances o! !unction blocks as te

  • 7/26/2019 Plc Programming Manual

    13/17

    e

    Instruction list (IL) "ith three net"orks

    % +omments

    ' /perands

    /perators

    ach /0 body consists o! one or more net"orks. In the le!t o! the net"ork in!o area, the labels

    (8tart 8top ) and statuses, e.g. !or breakpoints, net"ork selection and error messages, are displayed.

    The program is displayed on the right in the programming "indo". It is subdivided into three

    columns /perators, /perands and +omments. The comments are restricted by brackets and asterisks

    (M M). +omments can be several lines long and positioned any"here in the programming "indo".

    mpty lines in the body are permissible. ach body can contain SkB ma

  • 7/26/2019 Plc Programming Manual

    14/17

    8F+ rogram

    % Initial 8tep

    ' Transition

    8tep

    * Divergence +onvergence

    S Final 8tep

    The !ollo"ing symbols are used

    %. 8T

    $ step is a part6task, e.g. s"itch on motor.

  • 7/26/2019 Plc Programming Manual

    15/17

    -hen you s"itch the L+ !rom H/V to H0& mode, the initial step is the !irst step to be

    activated. The steps are processed one a!ter the other. /nce the !inal step has been processed,

    the initial step is reactivated etc. 3ou can assign one or more actions to each step. I! you do

    not assign an action to a step, the step has a "ait !unction until the subse:uent transition is

    !ul!illed. $ctions are entered under $ctions in the pro#ect navigator and can be Boolean

    variables or programs in LD, 8T, IL or FBD. They can be assigned to one or more steps.

    -henever a step is active, the actions assigned to it are e

  • 7/26/2019 Plc Programming Manual

    16/17

    The transition is regarded as !ul!illed once the assigned variable or address is TH0.

    $ transition condition (e.g. 5&/T bCar5 or 5bCar% N bCar'5)

    The transition is regarded as !ul!illed i! the calculation result o! the 8T program code isTH0. $ program in IL, FBD, LD or 8T programming language

    The transition is regarded as !ul!illed once the variable "ith the name o! the transition is

    TH0. The variable "ith the transition name is automatically declared by +ontrolF-I& ro.

    . $H$LLL DICHV&+

    $ parallel divergence is marked by a double horiAontal line. -hen the transition is !ul!illed

    be!ore the parallel divergence, t"o or more steps are e

  • 7/26/2019 Plc Programming Manual

    17/17

    &o matter "hich step is e