Omron SYSMAC CJ - REFERENCE MANUAL 01-2008 Reference Manual page 558

Sysmac cs/cj/one nsj series programmable controllers
Table of Contents

Advertisement

Conversion Instructions
Description
Area
Index Registers
Indirect addressing
using Index Registers
BINS(470) converts signed BCD data to signed binary data. First the signed
BCD data format and range in word S are checked against the setting in the
control word (C). If the source data is correct, the signed BCD data in S is
converted to signed binary and output to D. If the source data is incorrect, the
Error Flag will be turned ON and the instruction will not be executed.
When the converted data is negative, it will be output as the 2's complement
and the Negative Flag be will turned ON. NEG(160) can be used to determine
the absolute value of a negative signed binary number. Refer to 3-12-52'S
COMPLEMENT: NEG(160) for details.
A value of –0 in the source data will be treated as 0 and will not cause an
error. Also, the status of bits 13 to 15 of S is not checked when C=0000.
Note Some Special I/O Units output signed BCD data. Calculations using this data
will normally be easier if it is first converted to signed binary data with
BINS(470).
The control word specifies the signed BCD format as shown below.
C = 0000 (Input Data Range: –999 to 999 BCD)
C = 0001 (Input Data Range: –7999 to 7999 BCD)
C = 0002 (Input Data Range: –999 to 9999 BCD)
C
---
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
Signed BCD format
specified in C
Signed binary
Signed BCD
3 digits BCD, 12 bits
Sign bit (0: Positive; 1: Negative)
Status of 3 bits: 0
3 digits BCD, 12 bits
3 bits of digit 4 (0 to 7)
Sign bit (0: Positive; 1: Negative)
3 digits BCD, 12 bits
0 to 9: Fourth digit BCD
F: Negative (−)
A to E: Error
Section 3-12
S
D
519

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents