26.10.2012 Views

Statement List (STL) - DCE FEL ČVUT v Praze

Statement List (STL) - DCE FEL ČVUT v Praze

Statement List (STL) - DCE FEL ČVUT v Praze

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

10.12 CC Conditional Call<br />

Format<br />

Description<br />

Status word<br />

Example<br />

CC <br />

Program Control Instructions<br />

CC (conditional block call) calls a logic block if RLO=1. CC<br />

is used to call logic blocks of the FC or FB type without parameters. CC is used in the<br />

same way as the CALL instruction except that you cannot transfer parameters with<br />

the calling program. The instruction saves the return address (selector and relative<br />

address), the selectors of the two current data blocks, as well as the MA bit into the B<br />

(block) stack, deactivates the MCR dependency, creates the local data area of the<br />

block to be called, and begins executing the called code. The address for the logic<br />

block can be specified absolutely or symbolically.<br />

BR CC 1 CC 0 OV OS OR STA RLO /FC<br />

writes: - - - - 0 0 1 1 0<br />

<strong>STL</strong> Explanation<br />

A I 2.0 //Check signal state at input I 2.0.<br />

CC FC6 //Call function FC6 if I 2.0 is "1".<br />

A M 3.0 //Executed upon return from called function (I 2.0 = 1) or directly after<br />

A I 2.0 statement if I 2.0 = 0.<br />

Note<br />

If the CALL instruction calls a function block (FB) or a system function block (SFB),<br />

an instance data block (DB no.) must be specified in the statement. For a call with the<br />

CC instruction, you cannot assign a data block to the address in the statement.<br />

Depending on the network you are working with, the Program Editor either generates<br />

the UC instruction or the CC instruction during conversion from the Ladder Logic<br />

programming language to the <strong>Statement</strong> <strong>List</strong> programming language. You should<br />

attempt to use the CALL instruction instead to avoid errors occurring in your<br />

programs.<br />

<strong>Statement</strong> <strong>List</strong> (<strong>STL</strong>) for S7-300 and S7-400 Programming<br />

A5E00706960-01 10-15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!