Extended instructions
9.2 String and character
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
353
● 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.
Conditions reported by ENO
When the conversion operation encounters an error, the instruction returns the following
results:
● ENO is set to 0.
● OUT is set to 0, or as shown in the examples for string to value conversion.
● OUT is unchanged, or as shown in the examples when OUT is a string.
Table 9- 30 ENO status
0 Illegal or invalid parameter; for example, an access to a DB that does not exist
Illegal string where the maximum length of the string is 0 or 255
0 Illegal string where the current length is greater than the maximum length
The converted number value is too large for the specified OUT data type.
0 The OUT parameter maximum string size must be large enough to accept the number of characters
specified by parameter SIZE, starting at the character position parameter P.
Illegal P value where P=0 or P is greater than the current string length
Parameter SIZE must be greater than parameter PREC.