1 basic data types, 1 unsigned integer, 2 signed integer – BECKHOFF AX2000 CANopen communication profile User Manual

Page 17: 2 mixed data types, Basic data types, Mixed data types, Unsigned integer, Signed integer, Canopen communication profile

Advertising
background image

3.3.1

Basic data types

3.3.1.1

Unsigned Integer

Data in the basic data type UNSIGNEDn define exclusively positive integers.
The value range is from 0 ... 2

n

-1. The bit sequence b = b

0

... b

n-1

defines the value

UNSIGNEDn(b) = b

n-1

2

n-1

+ ... + b

1

2

1

+ b

0

2

0

Example: the value 266 = 10A

h

is transmitted in the data type UNSIGNED16, in the form of two

octets (1

st

octet = 0A

h

, 2

nd

octet = 01

h

).

Transmission syntax for the data type UNSIGNEDn

Octet number

1.

2.

3.

4.

5.

6.

7.

8.

UNSIGNED8

b

7

..b

0

UNSIGNED16

b

7

..b

0

b

15

..b

8

UNSIGNED24

b

7

..b

0

b

15

..b

8

b

23

..b

16

UNSIGNED32

b

7

..b

0

b

15

..b

8

b

23

..b

16

b

31

..b

24

UNSIGNED40

b

7

..b

0

b

15

..b

8

b

23

..b

16

b

31

..b

24

b

39

..b

32

UNSIGNED48

b

7

..b

0

b

15

..b

8

b

23

..b

16

b

31

..b

24

b

39

..b

32

b

47

..b

40

UNSIGNED56

b

7

..b

0

b

15

..b

8

b

23

..b

16

b

31

..b

24

b

39

..b

32

b

47

..b

40

b

55

..b

48

UNSIGNED64

b

7

..b

0

b

15

..b

8

b

23

..b

16

b

31

..b

24

b

39

..b

32

b

47

..b

40

b

55

..b

48

b

63

..b

56

3.3.1.2

Signed Integer

Data in the basic data type INTEGERn define both positive and negative integers.
The value range is from -2

n-1

-1 ... 2

n-1

-1. The bit sequence b = b

0

..b

n-1

defines the value

INTEGERn(b) = b

n-2

2

n-2

+ ... + b

1

2

1

+ b

0

2

0

with b

n-1

= 0

Negative numbers are represented as 2’s complement, which means:

INTEGERn(b) = - INTEGERn(b) - 1 with b

n-1

= 1

Example: the value -266 = FEF6

h

is transmitted in the data type INTEGER16, in the form of two

octets (1

st

octet = F6

h

, 2

nd

octet = FE

h

).

Transmission syntax for the data type INTEGERn

Octet number

1.

2.

3.

4.

5.

6.

7.

8.

INTEGER8

b

7

..b

0

INTEGER16

b

7

..b

0

b

15

..b

8

INTEGER24

b

7

..b

0

b

15

..b

8

b

23

..b

16

INTEGER32

b

7

..b

0

b

15

..b

8

b

23

..b

16

b

31

..b

24

INTEGER40

b

7

..b

0

b

15

..b

8

b

23

..b

16

b

31

..b

24

b

39

..b

32

INTEGER48

b

7

..b

0

b

15

..b

8

b

23

..b

16

b

31

..b

24

b

39

..b

32

b

47

..b

40

INTEGER56

b

7

..b

0

b

15

..b

8

b

23

..b

16

b

31

..b

24

b

39

..b

32

b

47

..b

40

b

55

..b

48

INTEGER64

b

7

..b

0

b

15

..b

8

b

23

..b

16

b

31

..b

24

b

39

..b

32

b

47

..b

40

b

55

..b

48

b

63

..b

56

3.3.2

Mixed data types

Mixed data types combine basic data types (INTEGERn, UNSIGNEDn, REAL). Two types of mixed
data are distinguished:

l

STRUCT
This data type is composed of elements with different data types.

l

ARRAY
This data type is composed of elements of the same data type.

CANopen for AX2000/2500

17

BECKHOFF

07/2007

CANopen communication profile

Advertising