Plc programming – Lenze ETC Motion Control User Manual

Page 403

Advertising
background image

PLC programming

Library

CANopen functions

8

8.8

8.8.5

l

403

EDSTCXN EN 2.0

8.8.5.6

CopWriteObject (ETCxC and ETCxM at CAN1), DrvWriteObject (ETCxC at CAN2)

FUNCTION CopWriteObject: BOOL

(ETCxC and ETCxM at CAN1)

(* Description 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 DrvWriteObject: BOOL

(ETCxC at CAN2)

(* Description 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 device

ObjectNum

Number of the object to be written

SubIndex

Index of the subobject to be written

DataType

Data type according to CiA DS301

Buffer

Address of the buffer in which the data to be written are stored

BufSize

Number of bytes to be written

Status

Address of a variable for filing the transfer status

This function allows the PLC to write to individual objects of CANopen
devices. The writing 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

Advertising