Plc programming – Lenze ETC Motion Control User Manual

Page 402

Advertising
background image

PLC programming

Library
CANopen functions

8

8.8
8.8.5

l

402

EDSTCXN EN 2.0

The return value is TRUE if the read request could be passed to the transfer
queue, otherwise the transfer queue is already full.

Status

Meaning

0

Inactive

1

Request in transfer queue

2

Transfer active

3

Transfer completed successfully

4

Transfer cancelled

5

Timeout

status_b

devicetype_dw

CopReadObject(1, 16#1000, 0, COP_UNSIGNED32_KW, ADR(devicetype_dw),
SIZEOF(devicetype_dw), ADR(status_b));

8.8.5.5

CopXReadObject (ETCxM at CAN2)

FUNCTION CopXReadObject: BOOL

(* Reading of objects in the object directory of
CANopen devices at CAN2 *)

VAR_INPUT

CanNum_b

: BYTE;

NodeID_b

: BYTE;

ObjectNum_w

: WORD;

SubIndex_b

: BYTE;

DataType_w

: WORD;

Buffer_p

: DINT;

BufSize_w

: WORD;

Status_pb

: POINTER TO BYTE;

END_VAR

CanNum_b:

Number of the CAN Bus (1 or 2)

NodeID_b:

Node number of the CANopen node

ObjectNum_w:

Number of the object to be read

SubIndex_b:

Index of the subobject to be read

DataType_w:

Data type according to CiA DS301

Buffer_p:

Address of the buffer in which the read data are stored

BufSize_w:

Size of the buffer in Byte

Status_pb:

Address of a variable for filing the transfer status

The functionality of this function is completely identical to the function
CopReadObjekt(). It contains an additional parameter CanNum_b, which
defines the number of the respective CAN Bus.

Example

Declaration

Parameters

Description

Advertising