The l_dco_drivecommunication library – Lenze PLC Designer R3-x User Manual

Page 108

Advertising
background image

The L_DCO_DriveCommunication library

Function blocks

108

Lenze · Commissioning of Lenze drives · 1.3 EN - 06/2014

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Outputs

[12-1] Program sample for using the L_DCO_TransferDriveParameter FB

dwSizeParameter-Data

DWORD

Size of the array structure to be read containing the codes

xUseIndexAsParam

BOOL

FALSE Selection indices according to CANopen

TRUE Selection indices according to Lenze parameters.

• The value given at wIndex is interpreted as parameter/code

number.

Identifier/data type

Information/possible settings

xDone

BOOL

TRUE: Read request completed

xBusy

BOOL

Status output "Read request sent"

TRUE The read request has been transmitted to the system. The FB waits

for the response of the request.

FALSE No read request active

xError

BOOL

Error status output

TRUE During the processing an error has occurred

FALSE No error

eError

L_DCO_Error

Error number

dwData

DWORD

Read parameter value

wIndexCounter

WORD

After the read and write requests have been processed, the number of requests is

indicated here.

• In the event of an error, the number of the request that has caused the write or

read error is indicated here.

PROGRAM Demo

VAR

L_DCO_TransferDriveParameter1 : L_DCO_TransferDriveParameter;

scTransferData : ARRAY[1..5] OF L_DCO_TranferData

:= [

(wIndex := 11, bySubIndex := 0, dwData := 0, byNrOfByte := 4, xEnable := TRUE,
xWriteAccess:= FALSE ),

(wIndex := 11, bySubIndex := 0, dwData := 0, byNrOfByte := 4, xEnable := TRUE,
xWriteAccess:= FALSE ),

(wIndex := 11, bySubIndex := 0, dwData := 0, byNrOfByte := 4, xEnable := TRUE,
xWriteAccess:= FALSE ),

(wIndex := 11, bySubIndex := 0, dwData := 0, byNrOfByte := 4, xEnable := TRUE,
xWriteAccess:= FALSE ),

(wIndex := 11, bySubIndex := 0, dwData := 0, byNrOfByte := 4, xEnable := TRUE,
xWriteAccess:= FALSE ) ];

END_VAR

...

// Instance call

L_DCO_TransferDriveParameter1.pscParameterData := ADR(scTransferData);

L_DCO_TransferDriveParameter1.dwSizeParameterData := SIZEOF(scTransferData);

L_DCO_TransferDriveParameter1(Axis:=LC_Drive_94HL);

Identifier/data type

Information/possible settings

Advertising