Function library lenzememdrv.lib – Lenze DDS Function library MemDrv User Manual
Page 19

Function library LenzeMemDrv.lib
Functions for RAM memory access
4.3
L_MemCopyToRam
4−5
L
LenzeMemDrv.lib EN 1.1
Return value: Integer
Value
Meaning
0
Copy job has been successfully transferred to the operating system.
−10
Copy job has not been transferred to the operating system since the transfer parameters are faulty:
wLength = 0.
−20
Copy job has not been transferred to the operating system since the transfer parameters are faulty:
pbyData does not point to the PLC memory area.
−30
Copy job has not been transferred to the operating system since the transfer parameters are faulty:
The values for wLength and wOffset do not fit together.
−40
Copy job has not been transferred to the operating system since the copy driver is still processing the previous memory
management function.
−50
Copy job has not been transferred to the operating system since the memory is presently accessed
(e. g. via codes).
−60
Copy job has not been transferred to the operating system since the transfer parameters are faulty:
byRamBlockNr is invalid.
−80
Function is not supported by the operating system.
Example
Calling the function in ST:
(* copy to RAM if last copy action (L_MemCopyToRam) *)
(* is finished *)
nMemState :=
L_MemGetStateDriver(byVoid := 0);
bDriverBusy :=
INT_TO_BOOL(nMemState AND 16#0001);
IF bDriverBusy = FALSE THEN
nReturn :=
L_MemCopyToRam(pbyData := ADR(g_abyDataBuffer),
wLength := 256,
byRamBlockNr := 2,
wOffset := 512);
END_IF
(* check return value of CopyToRam function *)