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.

C Parameter Transfer<br />

!<br />

The parameters of a block are transferred as a value. With function blocks a copy of<br />

the actual parameter value in the instance data block is used in the called block. With<br />

functions a copy of the actual value lies in the local data stack. Pointers are not<br />

copied. Prior to the call the INPUT values are copied into the instance DB or to the<br />

L stack. After the call the OUTPUT values are copied back into the variables. Within<br />

the called block you can only work on a copy. The <strong>STL</strong> instructions required for this<br />

are in the calling block and remain hidden from the user.<br />

Note<br />

If memory bits, inputs, outputs or peripheral I/Os are used as actual address of a<br />

function they are treated in a different way than the other addresses. Here, updates<br />

are carried out directly, not via L Stack.<br />

Caution<br />

When programming the called block, ensure that the parameters declared as OUTPUT are<br />

also written. Otherwise the values output are random! With function blocks the value will be<br />

the value from the instance DB noted by the last call, with functions the value will be the<br />

value which happens to be in the L stack.<br />

Note the following points:<br />

• Initialize all OUTPUT parameters if possible.<br />

• Try not to use any Set and Reset instructions. These instructions are dependent on the<br />

RLO. If the RLO has the value 0, the random value will be retained.<br />

• If you jump within the block, ensure that you do not skip any locations where OUTPUT<br />

parameters are written. Do not forget BEC and the effect of the MCR instructions.<br />

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

A5E00706960-01 C-1

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

Saved successfully!

Ooh no, something went wrong!