CODESYS MAX

MAX is an IEC operator that returns the greatest value among its inputs. It is written as OUT := MAX(IN0, IN1, IN2, ...). The CODESYS example MAX(30,90,40) returns 90, and nested MAX calls are also shown.

Source checked3/3 values · 2026-10-26

Specification

2 sources
Languagestructured text
CodeMAX
Groupmaximum function
SyntaxOUT := MAX(IN0,IN1,IN2,...)
DialectCODESYS

Study notes

  • The operator implements the maximum function.
  • Permitted data types: all.
  • Example: Var1 := MAX(30,90,40); returns 90.
  • Nested example: Var1 := MAX(40,MAX(90,30));
  • The syntax allows multiple inputs: IN0, IN1, IN2, ...
↑↓ navigate↵ openesc close