How to assign the minimum or maximum value of a data type?

If you want to assign the minimum value (= the lower limit) or the maximum value (= the upper limit) of particular →data types, use the terms MIN or MAX. Bear in mind to prefix the term with the type (e.g. INT) and the character #.

This possibility is provided as enhancement to the →IEC-standard and is supported for the following data types:

See "Supported data types (in ST)" about all lower/upper limits of the data types.

Example
PROGRAM Test
VAR
VarInt : INT;
VarWord: WORD;
END_VAR
VarInt := INT#MIN; (* The variable 'VarInt' gets the value '-32768' which is the lower limit of data type 'INT'. *)
VarWord := WORD#MAX; (* The variable 'VarWord' gets the value '16#FFFF' (decimal: '65535') which is the upper limit of data type 'WORD'. *)
END_PROGRAM

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg logi.cals recommends to install and use the most current versions of logi.CAD 3 and the runtime system so that the latest features and problem fixes according to the release notes are provided in the used version.


Did this article help you? Did you find the requested information in this user documentation?
If not, contact the support team of logi.cals. State your questions or suggestions to improve/enhance the user documentation as detailed as possible.