Tc2_Utilities

Compatibility library for Beckhoff’s TwinCAT 3 Tc2_Utilities PLC library: utility and formatting functions. Activated by a project reference or --library Tc2_Utilities.

Functions

Name

Signature

Description

LREAL_TO_FMTSTR

LREAL_TO_FMTSTR(in : LREAL, iPrecision : INT, bRound : BOOL) : STRING

Formats in as a fixed-point decimal string with iPrecision digits after the decimal point (clamped to 0..15). When bRound is TRUE the last place is rounded (half away from zero); when FALSE it is truncated toward zero. Values that cannot be rendered (NaN, infinities, magnitudes of 263 or more) return an empty string.

The formal parameter names (in, iPrecision, bRound) match the vendor’s documented names.

Example

text := LREAL_TO_FMTSTR(in := 3.14159, iPrecision := 2, bRound := TRUE);
(* text = '3.14' *)

Independence

IronPLC is an independent open-source project and is not affiliated with, endorsed by, or sponsored by the vendors whose library interfaces the compatibility libraries reproduce. Each compatibility library is authored independently from the vendor’s public documentation and contains no vendor code. See Trademarks.

See Also