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 (CX8051).

Receiving SDO data in the PLC 1:

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 sub index

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 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 block

RESULT

error <> 0, error-free = 0