101BExtended instructions
8.2 String and character
S7-1200 Programmable controller
246
System Manual, 11/2011, A5E02486680-05
Table 8- 31 Values of the FORMAT parameter
FORMAT (WORD)
Number sign character
Notation format
Decimal point representation
W#16#0000
"."
W#16#0001
Fixed point
","
W#16#0002
"."
W#16#0003
"-" only
Exponential
","
W#16#0004
"."
W#16#0005
Fixed Point
","
W#16#0006
"."
W#16#0007
"+" and "-"
Exponential
","
W#16#0008 to W#16#FFFF Illegal values
Parameter OUT string format rules:
●
Leading space characters are added to the leftmost part of the string when the converted
string is smaller than the specified size.
●
When the FORMAT parameter sign bit is FALSE, unsigned and signed integer data type
values are written to the output buffer without the leading "+" sign. The "-" sign is used if
required.
<leading spaces><digits without leading zeroes>'.'<PREC digits>
●
When the sign bit is TRUE, unsigned and signed integer data type values are written to
the output buffer always with a leading sign character.
<leading spaces><sign><digits without leading zeroes>'.'<PREC digits>
●
When the FORMAT is set to exponential notation, Real data type values are written to the
output buffer as:
<leading spaces><sign><digit> '.' <PREC digits>'E' <sign><digits without leading zero>
●
When the FORMAT is set to fixed point notation, integer, unsigned integer, and real data
type values are written to the output buffer as:
<leading spaces><sign><digits without leading zeroes>'.'<PREC digits>
●
Leading zeros to the left of the decimal point (except the digit adjacent to the decimal
point) are suppressed.
●
Values to the right of the decimal point are rounded to fit in the number of digits to the
right of the decimal point specified by the PREC parameter.
●
The size of the output string must be a minimum of three bytes more than the number of
digits to the right of the decimal point.
●
Values are right-justified in the output string.