Plc programming – Lenze ETC Motion Control User Manual

Page 406

Advertising
background image

PLC programming

Library
CANopen functions

8

8.8
8.8.5

l

406

EDSTCXN EN 2.0

8.8.5.9

CopXSetPreoperational (only ETCxM)

FUNCTION CopXSetPreoparational: BOOL

(* Setting the status pre−operational for the
CANopen node *)

VAR_INPUT

CanNum_b

: BYTE;

NodeID_b

: BYTE;

Status_pb

: POINTER TO BYTE;

END_VAR

CanNum_b:

Number of the CAN Bus (1 or 2)

NodeID_b:

Node number of the CANopen device

Status_pb:

Address of a variable for filing the transfer status

This function enables the PLC to set the status of individual CANopen nodes
to pre−operational. A condition for this is that the node has been entered into
the CoDeSys control configuration. The telegrams will be sent in the
background whilst the PLC continues working.

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

The function returns TRUE if the write request has been 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

status_b

: BYTE;

wert_di

: DINT := 1000;

CopXSetPreoperational(1,5, ADR(status_b));

The node with address 5 at the 1st CAN Bus has its status set to
pre−operational.

Declaration

Parameters

Description

Example

Advertising