![background image](http://html1.mh-extra.com/html/omron/sysmac-cx-programmer-9/sysmac-cx-programmer-9_operation-manual_744241170.webp)
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 SYSMAC CX-Programmer 9
Page 2: ......
Page 4: ...iv ...
Page 6: ...vi ...
Page 8: ......
Page 16: ...xvi ...
Page 20: ...xx ...
Page 26: ...xxvi Application Precautions 4 ...
Page 27: ...Part 1 Function Blocks ...
Page 28: ......
Page 154: ...128 Procedures Section 3 2 ...
Page 155: ...Part 2 Structured Text ST ...
Page 156: ......
Page 160: ...134 CX Programmer Specifications Section 4 2 ...
Page 206: ...180 Procedures Section 6 1 ...
Page 208: ...182 System defined external variables supported in function blocks Appendix A ...
Page 230: ...204 Revision History ...
Page 231: ......