2 Instruction Descriptions
2-216
NJ-series Instructions Reference Manual (W502)
The following table shows the valid ranges for In and Out according to their data types.
• To convert a specific BCD bit string to an integer, use a **_BCD_TO_*** instruction (page 2-212).
• To convert a BCD bit string to an integer, use a BCD_TO_** instruction (page 2-218).
• Always use the correct instruction name for the data types of In and Out.
• If the data size of Out is larger than the data size of In, the upper digits of Out will contain 0.
• An error occurs in the following case. ENO will be FALSE, and Out will not change.
Data type
of In
Data type
of Out
Valid range for In Valid range for Out
USINT
BYTE 0 to 99 16#00 to 16#99 (BCD)
WORD
0 to 255
16#0000 to 16#0255 (BCD)
DWORD 16#0000_0000 to 16#000_0255 (BCD)
LWORD 16#0000_0000_0000_0000 to
16#0000_0000_0000_0255 (BCD)
UINT
BYTE 0 to 99 16#00 to 16#99 (BCD)
WORD 0 to 9999 16#0000 to 16#9999 (BCD)
DWORD
0 to 65535
16#0000_0000 to 16#0006_5535 (BCD)
LWORD 16#0000_0000_0000_0000 to
16#0000_0000_0006_5535 (BCD)
UDINT
BYTE 0 to 99 16#00 to 16#99 (BCD)
WORD 0 to 9999 16#0000 to 16#9999 (BCD)
DWORD 0 to 99999999 16#0000_0000 to 16#9999_9999 (BCD)
LWORD
0 to 4294967295
16#0000_0000_0000_0000 to
16#0000_0042_9496_7295 (BCD)
ULINT
BYTE 0 to 99 16#00 to 16#99 (BCD)
WORD 0 to 9999 16#0000 to 16#9999 (BCD)
DWORD 0 to 99999999 16#0000_0000 to 16#9999_9999 (BCD)
LWORD
0 to 9999999999999999
16#0000_0000_0000_0000 to
16#9999_9999_9999_9999 (BCD)
SINT
BYTE 0 to 99 16#00 to 16#99 (BCD)
WORD
0 to 127
16#0000 to 16#0127 (BCD)
DWORD 16#0000_0000 to 16#0000_0127 (BCD)
LWORD 16#0000_0000_0000_0000 to
16#0000_0000_0000_0127 (BCD)
INT
BYTE 0 to 99 16#00 to 16#99 (BCD)
WORD 0 to 9999 16#0000 to 16#9999 (BCD)
DWORD
0 to 32767
16#0000_0000 to 16#0003_2767 (BCD)
LWORD 16#0000_0000_0000_0000 to
16#0000_0000_0003_2767 (BCD)
DINT
BYTE 0 to 99 16#00 to 16#99 (BCD)
WORD 0 to 9999 16#0000 to 16#9999 (BCD)
DWORD 0 to 99999999 16#0000_0000 to 16#9999_9999 (BCD)
LWORD
0 to 2147483647
16#0000_0000_0000_0000 to
16#0000_0021_4748_3647 (BCD)
LINT
BYTE 0 to 99 16#00 to 16#99 (BCD)
WORD 0 to 9999 16#0000 to 16#9999 (BCD)
DWORD 0 to 99999999 16#0000_0000 to 16#9999_9999 (BCD)
LWORD
0 to 9999999999999999
16#0000_0000_0000_0000 to
16#9999_9999_9999_9999 (BCD)
Additional Information
Precautions for Correct Use