beautypg.com

Plc programming – Lenze ETC Motion Control User Manual

Page 399

background image

PLC programming

Library

CANopen functions

8

8.8

8.8.5

l

399

EDSTCXN EN 2.0

Type is a lower−case letter describing the size of the data type as follows:

Type

Codesys data type

Size

B

BYTE

8 Bit

W

BOOL, WORD, INT

16 Bit

D

DWORD, DINT, REAL

32 Bit

The return value is TRUE if the function has been executed successfully.
Otherwise the function could not be executed, e.g. due to lack of memory.

)

Note!

The database should only be as large as required by the data
actually used.

The PLC should always only update the data in the global database which are
actually being displayed to prevent an unnecessary increase of the bus load
on the CAN Bus. Cyclical changes during each PLC cycle should generally be
avoided.

TYPE DATABASE_TR :

STRUCT

dummy_dw

: DWORD;

pad1_dw

: DWORD;

pad2_b

: BYTE;

pad3_b

: BYTE;

pad4_w

: WORD;

END_STRUCT

END_TYPE

data_st

: DATABASE_TR;

COPDEFINEDS403( 127, ADR(data_st), SIZEOF(data_st), ’2d2b1w’, 16#6700, 16#8100 );

The function defines a global database with the elements defined by the
descriptor string for a CANopen control element with the node number 127,
which has been inserted accordingly into the control configuration of
CoDeSys.

Example