Receiving SDO data in the PLC

SDO data that are unknown to the CANopen part of the software and cannot be processed automatically are transferred to the PLC, where they are evaluated and answered via ADS notification.

To this end the ADS port must be enabled in the System Manager under CAN device.

Receiving SDO data in the PLC 1:
Enabling of an ADS port for a CANopen slave.

SDO Read request

Data to be read must be received with ADSREADIND and answered with ADSREADRES.

Input parameter ADSREADIND

Description

NETID

NetID of the CAN interface

Port number

0x1000hex + Node number

IDXGRP

16#8000_0000 + SDO Index (IDXGRP.31 = ADS-Notification)

IDXOFFS

SDO Subindex

LEN

not required for reading

You now have to respond to the ADS indication with an ADS Read response.

Input parameter ADSREADRES

Description

NETID

NetID of the CAN interface

Port number

0x1000hex + Node number

INVOKEID

INVOKEID of the ADSREADIND function block

RESULT

Error <> 0, error-free = 0

LEN

Length of the data

SDO Write request

Data to be written must be received with ADSWRITEIND and answered with ADSWRITERES.

Output parameter ADSWRITEIND

Description

NETID

NetID of the CAN interface

Port number

0x1000hex + Node number

IDXGRP

16#8000_0000 + SDO Index (IDXGRP.31 = ADS Notification)

IDXOFFS

SDO Subindex

LEN

Number of received data in bytes

You now have to respond to the ADS indication with an ADS Write Response.

Input parameter ADSWRITERES

Description

NETID

NetID of the CAN interface

Port number

0x1000hex + Node number

INVOKEID

INVOKEID of the ADSWRITEIND function block

RESULT

Error <> 0, error-free = 0