2 Instruction Descriptions
2-426
NJ-series Instructions Reference Manual (W502)
HexStringToNum_**
The HexStringToNum_** instruction converts a hexadecimal text string to an integer.
The HexStringToNum_** instruction converts hexadecimal text string In to an integer. Any spaces
(16#20) or ‘0’ (16#30) in the upper digits are ignored. Underbars (16#5F) in the text string are ignored.
The name of the instruction is determined by the data type of Out. For example, if Out is the INT data
type, the instruction is HexStringToNum_INT.
A few examples are given below.
Instruction Name FB/FUN Graphic expression ST expression
HexStringTo
Num_**
Hexadecimal Text
String-to-Number
Conversion Group
FUN Out:=HexStringToNum_**(In);
"**" must be an integer data
type.
Variables
Name Meaning I/O Description Valid range Unit Default
In Hexadecimal
text string
Input Hexadecimal text string Depends on data type.
--- ''
Out Integer Output Integer 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 OKOKOKOKOKOKOKOK
Function
(@)HexStringToNum_**
EN ENO
In Out
"**" must be an integer data type.
def:=HexStringToNum_INT(abc);
LD ST
def
abc
HexStringToNum_INT
EN ENO
In
In = abc
8 0
In = abc
− 8 0
In = abc
Out = def =
−128
Out = def = −15
− 0 0 0 0 0 0 F
Out = def = 128