Материал: m083700e

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам

 

 

CANopen • 131

 

 

Network Communication

 

 

 

d:

data

e = 0, s = 0: d is reserved for further use of CiA

 

 

e = 0, s = 1: d contains the number of bytes for

 

 

download

 

 

Byte 4 contains the LSB and Byte 7 contains the

 

 

MSB.

 

 

e = 1: d contains the data

X:

 

Not used, always 0

reserved:

 

Reserved for further use of CiA

5.3.1.2.1.3.2Upload SDO Segment

This protocol is used if more than 4 data is transmitted, i.e. this follows after fully processing the „Initiate Upload Protocol" which initiates the data transmissions.

 

Upload SDO Segment

Client

Server

 

0

 

 

1

8

 

 

 

request

 

 

 

 

 

 

 

 

 

indication

 

.7 .6 .5

.4

.3

.2 .1 .0

 

 

 

 

 

 

 

 

 

 

 

 

 

ccs = 3

t

 

x

 

reserved

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Upload SDO Segment

Client

Server

 

 

0

 

 

 

1

8

 

 

 

confirm

 

 

 

 

 

 

 

 

 

 

 

response

 

.7 .6 .5

.4

.3

.2

.1

.0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

scs = 0

t

 

x

 

c

 

Segment data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Fig. 5-11: Upload SDO Segment

g012411x

ccs:

Client command specifier

3: download segment request

scs:

Server command specifier

0: download segment response

t:

Toggle bit

This bit has to change for each segment for

 

 

which an upload is made. The toggle bit has to

 

 

be zeroed for the first segment. The toggle bit is

 

 

identical both for the enquiry and the reply.

c:

Indicates whether further

0: there are more segments to be uploaded

 

segments are present for the

 

 

upload

 

1:there are no more segments for uploading

WAGO-I/O-SYSTEM 750

CANopen

132 • CANopen

Network Communication

seg-data: Contains the data to be transmitted.

n:

The meaning of the data is determined by the application.

Displays the number of bytes which do not contain data. Bytes [8-n, 7] do not contained data. N is 0 if no segment size is displayed.

X:

Not used, always 0

reserved:

Reserved for further use of CiA

5.3.1.2.1.4Abort SDO Transfer

This protocol is used in the event of errors occurring during transmission.

 

Abord SDO Transfer

Client

Server

 

0

 

1

4

8

 

 

 

request

 

 

 

 

 

 

 

 

 

 

indication

 

.7 .6 .5

.4 .3 .2

.1 .0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

cs = 4

x

 

 

m

 

Data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Fig. 5-12: Abort SDO Transfer

g012412x

cs:

command specifier

4: abort domain transfer

m:

multiplexor

Index and Sub-Index of Object directory:

X:

 

Not used, always 0

Data

4 Byte Error Code

Application specific data about the reasons for

 

 

the abort.

Supported Abort Domain Transfer Messages

Structure:

 

Byte

 

 

Meaning

 

 

0

 

Command Specifier; 0x80

 

 

1

 

 

Index

 

 

2

 

 

 

 

 

 

 

 

 

3

 

 

SubIdx

 

 

4

 

 

Additional Code

 

 

5

 

 

 

 

 

 

 

 

6Error Code

7Error Class

WAGO-I/O-SYSTEM 750

CANopen

CANopen • 133

Network Communication

Via Additional Code, Error Code and Error Class the following Errors are coded as UNSIGNED32:

Byte 4

5

Byte 6

Byte 7

 

 

 

Additional

Error

Error

 

Meaning

 

Code

 

Code

Class

 

 

 

05

03

00

00

Toggle bit not alternated

05

04

00

00

SDO protocol timed out

05

04

00

01

Client/server command specifier not valid or unknown

05

04

00

02

Invalid block size (block mode only)

05

04

00

03

Invalid sequence number (block mode only)

05

04

00

04

CRC error (block mode only)

05

04

00

05

Out of memory

06

01

00

00

Unsupported access to an object

06

01

00

01

Attempt to read a write only object

06

01

00

02

Attempt to write a read only object

06

02

00

00

Object does not exist in the object dictionary

06

04

00

41

Object cannot be mapped to the PDO

06

04

00

42

The number and length of the objects to be mapped would exceed

 

 

 

 

 

PDO length

06

04

00

43

General parameter incompatibility reason

06

04

00

47

General internal incompatibility in the device

06

06

00

00

Access failed due to an hardware error

06

07

00

10

Data type does not match, length of service parameter does not

 

 

 

 

 

match

06

07

00

12

Data type does not match, length of service parameter too high

06

07

00

13

Data type does not match, length of service parameter too low

06

09

00

11

Sub-index does not exist

06

09

00

30

Value range of parameter exceeded (only for write access)

06

09

00

31

Value of parameter written too high

06

09

00

32

Value of parameter written too low

06

09

00

36

Maximum value is less than minimum value

08

00

00

00

general error

08

00

00

20

Data cannot be transferred or stored to the application

08

00

00

21

Data cannot be transferred or stored to the application because of

 

 

 

 

 

local control

08

00

00

22

Data cannot be transferred or stored to the application because of

 

 

 

 

 

the present device state

08

00

00

23

Object dictionary dynamic generation fails or no object dictionary is

 

 

 

 

 

present (e.g. object dictionary is generated from file and generation

 

 

 

 

 

fails because of an file error)

5.3.1.2.2 SDO Examples

The following are 4 SDO examples, the data is being displayed in hexadecimal. These examples show the handling of SDOs on the CAN message level and can be used if the SDO protocol is to be implemented on a CAN card.

A message is subdivided into 4 columns:

1. column

Direction

M->BC = message is sent by the master to the bus coupler.

 

 

BC->M = message is sent by the bus coupler to the master.

2. column

CAN Identifier

 

3. column

Frame Type

D = Data frame

 

 

R = RTR frame

WAGO-I/O-SYSTEM 750

CANopen

134 • CANopen

Network Communication

4. column Data

Data bytes of the CAN message

 

A maximum of 8 data bytes can be transmitted in a CAN mes-

 

sage. The individual bytes are separated by spaces. Entries

 

having the value XX have no meaning, but must be existing.

 

The values should be zeroed for a better understanding.

 

Entries in the reply from the bus coupler having the value DD

 

contain data, which are dependent on the configuration.

5.3.1.2.2.1Example 1:

Read Index 0x1000 Sub-Index 0; Device Type

Index 0x1000 returns 4 bytes. The expedited transfer mode is used for transmission.

Direction

CAN Id

Frame Type

Data byte 0-7

M->BK

0x601

D

0x40

00 10 00 XX XX XX XX

 

 

 

 

 

BK->M

0x581

D

0x43

00 10 00 91 01 DD 00

 

 

 

 

 

Result:

Data bytes 4 and 5: 91 01 Sequence Low Byte, High Byte rotation: 0x0191 = 401 Device Profile Number

Data bytes 6 and 7: DD 00 Sequence Low Byte, High Byte rotation

5.3.1.2.2.2Example 2:

Read Index 0x1008 Sub-Index 0; Manufacturer Device Name

Index 0x1008 returns more than 4 bytes. The normal transfer mode is used for transmission in which case 2 messages per mode are transmitted.

Direction

CAN Id

Frame Type

Data byte 0-7

 

M->BK

0x601

D

0x40

08 10 00 XX XX XX XX

 

 

 

 

 

 

BK->M

0x581

D

0x41

08 10 00

07 00 00 00

 

 

 

 

M->BK

0x601

D

0x60 XX XX XX XX XX XX XX

 

 

 

 

 

 

BK->M

0x581

D

0x01

37 35 30

2D 33 38 37

 

 

 

 

 

 

Result:

The first reply from the bus coupler informs the master of the number of data to be transmitted (0x00000007 Byte). In the second message, the bus coupler supplies the article number in the ASCII format (hex representation)

„750-837“.

WAGO-I/O-SYSTEM 750

CANopen

CANopen • 135

Network Communication

5.3.1.2.2.3Example 3:

Read Index 0x6000 Sub-Index 1; First 8 bit digital input block

The signals of the digital input modules are saved in index 0x6000. 8 bits each are assigned to a group and can be read as from sub index 1. In this example, the input value of the first 8 bit group is read via an SDO message.

Direction

CAN Id

Frame Type

 

 

M->BK

0x601

D

 

0x40 00 60 01 XX XX XX XX

 

 

 

 

 

BK->M

0x581

D

 

0x4F 00 60 01 02 XX XX XX

 

 

 

 

 

Result:

In the 5th byte of the CAN message, the bus coupler returns the status of the first group of 8 bits. In this case the 2nd bit is set. Bytes 5-7 are without meaning.

5.3.1.2.2.4Example 4:

Write Index 0x6200 Sub-Index 1; First 8 bit digital output block

The output values of the digital output modules are saved in index 0x6100.

8 bits each are assigned to a group and can be read and written as from sub index 1. In this example, the value 0xFF is written into the outputs of the first 8 bit digital output group.

Direction

CAN Id

Frame Type

 

 

M->BK

0x601

D

0x2F 00 62 01 FF XX XX XX

 

 

 

 

 

BK->M

0x581

D

 

0x60 00 62 01 XX XX XX XX

 

 

 

 

 

Result:

The outputs of the first 8 bit digital output modules are set.

5.3.1.3 Synchronization Object - SYNC

These objects allow the synchronization of all network subscribers. Corresponding configuration of the PDOs can initiate the network subscribers to process their input data or to update the outputs upon the arrival of a SYNC object.

In this manner cyclical transmission of a SYNC object ensures that all network subscribers will process their process data simultaneously.

WAGO-I/O-SYSTEM 750

CANopen

Источник: https://studfile.net/preview/16369781/