Omron SYSMAC C200HS Operation Manual page 41

Programmable controllers
Hide thumbs Also See for SYSMAC C200HS:
Table of Contents

Advertisement

Data Area Structure
Converting Decimal to
Signed Binary
Bit number
15
14
Contents
0
Bit number
15
14
Contents
1
Bit number
15
14
Contents
1
30
The following table shows the corresponding decimal, 16-bit hexadecimal, and
32-bit hexadecimal values.
Decimal
2147483647
2147483646
32768
32767
32766
–32767
–32768
–32769
–2147483647
–2147483648
Positive signed binary data is identical to unsigned binary data (up to 32,767)
and can be converted using BIN(100). The following procedure converts nega-
tive decimal values between –32,768 and –1 to signed binary. In this example
–12345 is converted to CFC7.
1. First take the absolute value (12345) and convert to unsigned binary:
13
12
11
10
09
0
1
1
0
0
2. Next take the complement:
13
12
11
10
09
1
0
0
1
1
3. Finally add one:
13
12
11
10
09
1
0
0
1
1
Reverse the procedure to convert negative signed binary data to decimal.
16-bit Hex
32-bit Hex
–––
–––
.
.
.
.
.
.
–––
7FFF
7FFE
.
.
.
.
.
.
2
0002
1
0001
0
0000
–1
FFFF
–2
FFFE
.
.
.
.
.
.
8001
8000
–––
.
.
.
.
.
.
–––
–––
08
07
06
05
04
0
0
0
0
1
08
07
06
05
04
1
1
1
1
0
08
07
06
05
04
1
1
1
1
0
Section 3-2
7FFFFFFF
7FFFFFFE
.
.
.
00008000
00007FFF
00007FFE
.
.
.
00000002
00000001
00000000
FFFFFFFF
FFFFFFFE
.
.
.
FFFF8001
FFFF8000
FFFF7FFF
.
.
.
80000001
80000000
03
02
01
00
1
1
0
0
1
03
02
01
00
0
0
1
1
0
03
02
01
00
0
0
1
1
1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents