beautypg.com

Plc programming – Lenze ETC Motion Control User Manual

Page 401

background image

PLC programming

Library

CANopen functions

8

8.8

8.8.5

l

401

EDSTCXN EN 2.0

8.8.5.4

CopReadObjekt (ETCxC and ETCxM at CAN1), DrvReadObject (ETCxC at CAN2)

FUNCTION CopReadObject: BOOL

(ETCxC and ETCxM at CAN1)

(* Read−out of objects in the object directory of CANopen devices at CAN1 *)

VAR_INPUT

NodeID

: BYTE;

ObjectNum

: WORD;

SubIndex

: BYTE;

DataType

: WORD;

Buffer

: DINT;

BufSize

: WORD;

Status

: POINTER TO BYTE;

END_VAR

FUNCTION DrvReadObject: BOOL

(ETCxC at CAN2)

(* Read−out of objects in the object directory of CANopen devices at CAN2 *)

VAR_INPUT

NodeID

: BYTE;

ObjectNum

: WORD;

SubIndex

: BYTE;

DataType

: WORD;

Buffer

: DINT;

BufSize

: WORD;

Status

: POINTER TO BYTE;

END_VAR

NodeID

Node number of the CANopen node

ObjectNum

Number of the object to be read

SubIndex

Index of the subobject to be read

DataType

Data type according to CiA DS301

Buffer

Address of the buffer in which the read data are stored

BufSize

Size of the buffer in Byte

Status

Address of a variable for filing the transfer status

This function allows the PLC to read individual objects of CANopen devices.
The reading process takes place in the background whilst the PLC continues
working. The transfer queue can buffer up to 15 read/write requests.

By requesting the transfer status the PLC can check whether the transfer is
still ongoing, has finished or whether an error has occurred during transfer.
If several transfer requests are to be carried out in parallel, a separate status
variable needs to be defined for each request.

Declaration

Parameters

Description