Specifications

SIMATIC Instructions
9-137
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
The format operand (FMT) for the ITA (Integer to ASCII) instruction is defined in
Figure 9-48. The size of the output buffer is always 8 bytes. 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. Specifying 0 digits to the right of the
decimal point causes the value to be displayed without a decimal point. For values
of nnn bigger than 5, the output buffer is filled with ASCII spaces. 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 must be zero.
The output buffer is formatted in accord with the following rules:
1. Positive values are written to the output buffer without a sign.
2. Negative values are written to the output buffer with a leading minus sign (-).
3. Leading zeros to the left of the decimal point (except the digit adjacent to the
decimal point) are suppressed.
4. Values are right-justified in the output buffer.
Figure 9-48 gives examples of values that are formatted using a decimal point (c =
0) with three digits to the right of the decimal point (nnn = 011).
MSB
LSB
in=12
in = -12345
in=1234
in=-123
Out OutOutOutOut Out Out
+1 +2 +3 +4 +5 +6 +7
Out
.
.
.
.
01 2
1
2
23
23 4
34 51
1
0
-
FMT
Example:
76543210
0000cnnn
0
-
c = comma (1) or decimal point (0)
nnn = digits to right of decimal point
Figure 9-48 FMT Operand for the ITA Instruction