7programming with the »plc designer – Lenze c300 User Manual
Page 63
7
Programming with the »PLC Designer«
7.4
Controller c300/p300: Access to odd Controller addresses
63
Lenze · Controller | Parameter setting & programming · Reference Manual · DMS 1.5 EN · 04/2014 · TD17
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2. In the case of many functions/function blocks, a pointer is transferred to a byte array and then
the content of the byte array is for instance interpreted as DWORD. This requires manual
conversion before the data are used:
General information about the use of pointers can be found in the "Pointer" section.
PROGRAM PLC_PRG
PROGRAM PRG_Logic
VAR
mySDO_READ : CIA405.SDO_READ4;
aReadData : ARRAY [1..4] OF BYTE;
dwDword : DWORD;
END_VAR
mySDO_READ(NETWORK:= 1,
ENABLE:= TRUE,
TIMEOUT:= 10000,
CONFIRM=>,
ERROR=> ,
DEVICE:= 1001,
CHANNEL:= 1,
INDEX:= 16#5FE7,
SUBINDEX:= 0,
DATA=> aReadData,
DATALENGTH=>,
ERRORINFO=>);
// Manually create a DWORD from a Byte array
dwDword := aReadData[1]
+ 256 * aReadData[2]
+ 65536 * aReadData[3]
+ 16777216 * aReadData[4];