L_IPAP_ParameterWrite

The L_IPAP_ParameterWrite function block serves to write the device and PLC parameters of the Lenze Controller from the PLC application.

L_IPAP_ParameterWrite

BOOL

-

xExecute

xDone

-

BOOL

BOOL

-

xAbort

xBusy

-

BOOL

WORD

-

wIndex

xAborted

-

BOOL

BYTE

-

bySubIndex

xError

-

BOOL

UDINT

-

udiTimeOut

eErrorId

-

L_IPAP_ERRORID

POINTER TO BYTE

-

pDataBuffer

UDINT

-

udiDataSize

Inputs

Name

Datentyp

Value / meaning

xExecute

BOOL

FALSE ä TRUE

With the rising edge of the xExecute input, the write request of a parameter is started.

xAbort

BOOL

FALSE ä TRUE

Abort processing of the FB

wIndex

WORD

Index of the parameter to be write

bySubIndex

BYTE

Subindex in the object dictionary of the master or the slave

udiTimeOut

UDINT

Timeout in milliseconds [ms]

  • The value '0' corresponds to a request without timeout.

pDataBuffer

POINTER TO BYTE

Reference to the memory buffer into which the values to be written are to be taken.

udiDataSize

UDINT

Number of the bytes to be written

Outputs

Name

Datentyp

Value / meaning

xDone

BOOL

TRUE

Processing is completed

xBusy

BOOL

TRUE

Processing is running

xAborted

BOOL

TRUE

Processing of the FB has been aborted.

xError

BOOL

TRUE

An error has occurred. For details see eErrorID .

eErrorId

L_IPAP_ERRORID

If xError = TRUE: Error number for the error that has occurred.

Application examples

Write parameter 0x2001:000 “Device name” (data type: STRING)

PROGRAM PLC_PRG

VAR

  • fbParameterWrite : L_IPAP_ParameterWrite;

  • write            : BOOL;

  • index            : WORD;

  • subIndex         : BYTE;

  • szDeviceName : STRING;

END_VAR

fbParameterWrite(xExecute := write,

  • wIndex := index,

  • bySubIndex := subindex,

  • pDataBuffer := ADR(szDeviceName),

  • udiDataSize := SIZEOF(szDeviceName)

);

Write parameter 0x2451:001 “Engineering port settings: IP address” (data type: UDINT)

PROGRAM PLC_PRG

VAR

  • fbParameterWrite : L_IPAP_ParameterWrite;

  • write : BOOL;

  • udiIPaddr : UDINT;

  • abyIPaddr : ARRAY [0..3] OF BYTE;

END_VAR

(* write IP address setting by UDINT value*)

udiIPaddr := 16#6305A8C0; //-> 192.168.5.99

fbParameterWrite(xExecute := write,

  • wIndex := 16#2451,

  • bySubIndex := 1,

  • pDataBuffer := ADR(udiIPaddr),

  • udiDataSize := SIZEOF(udiIPaddr)

);

(* or write IP address setting with array of 4 BYTES*)

abyIPaddr[0]:= 192;

abyIPaddr[1]:= 168;

abyIPaddr[2]:= 5;

abyIPaddr[3]:= 99;

fbParameterWrite(

  • xExecute := write,

  • wIndex := 16#2451,

  • bySubIndex := 1,

  • pDataBuffer := ADR(abyIPaddr),

  • udiDataSize := SIZEOF(abyIPaddr)

);