Note how to handle the Download failed :Not Enough Memory on devices error in Codesys.
Method1:Clearn All
Execute the Build>Clear All command.
Full-Compile the program with Yes.
Method2:Reset Origin Device
If Method 1 does not eliminate the error, use Target>Right Click>Reset Origin Device to reset the device.