SLC 5/04 PLC Code Optimization

H

Thread Starter

H Green

Hi,
I have been asked to optimize the Logix 500 PLC code for a SLC 5/04 32k CPU. The two main problems are scan time and memory usage. I have already run the 'delete unused memory' which releases 177 words. What steps can I take to reduce the scan time and memory usage? i.e. what can I modify to improve performance?

The code has 46 ladder files, 1 PID loop, 128 dig in 64 dig out and 8 analogue in.

Thanks
 
B

bob peterson

I don't think anyone can give you a whole lot of advice on this without knowing seeing the existing program, and knowing what your goals are as far as scan time and memory usage improvement.

I would not think memory would be an issue in a 32k unit with so few I/O.

The number of files is not real significant to memory usage.

A 5/04 is not a blazingly fast PLC, but unless there is something really unusual in the code, or the way it is written, I would expect the scan time to be under 50 mSec.
 
R
One area that takes a lot of scan time if not programmed well is the PID instruction. I have often seen it triggered every other scan. A typical temperature loop needs a scan every second at most and could in many cases be scanned once every 5 seconds without problem.

Check that your program is scanning the PID instruction only as often as needed. Be sure to set the PID Loop Update time correctly in the setup screen if you change the scan rate or the calculations will be incorrect (and everybody loves retuning PID loops!).

Note that this will improve most scans but when the scan includes the PID function, that scan will lengthen. Often, that delay is not significant but it can have some impact under some conditions. YMMV (your mileage may vary).

As far as optimizing the memory usage, the earlier poster is correct; any programmer would need to see the program to provide any significant improvements.

Places to review include unused memory locations inside data files (you may be able to remap them to save memory). The biggest bang for the buck is saving any unused PID words, then timer and counter allocations, then floating point. Each of the above uses more than one 16 bit word. Integer and bit files are 16 bit so they provide the least benefit vs. effort.

Regards,
Russ Kinner
SSOE
Phoenix, AZ
 
Top