Lenze PLC Designer PLC Designer (R2-x) Uživatelský manuál Strana 37

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 844
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 36
L-force | PLC Designer
What is What in PLC Designer
DMS 3.2 EN 02/2011 TD29 35
Example of a function Fct in IL, in which three input variables are declared:
The first both input variables get multiplicated and then divided by the third one. The
function returns the result of this operation:
Declaration part:
FUNCTION Fct: INT
VAR_INPUT
PAR1:INT;
PAR2:INT;
PAR3:INT;
END_VAR
Implementation part:
LD PAR1
MUL PAR2
DIV PAR3
ST Fct
Calling a function:
In ST a function call can be used as operand in an expression.
In SFC a function call can only take place within actions of a step or a transition.
Note!
»PLC Designer« allows using global variables within a function. This intentionally
deviates from the IEC61131-3 standard, which prescribes that return value of a
function only will be modified by the input parameters. Thus the difference
between functions and programs is just, that functions return only one return value
and that their parameters and return values are handled over the stack.
Zobrazit stránku 36
1 2 ... 32 33 34 35 36 37 38 39 40 41 42 ... 843 844

Komentáře k této Příručce

Žádné komentáře