Ny-Series Instructions Reference Manual (W560 - Omron NY532-5400 Reference Manual

Ny-series
Hide thumbs Also See for NY532-5400:
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 Out
depends on the BCD format number. The data format examples shown below use WORD data for Out.
Format = _BCD0
Valid range of Out: −999 to 999 (BCD)
15
1211
8 7
Out
Sign bit
0: Positive
1: Negative
Format = _BCD2
Valid range of Out: −999 to 9999 (BCD)
15
1211
8 7
Out
#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.
SINT
−9 to 9
BYTE
Data
INT
type of
−999 to 999
In
WORD
DINT
Data
−9999999 to 9999999
type of
DWORD
Out
LINT
−999999999999999 to
999999999999999
LWORD
The following example shows the BinToBCDs_WORD instruction when In is INT#−3452 and Format is
_BCD1.
LD
INT#-3452
_BCD1
INT data
INT#-3452
In
2-254
4 3
0
Out
3 BCD digits (12 bits)
4 3
0
Out
3 BCD digits (12 bits)
_BCD0
_BCD1
−79 to 79
−7999 to 7999
−79999999 to
79999999
−7999999999999999 to
7999999999999999
ST
BinToBCDs_WORD
EN
ENO
abc
In
Format
WORD BCD data
2#1011_0100_0101_0010
Out=abc
Format = _BCD1
Valid range of Out: −7999 to 7999 (BCD)
15
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
Format = _BCD3
Valid range of Out: −1999 to 9999 (BCD)
15
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
abc:=BinToBCDs_WORD(INT#-3452,_BCD1);

NY-series Instructions Reference Manual (W560)

_BCD3
−19 to 99
−1999 to 9999
−19999999 to
99999999
−1999999999999999 to
9999999999999999

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents