L_IPAP_ParameterRead
The L_IPAP_ParameterRead function block serves to read the device and PLC parameters of the Lenze Controller by the PLC application.
|
L_IPAP_ParameterRead |
|||||||
|---|---|---|---|---|---|---|---|
|
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 |
udiDataRead |
- |
UDINT |
||
|
UDINT |
- |
udiBufferSize |
eDataType |
- |
L_IPAP_DATATYPE |
||
Inputs
Outputs
Application examples
Read parameter 0x2001:000 “Device name” (data type: STRING)
PROGRAM PLC_PRG
VAR
-
fbParameterRead : L_IPAP_ParameterRead;
-
read : BOOL;
-
index : WORD;
-
subindex : BYTE;
-
abyDeviceName : ARRAY [0..127] OF BYTE;
END_VAR
(* read device name *)
// index can be set as hexadecimal- or as decimal value
index := 16#2001; //or: index := 8193
subindex := 0;
fbParameterRead(
-
xExecute := read,
-
wIndex := index,
-
bySubIndex := subindex,
-
pDataBuffer := ADR(abyDeviceName),
-
udiBufferSize := SIZEOF(abyDeviceName)
);
Read parameter 0x2452:001 “Active eng. port settings: IP address” (data type: UDINT)
PROGRAM PLC_PRG
VAR
-
fbParameterRead : L_IPAP_ParameterRead;
-
read : BOOL;
-
udiIPaddr : UDINT;
-
abyIPaddr : ARRAY [0..3] OF BYTE;
END_VAR
(* read IP address to UDINT value*)
fbParameterRead(
-
xExecute := read,
-
wIndex := 16#2452,
-
bySubIndex := 1,
-
pDataBuffer := ADR(udiIPaddr),
-
udiBufferSize := SIZEOF(udiIPaddr));
);
(* or read IP address to array of 4 BYTES*)
fbParameterRead( xExecute := read,
-
wIndex := 16#2452,
-
bySubIndex := 1,
-
pDataBuffer := ADR(abyIPaddr),
-
udiBufferSize := SIZEOF(abyIPaddr)
);