Nj-Series Instructions Reference Manual (W502 - Omron NJ501-1500 Reference Manual

Machine automation controller nj-series
Hide thumbs Also See for NJ501-1500:
Table of Contents

Advertisement

2 Instruction Descriptions
The data type of data format number Format is enumerated type _eBCD_FORMAT. Select one of the
following: _BCD0, _BCD1, _BCD2, or _BCD3. The sign specification in the upper four bits of In
depends on the BCD format number. The data format examples shown below use WORD data for In.
Format = _BCD0
Valid range of In: −999 to 999 (BCD)
15
1211
8 7
In
Sign bit
0: Positive
1: Negative
Format = _BCD2
Valid range of In: −999 to 9999 (BCD)
15
1211
8 7
In
#0 to #9: BCD digit 4 (positive)
#F: Negative
(#A to #E: error)
The same sizes of data types are used for In and Out. The valid ranges depend on the value of Format,
as shown below.
−9 to 9
BYTE
SINT
Data
−999 to 999
WORD
type of
In
INT
−9999999 to 9999999
DWORD
Data
type of
DINT
Out
−999999999999999 to
LWORD
999999999999999
LINT
The following example is for when In is WORD#2#1011_0100_0101_0010 and Format is _BCD1.
LD
WORD#2#1011_0100_0101_0010
WORD BCD data
In
WORD#2#1011_0100_0101_0010
2-222
Format = _BCD1
Valid range of In: −7999 to 7999 (BCD)
4 3
0
15
In
3 BCD digits (12 bits)
Format = _BCD3
Valid range of In: −1999 to 9999 (BCD)
4 3
0
15
In
3 BCD digits (12 bits)
_BCD0
_BCD1
−79 to 79
−7999 to 7999
−79999999 to
79999999
−7999999999999999 to
7999999999999999
BCDsToBin
EN
In
_BCD1
Format
1211
8 7
4 3
0
3 BCD digits (12 bits)
BCD digit 4 (three bits: 12 to 14)
Sign bit
0: Positive
1: Negative
1211
8 7
4 3
0
3 BCD digits (12 bits)
#0 to #9: BCD digit 4 (positive)
#A: Negative, BCD digit 4 is 1
#F: Negative, BCD digit 4 is 0
(#B to #E: error)
Value of Format
_BCD2
−9 to 99
−999 to 9999
−9999999 to 99999999
−999999999999999 to
9999999999999999
ST
abc:=BCDsToBin(WORD#2#1011_0100_0101_0010,
ENO
abc
INT data
Out=abc
-3452

NJ-series Instructions Reference Manual (W502)

_BCD3
−19 to 99
−1999 to 9999
−19999999 to
99999999
−1999999999999999 to
9999999999999999
_BCD1);

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nj501-1300Nj501-1400

Table of Contents