2 Standard Functions
2 - 18
NX-series Safety Control Unit Instructions Reference Manual (Z931)
WORD_TO_INT
This function converts a WORD variable to an INT variable.
If you omit an input or output parameter, a building error will occur.
This function converts WORD data In to INT data Out.
Example When Value of Out Is Positive (INT#0 to INT#32767)
• The value of Out is INT#0 to INT#32767 according to the value of In (WORD#16#0000 to
WORD#16#7FFF).
Example When Value of Out Is Negative (INT#−32768 to INT#−1)
• If the value of In is WORD#16#8000 (1000 0000 0000 0000 binary), the value of Out is INT#32768,
which is INT#−32768 as a 2-byte expression.
• If the value of In is WORD#16#FFFF (1111 1111 1111 1111 binary), the value of Out is INT#65535,
which is INT#−1 as a 2-byte expression.
To convert INT data to WORD data, refer to INT_TO_WORD.
Instruction Name FB/FUN Graphic expression
WORD_TO_INT Convert WORD
to INT
FUN
Variables
Name I/O Description Valid range Default
In Data to con-
vert
Input Data to con-
vert
WORD#16#0000 to FFFF WORD#16#0000
Out Conversion
result
Output Conversion
result
INT#−32768 to 32767 INT#0
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