Chapter 8 Logic Instructions
8.12.6 Strings_TO_***
FB/FC
Explanation
FC
Strings_TO_*** instructions convert String data into the data of basic data
types. “***” can be any basic data type.
DVP15MC11T
Parameters
Meaning Input/ Output
Description Valid range
In Data to convert Input Data to convert
Depends on the data type of the
variable that the input parameter is
Out Conversion result
Output Conversion result
Depends on the data type of the
variable that the output parameter is
Boolean
Bit string Integer
Real
number
Time, date
String
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In
●
Out The data type of Out must be the same as “***” of the instruction name.
Note:
The symbol ● indicates that the parameter is allowed to connect to the variable or constant of the data type.
Function Explanation
String to Bool
Relevant instructions:
The rule for the String-to-Bool conversion is that the output Bool value is TRUE only when the
string value is TRUE or true. Otherwise, the output is FALSE.
String to Integer
Strings can be converted to integers. And some instructions are shown below.
STRING_TO_BOOL
EN ENO
Out
In
STRING_TO_SINT
EN ENO
Out
In
STRING_TO_USINT
EN ENO
Out
In
STRING_TO_DINT
EN ENO
Out
In
STRING_TO_ULINT
EN ENO
Out
In
8-173