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.

Program Control Instructions<br />

Status word<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 current data blocks, as well as 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 1: Assigning parameters to the FC6 call<br />

CALL FC6<br />

Formal parameter Actual parameter<br />

NO OF TOOL := MW100<br />

TIME OUT := MW110<br />

FOUND := Q 0.1<br />

ERROR := Q 100.0<br />

Example 2: Calling an SFC without parameters<br />

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

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

Example 3: Calling FB99 with instance data block DB1<br />

CALL FB99,DB1<br />

Formal parameter Actual parameter<br />

MAX_RPM := #RPM1_MAX<br />

MIN_RPM := #RPM1<br />

MAX_POWER := #POWER1<br />

MAX_TEMP := #TEMP1<br />

Example 4: Calling FB99 with instance data block DB2<br />

CALL FB99,DB2<br />

Formal parameter Akcual parameter<br />

MAX_RPM := #RPM2_MAX<br />

MIN_RPM := #RPM2<br />

MAX_POWER := #POWER2<br />

MAX_TEMP := #TEMP2<br />

Note<br />

Every FB or SFB CALL must have an instance data block. In the example above, the<br />

blocks DB1 and DB2 must already exist before the call.<br />

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

10-6 A5E00706960-01

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

Saved successfully!

Ooh no, something went wrong!