144
ST Language Configuration
Section 5-4
Note
The data type returned for numerical functions is the same as that used in the
argument. Therefore, variables substituted for function return values must be
the same data type as the argument.
Text String Functions
The following functions can be used with CS/CJ-series CPU Units with unit
version 4.0 or later, or CJ2-series CPU Units.
EXPT (
base, expo-
nent
)
Base
REAL,
LREAL
REAL, LREAL
Exponential: Base
exponent
a: = EXPT (b, c)
(*Exponential with variable
b
as the base and variable
c
as the exponent is stored in
variable
a
*)
Exponent
INT,
DINT,
LINT,
UINT,
UDINT,
ULINT
Function
Argument data type
Return value
data type
Description
Example
Function
Argument data type
Return
value
data type
Description
Example
LEN(
String)
String
STRING
INT
Detects the length
of a text string.
a: = LEN (b)
(*number of characters in string
b
stored in variable
a
*)
LEFT(<
Source_string
>,
<
Number_of_characters
>)
Source_
string
STRING
STRING
Extracts charac-
ters from a text
string starting from
the left.
a: = LEFT (b,c)
(*number of characters specified
by variable
c
extracted from the
left of text string
b
and
stored in
variable
a
*)
Number_of_
characters
INT,
UINT
RIGHT(<
Source_string
>,
<
Number_of_characters
>)
Source_
string
STRING
STRING
Extracts charac-
ters from a text
string starting from
the right.
a: = RIGHT (b,c)
(*number of characters specified
by variable
c
extracted from the
eight of text string
b
and
stored
in variable
a
*)
Number_of_
characters
INT,
UINT
MID(<
Source_string
>,
<
Number_of_characters
>,
<
Position
>)
Source_
string
STRING
STRING
Extracts charac-
ters from a text
string.
a: = MID (b,c,d)
(*number of characters specified
by variable
c
extracted from text
string
b
starting at position spec-
ified by variable
d
and
stored in
variable
a
*)
Number_of_
characters
INT,
UINT
Position
INT,
UINT
CON-
CAT(<
Source_string_1
>,<
S
ource_string_2>,...)
*Up to
32 source strings.*
Source_
string
STRING
STRING
Concatenates text
strings.
a: = CONCAT (b,c...)
(*text strings
b, c...
are joined
and stored in variable
a
*)
INSERT(<
Source_string
>,
<
Insert_string
>,<
Position
>)
Source_
string
STRING
STRING
Insert one text
string into another.
a: = INSERT (b,c,d)
(*text string
c
inserted into text
string
b
at position specified by
variable
d
and
resulting string
stored in variable
a
*)
Insert_
string
STRING
Position
INT,
UINT
DELETE(<
Source_string
>,
<
Number_of_characters
>,
<
Position
>)
Source_
string
STRING
STRING
Deletes characters
from a text string.
a: = DELETE (b,c,d)
(*number of characters specified
by variable
c
deleted from text
string
b
starting from position
specified by variable
d
and
resulting string
stored in variable
a
*)
Number_of_
characters
INT,
UINT
Position
INT,
UINT
Summary of Contents for CX-PROGRAMMER V8.1
Page 3: ...iv...
Page 5: ...vi...
Page 7: ......
Page 15: ...xvi...
Page 19: ...xx...
Page 25: ...xxvi Application Precautions 4...
Page 26: ...Part 1 Function Blocks...
Page 27: ......
Page 153: ...128 Procedures Section 3 2...
Page 154: ...Part 2 Structured Text ST...
Page 155: ......
Page 159: ...134 CX Programmer Specifications Section 4 2...
Page 205: ...180 Procedures Section 6 1...
Page 207: ...182 System defined external variables supported in function blocks Appendix A...
Page 229: ...204 Revision History...
Page 230: ......