The following figure also shows examples of values that are formatted using a decimal point
(c= 0) with three digits to the right of the decimal point (nnn = 011). The value at OUT is the
length of the string stored in the next byte addresses.
FMT parameter for the integer to string instruction
Double integer to string conversion
LAD / FBD
STL
DTS IN, OUT, FMT
Non-fatal error conditions with ENO = 0
0006H indirect address
•
0091H operand out of range
•
Illegal format (nnn > 5)
•
FMT bit is not zero for the four most signif-
•
icant bits of the FMT byte
Input / output
Data type
IN
DINT
FMT
BYTE
OUT
STRING
The length of the output string is always 12 characters. The number of digits to the right of
the decimal point in the output buffer is specified by the nnn field. The valid range of the nnn
field is 0 to 5. If you assign 0 digits to the right of the decimal point causes, then the value is
displayed without a decimal point. For values of nnn greater than 5, the output is a string of
12 ASCII space characters. The c bit specifies the use of either a comma (c=1) or a decimal
point (c=0) as the separator between the whole number and the fraction. The upper 4 bits of
the format must be zero.
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
Description
The Double Integer to String instruction converts a double integer IN to an
ASCII string with a length of 12 characters. The format (FMT) assigns the
conversion precision to the right of the decimal, and whether the decimal
point is to be shown as a comma or a period. The resulting string is writ-
ten to 13 consecutive bytes starting at OUT.
SM bits affected
None
Operand
ID, QD, VD, MD, SMD, SD, LD, AC, HC, *VD, *LD, *AC, Constant
IB, QB, VB, MB, SMB, SB, LB, AC, *VD, *LD, *AC, Constant
VB, LB, *VD, *LD, *AC
Program instructions
7.5 Convert
247