101BExtended instructions
8.2 String and character
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
247
Conditions reported by ENO
When an error is encountered during the conversion operation, the following results will be
returned:
●
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 8- 32 ENO status
ENO
Description
1
No error
0
Illegal or invalid parameter; for example, an access to a DB that does not exist
0
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
0
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.
0
Illegal P value where P=0 or P is greater than the current string length
0
Parameter SIZE must be greater than parameter PREC.
Table 8- 33 Examples of S_CONV string to value conversion
IN string
OUT data type
OUT value
ENO
"123"
Int or DInt
123
TRUE
"-00456"
Int or DInt
-456
TRUE
"123.45"
Int or DInt
123
TRUE
"+2345"
Int or DInt
2345
TRUE
"00123AB"
Int or DInt
123
TRUE
"123"
Real
123.0
TRUE
"123.45"
Real
123.45
TRUE
"1.23e-4"
Real
1.23
TRUE
"1.23E-4"
Real
1.23
TRUE
"12,345.67"
Real
12345.67
TRUE
"3.4e39"
Real
3.4
TRUE
"-3.4e39"
Real
-3.4
TRUE
"1.17549e-38"
Real
1.17549
TRUE
"12345"
SInt
0
FALSE
"A123"
N/A
0
FALSE
""
N/A
0
FALSE
"++123"
N/A
0
FALSE
"+-123"
N/A
0
FALSE