Omron WS02-CXPC1-V9 - V9 Operation Manual page 171

Table of Contents

Advertisement

ST Language Configuration
Function
REPLACE(<Source_string
>,<Replace_string>,
<Number_of_characters>,
<Position>)
FIND(<Source_string>,
<Find_string>)
Data Type Conversion
Functions
Syntax
Data Type Combinations
FROM
BOOL
INT
BOOL
No
No
No
INT
No
No
YES
DINT
No
YES
No
LINT
No
YES
YES
UINT
No
YES
YES
UDINT
No
YES
YES
ULINT
No
YES
YES
WORD
No
YES
YES
DWORD
No
YES
YES
LWORD
No
YES
YES
REAL
No
YES
YES
LREAL
No
YES
YES
WORD_
No
YES
YES
BCD
DWORD_
No
YES
YES
BCD
Number-String
Conversion Functions
Syntax
Argument data type
Source_
STRING
string
Replace_
STRING
string
Number_of_
INT,
characters
UINT
Position
INT,
UINT
Source_
STRING
string
Find_string
STRING
The following data type conversion functions can be used in structured text.
Source_data_type_TO_New_data_type (Variable_name)
Example: REAL_TO_INT (C)
In this example, the data type for variable C will be changed from REAL to
INT.
The combinations of data types that can be converted are given in the follow-
ing table.
DINT
LINT
UINT
UDINT
No
No
No
YES
YES
YES
YES
YES
YES
No
YES
YES
YES
No
YES
YES
YES
No
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
No
YES
YES
No
YES
YES
The following number-string conversion functions can be used in structured
text.
Source_data_type_TO_STRING (Variable_name)
Example: INT_TO_STRING (C)
In this example, the integer variable C will be changed to a STRING vari-
able.
STRING_TO_New_data_type (Variable_name)
Example: STRING_TO_INT (C)
Return
Description
value
data type
STRING
Replaces charac-
ters in a text string.
INT
Finds characters
within a text string.
(YES = Conversion possible, No = Conversion not possible)
TO
ULINT
WORD
DWORD LWORD
No
No
No
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
No
YES
YES
YES
No
YES
YES
YES
No
YES
YES
YES
YES
No
No
YES
No
No
No
No
No
No
No
No
Section 5-4
Example
a: = REPLACE (b,c,d,e)
(*number of characters specified
by variable d in source string b
replaced with text string c start-
ing from position specified by
variable e and resulting string
stored in variable a*)
a: = FIND (b,c)
(*first occurrence of text string c
found in text string b and posi-
tion stored in variable a; 0 stored
if text string c is not found.*)
REAL
LREAL
BCD_
WORD
No
No
No
No
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
No
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
YES
No
YES
No
No
No
YES
No
No
No
No
No
No
No
No
No
YES
No
No
YES
No
No
No
No
No
No
No
No
No
No
BCD_
DWORD
No
YES
YES
No
YES
YES
No
No
No
No
No
No
No
No
145

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cx-programmer 9Sysmac ws02-cxpc1-v9

Table of Contents