Siemens SIMATIC S7-200 System Manual page 118

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

S7-200 Programmable Controller System Manual
Figure 6-15 describes the format operand for the Integer to ASCII instruction. 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.
Figure 6-15 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 output buffer is formatted according to the
following rules:
Positive values are written to the output buffer without a sign.
-
Negative values are written to the output buffer with a leading minus sign (--).
-
Leading zeros to the left of the decimal point (except the digit adjacent to the decimal point)
-
are suppressed.
Values are right-justified in the output buffer.
-
FMT
MSB
7
6
5
4
0
0
0
0
c = comma (1) or decimal point (0)
nnn = digits to right of decimal point
Figure 6-15
FMT Operand for the Integer to ASCII (ITA) Instruction
Operation of the Double Integer to ASCII Instruction
The Double Integer to ASCII (DTA) instruction converts a
double word IN to an array of ASCII characters. The format
operand FMT specifies the conversion precision to the right
of the decimal. The resulting conversion is placed in 12
consecutive bytes beginning with OUT.
The size of the output buffer is always 12 bytes.
Figure 6-16 describes the format operand for the Double Integer to ASCII instruction. 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.
Figure 6-16 shows examples of values that are formatted using a decimal point (c=0) with four
digits to the right of the decimal point (nnn=100). The output buffer is formatted according to the
following rules:
Positive values are written to the output buffer without a sign.
-
Negative values are written to the output buffer with a leading minus sign (--).
-
Leading zeros to the left of the decimal point (except the digit adjacent to the decimal point)
-
are suppressed.
Values are right-justified in the output buffer.
-
104
LSB
3
2
1
0
c
n
n
n
Out
Out Out Out
+1
+2
in=12
in=- -123
- -
in=1234
in = - -12345
- -
1
Error conditions that set ENO = 0
H 0006 (indirect address)
H Illegal format
H nnn > 5
Out
Out
Out
Out
+3
+4
+5
+6
+7
0
.
0
1
2
0
.
1
2
3
1
.
2
3
4
2
.
3
4
5

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents