Table of Contents

LIMIT

Function name

LIMIT

ST call

PROGRAM LIMIT_DEMO
 VAR
     REAL1,REAL2: REAL;
  END_VAR
 REAL2:= LIMIT(IN:=REAL1, MN:= 0, MX:=10); //LZE VOLAT I JAKO REAL2:= LIMIT(REAL1, 0, 10)
END_PROGRAM

Description

Limits the output value in the ranges from MN (minimum) to MX (maximum). The function can be also described as MIN(MAX(IN,MN),MX).

Inputs

InputType Description
IN ANY_ELEMENTARYInput value
MN ANY_ELEMENTARYMinimum value
MX ANY_ELEMENTARYMaximum value

Outputs

OutputType Description
ANY_ELEMENTARYOutput value

Application example