2-255
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Data Type Conversion Instructions
2
**_TO_STRING (Bit String-to-Text String Conversion Group)
**_TO_STRING (Bit String-to-Text
String Conversion Group)
These instructions convert bit strings to text strings.
* The valid range depends on the data type of In. Refer to Function for details.
These instructions convert a bit string, In, to a text string. The hexadecimal number given in In is output
to conversion result Out as a text string. The #16 prefix of the hexadecimal number is not output to Out.
A NULL character (16#00) is placed at the end of Out.
The text in Out is left-aligned. If the value in In requires fewer digits than provided by the data type of In,
the upper digits of Out will contain 0. In other words, the unused digits are padded with zeros. The num-
ber of bytes in Out (including the NULL character) will always be one greater than twice the number of
bytes in In.
The name of the instruction is determined by the data type of In. For example, if In is the WORD data
type, the instruction is WORD_TO_STRING.
Instruction Name FB/FUN Graphic expression ST expression
**_TO_STRING Bit String-to-Text
String Conversion
Group
FUN Out:=**_TO_STRING(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 Depends on data type.
--- 0
Out Conver-
sion result
Output Conversion result *
--- ---
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 OK OK OK
Out OK
Function
"**" must be a bit string data type.
(@)**_TO_STRING
EN ENO
In Out