2 Standard Functions
2 - 38
NX-series Safety Control Unit Instructions Reference Manual (Z931)
INT_TO_WORD
This function converts an INT variable to a WORD variable.
If you omit an input or output parameter, a building error will occur.
This function converts INT data In to WORD data Out.
Example When Value of In Is Positive (INT#0 to INT#32767)
• The value of Out is WORD#16#0000 to WORD#16#7FFF according to the value of In (INT#0 to
INT#32767).
Example When Value of In Is Negative (INT#−32768 to INT#−1)
• If the value of In is INT#−32768 (1000 0000 0000 0000 binary), the value of Out is
WORD#16#8000.
• If the value of In is INT#−1 (1111 1111 1111 1111 binary), the value of Out is WORD#16#FFFF.
To convert WORD data to INT data, refer to WORD_TO_INT.
Instruction Name FB/FUN Graphic expression
INT_TO_WORD Convert INT to
WORD
FUN
Variables
Name I/O Description Valid range Default
In Data to con-
vert
Input Data to con-
vert
INT#−32768 to 32767 INT#0
Out Conversion
result
Output Conversion
result
WORD#16#0000 to FFFF WORD#16#0000
Boolean Bit strings Integers Durations
BOOL
SAFEBOOL
BYTE
SAFEBYTE
WORD
SAFEWORD
DWORD
SAFEDWORD
INT
SAFEINT
DINT
SAFEDINT
TIME
SAFETIME
In OK OK
Out OK OK
Function
Additional Information