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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

10.9 Call SFC<br />

Format<br />

Description<br />

CALL SFC n<br />

Program Control Instructions<br />

Note<br />

If you are working in the <strong>STL</strong> Editor, the reference (n) must relate to existing valid<br />

blocks. You must also define the symbolic names prior to use.<br />

This instruction is intended to call the standard functions (SFCs) supplied by<br />

Siemens. The CALL instruction calls the SFC that you entered as address,<br />

independent of the RLO or other conditions. After processing the called block,<br />

processing continues with the program for the calling block. The address for the logic<br />

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

Passing parameters (incremental edit mode)<br />

Status word<br />

The calling block can exchange parameters with the called block via the variable list.<br />

The variable list is extended automatically in your <strong>Statement</strong> <strong>List</strong> program when you<br />

enter a valid CALL instruction.<br />

If you call a system function and the variable declaration table of the called block has<br />

IN, OUT, and IN_OUT declarations, these variables are added in the program for the<br />

calling block as a list of formal parameters.<br />

When calling the system function, you must assign actual parameters in the calling<br />

logic block to the formal parameters.<br />

The IN parameters can be specified as constants or as absolute or symbolic<br />

addresses. The OUT and IN_OUT parameters must be specified as absolute or<br />

symbolic addresses. You must ensure that all addresses and constants are<br />

compatible with the data types to be transferred.<br />

CALL saves the return address (selector and relative address), the selectors of the<br />

two open data blocks, and the MA bit in the B (block) stack. In addition, CALL<br />

deactivates the MCR dependency, and then creates the local data area of the block<br />

to be called.<br />

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

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

Example: Calling an SFC without parameters<br />

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

CALL SFC43 //Call SFC43 to re-trigger watchdog timer (no parameters).<br />

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

A5E00706960-01 10-13

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

Saved successfully!

Ooh no, something went wrong!