min (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


The min function takes two numbers as parameters and returns the value of the lowest of the two numbers.

 

Input:

a : DINT

The first value.

 

b : DINT

The second value.

 

Returns: DINT

The lowest value..

 

Declaration:

FUNCTION min : DINT;
VAR_INPUT
  a : DINT;
  b : DINT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  number1 : INT;
  number2 : INT;
  result : INT;
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
  result:=INT(min(a:=number1, b:=number2));
  ...
END;
 
END_PROGRAM;