program struct control inst

Upload: shailesh284

Post on 03-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Program Struct Control Inst

    1/10

    SIMATIC S5

    Methods of Programming

    1-10

    Linear Structured

    All Instructions are contained

    in one block (OB1). Linear Programming is like a

    fixed -wired logic.

    All instructions are repeatedly

    carried out line by line

    This block is executed continuously.

    Reusable functions are loaded

    into individual blocks. OB1 calls up these blocks and

    passes on the relevant data.

    Some concrete information is

    made available to the instruction

    for jumping from one block to the

    other block.

  • 7/28/2019 Program Struct Control Inst

    2/10

    SIMATIC S5

    2-10

    Statement 1

    Statement 2

    ...................

    ....................

    ....................

    ........................................

    Block End

    OB1

    JU PB10

    Statement 2

    ...................

    JU FB10

    ....................

    ........................................

    Block End

    JU PB20

    Statemt 2

    BE

    Statemt 1

    BE

    Statemt 1

    BE

    OB1 PB10 PB20

    FB10

    Linear Structured

  • 7/28/2019 Program Struct Control Inst

    3/10

    SIMATIC S5

    STEP - 5 SOFTWARE BLOCKS

    Organisation Block Organisation block forms the interface between

    operating system and the user program.

    Organisation blocks are divided into 2 categories : -

    1> Those called by system in response to events.

    2> Those called by user.

    OBs called by system program control:-

    - Cyclic.- Interrupt - driven.

    - Time - controlled program execution.

    It is user programming block. Only basic operations may be programmed in these blocks

    It is mainly used for programming various process related

    functions (eg. actuators , sensors, limit switches etc. )

    Programming Block

    3-10

  • 7/28/2019 Program Struct Control Inst

    4/10

    SIMATIC S5

    STEP - 5 SOFTWARE BLOCKS

    Function BlockFunction blocks are special blocks for programming

    frequently recurring parts of program.

    FBs are divided into two types :

    1> Standard or Pretested function blocks.

    2> Programmable function blocks.

    In FB it is possible to assign the parameters or operands. Only STL programming is possible.

    Data blocks store data needed to process a control program. Example: Actual Values.

    Limiting Values.

    Result of arithmetic operation etc.

    Data Block

    4-10

  • 7/28/2019 Program Struct Control Inst

    5/10

    SIMATIC S5

    Program Control Instructions

    5-10

    JC : Jump ConditionallyProgram Scanning jumps to different Blocks

    when the RLO is 1.

    Otherwise continues in the same Block.

    JC PB 100

    PB 20 PB 100

    A I 0.0

  • 7/28/2019 Program Struct Control Inst

    6/10

    SIMATIC S5

    Program Control Instructions

    6-10

    BE : Block EndThe BE operation terminates the Block. The Data Block need not be terminated.

    JU PB 100

    OB1 PB 100

    BE

  • 7/28/2019 Program Struct Control Inst

    7/10

    SIMATIC S5

    Program Control Instructions

    7-10

    BE : Block EndThe BE operation terminates the Block. The Data Block need not be terminated.

    JU PB 100

    OB1 PB 100

    BE

  • 7/28/2019 Program Struct Control Inst

    8/10

    SIMATIC S5

    Program Control Instructions

    8-10

    BEU: Block End Unconditionally

    JU PB 100

    OB1 PB 100

    BEU

    BE

    BEC: Block End Conditionally

    JU PB 100

    OB1 PB 100

    BEC

    BE

    A I 0.0

    Block is ended when RLO is 1

    otherwise it continues with next

    statements.

  • 7/28/2019 Program Struct Control Inst

    9/10

    SIMATIC S5

    Result of Logic Operation with Block End Operations BE and BEC

    9-10

    = Unconditional block end

    RLO remains unchanged until the next signal state check.

    = Conditional block end

    Yes No

    Return to block previously being executed

    RLO remains unchanged.

    RLO remains unchanged until the next signal state check operation !

    No return !

    RLO changes from '0' to '1'.

    Return to block previously being executed.

    BE, BEU

    A I 0.4

    BEB

    RLO = '1'?

  • 7/28/2019 Program Struct Control Inst

    10/10

    SIMATIC S5

    3-27

    Result of Logic Operation with Jump Operations JU and JC

    10-10

    = Unconditional block call

    Jump to block PB xxx

    RLO remains unchanged until the next signal state check.

    = Conditional block call

    Yes No

    Jump to block PB xxx

    RLO remains unchanged.

    RLO remains unchanged until the next signal state check operation!

    No jump !

    RLO changes from '0' to '1'.

    JU PB xxx

    A I 0.3

    JC PB xxx

    RLO = '1'?