INC

PLCopen motion icon

 FunctionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. - Increase a numerical variable.

Inputs

Input

Data Type

Range

Unit

Default

Description

IN

ANY

 

 

 

Numerical variable (increased after call).

See Data In / Data Out for more information.

Outputs

Output

Data Type

Range

Unit

Description

Q

ANY

 

 

Increased value.

Remarks

  • This function is particularly designed for ST Language.
    • It allows simplified writing as assigning the result of the function is not mandatory.
  • When the function is called, the variable connected to the IN input is decreased and copied to Q.
    • All data types are supported except BOOL and STRING: for these types, the output is the copy of IN.
  • For real values, a variable is decreased by 1.0.
  • For time values, a variable is decreased by 1 ms.
  • The IN input must be directly connected to a variable.
    • It cannot be a constant or complex expression.

FBD Language

FFLD Language

IL Language

Not available.

ST Language

IN := 1;
Q := INC (IN);
(* now: IN = 2 ; Q = 2 *)
INC (IN); (* simplified call *)