Data structure tips for Logix controllers

Save memory and optimize performance of Rockwell Automation controllers.


To get maximum performance from a control system, it’s important to think ahead. Logix architecture (ControlLogix, CompactLogix, FlexLogix, SoftLogix5800, and DriveLogix), the following tips can help you save memory and optimize performance of your control system.

Use a 32-bit data type

One of the first factors to consider when designing a control architecture is data organization and performance. If your controller uses a 32-bit processor, performance and memory use are optimized by using 32-bit data types. If you use non-32-bit data types with 32-bit CPUs, each instruction can take up unnecessary memory space, which, multiplied by thousands of instructions, can quickly consume available memory. This is especially crucial to consider for smaller controllers with limited memory.

For example, using double integer (DINT) data types instead of integer (INT) data types helps reduce execution time and memory usage. Executing a simple ADD instruction with INT data types, like INT + INT = INT, takes 260 bytes of memory and 3.49

The reason for this significant difference in memory use and execution time is that the controller converts each INT to a DINT before it adds them together, and then has to convert the sum back to an INT. It takes additional execution time and memory to store the intermediate values created during these additional conversions.

Make the most of user defined structures

User defined structures allow you to combine multiple data types (atomic, predefined or user defined) into a new data type. The way you create user defined structures can greatly influence memory use and performance.

All elements in a structure are located on a byte (8 bit) boundary, and grouping like elements together when creating a user defined structure will help reduce memory use and execution time when accessing data.

Optimize with arrays

The Logix Integrated Architecture uses tag-based programming, and the method used to create tags in the controller directly impacts performance in terms of execution time for accessing data.

Creating individual tags in your program results in the creation of scattered tags in the memory of the controller. The scattered tags must have pointer data associated with them, which requires more time when trying to access the tags. Instead, create tags in arrays or user defined structures in the tag database. This way, tags are created consecutively in the controller’s memory, which means data can be read much faster.

Fred Habenschuss is application engineering manager, field marketing services, for Rockwell Automation. Rockwell Automation’s Integrated Architecture provides one environment for sequential, process, drive, and motion control programming. RSLogix 5000 Enterprise Series software is designed to work with the Rockwell Automation Logix controller platforms. It offers an IEC61131-3 compliant interface, symbolic programming with structures and arrays, and a comprehensive instruction set. It also supports relay ladder, structured text, function block diagram, and sequential function chart editors, and provides support for the S88 equipment phase state model for batch and machine control applications via the PhaseManager optional feature.

No comments
The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by...
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
The Engineering Leaders Under 40 program identifies and gives recognition to young engineers who...
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
Choosing controllers: PLCs, PACs, IPCs, DCS? What's best for your application?; Wireless trends; Design, integration; Manufacturing Day; Product Exclusive
Variable speed drives: Smooth, efficient, electrically quite motion control; Process control upgrades; Mobile intelligence; Product finalists: Vote now; Product Exclusives
Machine design tips: Pneumatic or electric; Software upgrades; Ethernet advantages; Additive manufacturing; Engineering Leaders; Product exclusives: PLC, HMI, IO
This article collection contains the 5 most referenced articles on improving the use of PID.
Learn how Industry 4.0 adds supply chain efficiency, optimizes pricing, improves quality, and more.

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

Cyber security cost-efficient for industrial control systems; Extracting full value from operational data; Managing cyber security risks
Drilling for Big Data: Managing the flow of information; Big data drilldown series: Challenge and opportunity; OT to IT: Creating a circle of improvement; Industry loses best workers, again
Pipeline vulnerabilities? Securing hydrocarbon transit; Predictive analytics hit the mainstream; Dirty pipelines decrease flow, production—pig your line; Ensuring pipeline physical and cyber security