L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 693

Advertising
background image

L-force | PLC Designer

General Editors

DMS 4.1 EN 03/2011 TD29

691

Function calls:
Enter the function name in the operator field. The (first) input parameter is to be given
as an operand in a preceding LD operation. If there are further parameters, the next
one must be given in the same line as the function name. The further ones can also be
added in this line, separated by commas, or in subsequent lines.
The function return value will be stored in the accumulator, but ...
Notice the following restriction concerning the IEC standard: A function call with
multiple return values is not possible
, only one return value can be used for a
succeeding operation.
Example: Function GeomAverage, which has three input parameters, is called. The first
parameter is given by X7 in a preceding operation, the second one, "25" is given behind
the function name. The third one is given by variable tvar, either in the same line or in
the subsequent one. The return value is assigned to variable 'Ave':
(corresponding code in Structured Text: Ave := GeomAverage(X7, 25, tvar);)


Function block calls, program calls:
Use the CAL- or CALC operator. Enter the function block instance name resp. the
program name in the operand field (second column) followed by the opening bracket.
Enter the input parameters each in one of the following lines:
First column: operator (parameter name) and „:=“ for input parameters resp. „=>“ for
output parameters
Second column: operand (actual parameter) and „,“ if further parameters follow resp.
„)“ after the last parameter resp. in case of parameter-less calls „()“.
Example: Call of POUToCAll with two input and two output parameters
(corresponding ST code: POUToCall(iCounter := MyCounter, iDecrement:=1000,
bError=>bErr, wError=>wResult);)

Advertising