2 Instruction Descriptions
2-272
NJ-series Instructions Reference Manual (W502)
STRING_TO_** (Text String-to-Bit
String Conversion Group)
These instructions convert text strings to bit strings.
* The valid range depends on the data type of Out. Refer to Function for details.
These instructions interpret the content of a text string, In, as a hexadecimal number and convert it to a
bit string.
Basically, the text string in In must consist only of ‘0’ to ‘9’, ‘a’ to ‘f’, and ‘A’ to ‘F’. The following exception
is possible.
• Any continuous blank characters or zeros at the beginning of In are ignored.
• Any single underbars (‘_’) at any location are ignored.
• An error occurs if there are two or more consecutive underbars (‘_’) at any location.
• An error occurs if there are any underbars (‘_’) at the beginning or end.
• An error occurs if there are any underbars (‘_’) between the minus signs (‘−’) or plus sign (‘+’) and the
number at the beginning.
The name of the instruction is determined by the data type of conversion result Out. For example, if Out
is the BYTE data type, the instruction is STRING_TO_BYTE.
Instruction Name FB/FUN Graphic expression ST expression
STRING_TO_** Text String-to-Bit
String Conversion
Group
FUN Out:=STRING_TO_** (In);
"**" must be a bit string data
type.
Variables
Name Meaning I/O Description Valid range Unit Default
In Data to
convert
Input Data to convert *
--- ''
Out Conver-
sion result
Output Conversion result Depends on data type.
--- ---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In OK
Out OKOKOKOK
Function
"**" must be a bit string data type.
(@)STRING_TO_**
EN
In
ENO
Out