EasyManua.ls Logo

Siemens S7-1200 - Page 296

Siemens S7-1200
1028 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Extended instructions
8.2 String and character
S7-1200 Programmable controller
296 System Manual, 03/2014, A5E02486680-AG
STRG_VAL (convert characer string to numerical value)
Table 8- 22 String-to-value instruction
LAD / FBD
SCL
Description
"STRG_VAL"(
in:=_string_in,
format:=_word_in,
p:=uint_in,
out=>_variant_out);
Converts a number character string to the corresponding
integer or floating point representation.
1
For LAD / FBD: Click the "???" and select the data type from the drop-down list.
Table 8- 23 Data types for the STRG_VAL instruction
Parameter and type
Data type
Description
IN
IN
String
The ASCII character string to convert
FORMAT
IN
Word
Output format options
P IN UInt, Byte, USInt IN: Index to the first character to be converted (first
character = 1)
OUT OUT SInt, Int, DInt, USInt, UInt, UDInt,
Real, LReal
Converted number value
Conversion begins in the string IN at character offset P and continues until the end of the
string, or until the first character is encountered that is not "+", "-", ".", ",", "e", "E", or "0" to
"9". The result is placed at the location specified in parameter OUT.
String data must be initialized before execution as a valid string in memory.
The FORMAT parameter for the STRG_VAL instruction is defined below. The unused bit
positions must be set to zero.
Table 8- 24 Format of the STRG_VAL instruction
Bit
16
Bit 8
Bit 7
Bit 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
f
r
f = Notation format
1= Exp
onential notation
0 = Fixed point notation
r = Decimal point format
1 = "," (comma character)
0 = "." (period character)

Table of Contents

Other manuals for Siemens S7-1200

Related product manuals