EasyManua.ls Logo

Siemens SIMATIC S7-1200

Siemens SIMATIC S7-1200
1614 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
9.2 String and character
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
357
9.2.3.2
Strg_TO_Chars and Chars_TO_Strg (Convert to/from character string and array of
CHAR) instructions
Strg_TO_Chars copies an ASCII character string into an array of character bytes.
Chars_TO_Strg copies an array of ASCII character bytes into a character string.
Note
Only the zero based array types (Array [0..n] of Char) or (Array [0..n] of Byte) are allow
ed as
the input parameter Chars for the Chars_TO_Strg instruction, or as the IN_OUT parameter
Chars for the Strg_TO_Chars instruction.
Table 9- 35 Strg_TO_Chars instruction
LAD / FBD
SCL
Description
Strg_TO_Chars(
Strg:=_string_in_,
pChars:=_dint_in_,
Cnt=>_uint_out_,
Chars:=_variant_inout_);
The complete input string Strg is copied to an array of
characters at IN_OUT parameter Chars.
The operation overwrites bytes starting at array element
number specified by the pChars parameter.
Strings of all supported max lengths (1..254) may be used.
An end delimiter is not written; this is your responsibility.
To set an end delimiter just after the last written array
character, use the next array element number
[pChars+Cnt].
Table 9- 36 Data types for the parameters (Strg_TO_Chars)
Parameter and type
Data type
Description
Strg
IN
String, WString
Source string
pChars IN DInt Array element number for the first string character written to
the target array
Chars IN_OUT Variant The Chars parameter is a pointer to a zero-based array
[0..n] of characters copied from the input string. The array
can be declared in a DB or as local variables in the block
interface.
Example: "DB1".MyArray points to MyArray [0..10] of Char
element values in DB1.
Cnt
OUT
UInt
Count of characters copied

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals