
PLC programming
Library
General functions
8
8.8
8.8.1
l
362
EDSTCXN EN 2.0
8.8.1.3 Format
FUNCTION FORMAT: INT
VAR_INPUT
string_s : STRING(255); (* target string *)
FORMAT_S : STRING(80); (* Format string *)
PARAMETER_P : DINT; (* Address of a structure or variable *)
END_VAR
All characters in the format string which are not part of the format definition
will be copied into STRING_S.
Format string: The % sign in a format string opens a format definition with
the general form:
% Flag output field lengths Accuracy Data type declaration
Flag
<nothing> flush right, leading spaces / nulls
− flush left, following spaces / nulls
+ Always output operational sign
Output field length
0n min. n digits, fill with nulls
n min. n digits, fill with spaces
Accuracy
<nothing> 6 digits
.0 do not output a decimal point
.n output max. n digits after the decimal point
Data type (CoDeSys) Data type definition (format string)
DWORD u
DINT D
LREAL lf
STRING s
The returned value corresponds to the number of characters which have
been copied to the string STRING_S.
Declaration
Description
rasha