You are on page 1of 1

S7-200 Instruction Set Chapter 6

Valid Input Strings Valid Input Strings


for Integer and Double Integer for Real Numbers Invalid Input Strings
Input String Output Integer Input String Output Real Input String
‘123’ 123 ‘123’ 123.0 ‘A123’
‘--00456’ --456 ‘--00456’ --456.0 ‘ ’
‘123.45’ 123 ‘123.45’ 123.45 ‘++123’
‘+2345’ 2345 ‘+2345’ 2345.0 ‘+--123
‘000000123ABCD’ 123 ‘00.000000123’ 0.000000123 ‘+ 123’

Figure 6-21 Examples of Valid and Invalid Input Strings

Example: String Conversion: Substring to Integer, Double Integer and Real


Network 1 //Converts the numeric string to an integer.
//Converts the numeric string to a double integer.
//Converts the numeric string to a real.
LD I0.0
STI VB0,7,VW100
STD VB0,7,VD200
STR VB0,7,VD300

VB0 VB11
11 ’T’ ’e’ ’m’ ’p’ ’ ’ ’ ’ ’9’ ’8’ ’.’ ’6’ ’F’

After executing the network:


VW100 (integer) = 98
VD200 (double integer) = 98
VD300 (real) = 98.6

111

You might also like