Comparing ControlLogix AOI and Subroutine Parameters: Which is Better for Programming?

Question:

Incorporating AOI instructions as true subroutines has revolutionized my programming methods over the past couple of years. Prior to this, I primarily used subroutines solely for code organization without passing parameters. With the introduction of AOIs, I embraced them as subroutines due to their ability to keep local variables separate from the tag database and streamline logic editing in one location. Despite initially struggling to achieve the same efficiency with subroutine parameters, I stuck to using them solely for code organization. Rockwell has recently enhanced subroutines by introducing parameters, claiming to offer improved functionality. While AOIs have been my go-to for modular programming, the inability to edit them online poses a limitation. I seek advice from individuals familiar with both AOIs and subroutines with parameters to compare their capabilities. If subroutines can match AOIs in functionality and allow for online editing, I may consider transitioning away from AOIs for all my programming needs.

Top Replies

In my personal opinion, I believe that AOIs should be reserved for logic that is frequently used and needs to be replicated. Anything else should be treated as a subroutine or a separate program. My AOIs mainly focus on device-level components such as Valves, Motors, Analog Transmitters, and Analog Control Valves. Some of the AOIs I have developed are designed for complex mathematical operations. By using AOIs, I can ensure that my logic is reliable and can easily be updated to include new functionalities. It is important to keep non-AOI logic separate to allow for easier maintenance and editing by engineers and maintenance staff. In my experience working with large systems, I find it risky to encapsulate logic in an AOI if it cannot be modified online. For cases where there is only a single instance of a function call, I do not see the benefit of creating unique code and packaging it into an AOI. I am unable to provide feedback on the parameter features at this time.

I am seeking a comparison between the new subroutine features, including parameters, and the functionality of an AOI. Are there specific tasks that one is capable of performing that the other cannot? On the surface, it seems that the enhanced capabilities of subroutines may rival those of AOIs, especially if they enable complete online logic editing. Have you had experience with both and can provide a detailed comparison?

Passing parameters to subroutines has been a common practice for some time now. However, one key advantage of using an Add-On Instruction (AOI) instead is that each instance of the AOI can be monitored individually as it is instantiated. This can be more challenging to achieve with a subroutine that is called multiple times. It is important to note that utilizing an AOI or subroutine with parameters allows for more relatable code, as suggested by Paullu. Using an AOI for unique code may not be as effective in achieving its intended purpose. Despite this, it is worth mentioning that a subroutine can still be edited online.

Version 24 introduces a new way of passing parameters in routines, which simplifies coding processes related to valves. Previously, coding for a single valve would involve handling functions such as opening, closing, and alarms individually. By using jsr to pass parameters into subroutines for each valve, and receiving returned parameters, coding was efficient but troubleshooting could be challenging. However, with the latest version, there is a more streamlined approach to parameter passing. Now, you can write code for specific areas or stations in a machine, utilizing local, global, and private tags for effective communication between routines. This method is particularly useful when dealing with multiple tanks each equipped with various components like level sensors, valves, and pumps. By creating code for one tank and replicating it for others while adjusting the connections accordingly, modifications can be made to individual tanks without impacting the rest. Despite these advancements, the use of the valve Aoi is still relevant in this updated system. For further clarification, a link to a site with more detailed explanations will be sought.

For those seeking a comparison of Subroutines and Add-On Instructions in Logix5000 Controllers, refer to pages 48 and 49 of the Design Considerations manual (1756-rm094_-en-p.pdf). Additional details can be found in TN 50182 on the differences between Subroutines and Add-On Instructions, accessible through TechConnect. Furthermore, TN 41744 provides guidance on online editing for Add-On Instructions in RSLogix 5000, including instructions on how to edit an AOI using Partial Import Online.

I've also been working with AOIs and Rockwell's enhanced subroutines and I believe the choice depends a lot on your specific needs. Enhanced subroutines with parameters certainly offer more flexibility in terms of online editing, which can be a game-changer in certain environments. However, AOIs keep variables localized which can make debugging easier and logic more readable if you’re working with complex systems. Although my personal tendency leans more towards using enhanced subroutines lately for their adaptability, the ultimate decision really depends on your project's complexity as well as your comfort with potential troubleshooting scenarios.

I totally get where you're coming from! AOIs definitely have their strengths, especially with local variable management, but the recent parameter enhancements in subroutines are game-changers, particularly for projects that require online edits. While AOIs excel in encapsulation and organization, subroutines with parameters can provide the flexibility you need for dynamic changes on the fly. I’ve started experimenting with the new subroutine features, and I've found they can streamline workflows in some cases. It might be worth trying out a hybrid approach—using AOIs for your core processes and subroutines for tasks that need that real-time adaptability. It could save you time and give you the best of both worlds!

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

To add a comment, please sign in or register if you haven't already..   

Frequently Asked Questions (FAQ)

FAQ: 1. What are the benefits of using AOIs (Add-On Instructions) as subroutines in programming?

Answer: - Using AOIs as subroutines allows for keeping local variables separate from the tag database and streamlines logic editing in one location. 2. How do subroutine parameters compare to AOIs in programming efficiency and functionality? - While subroutine parameters have been enhanced by Rockwell for improved functionality, some programmers may still find AOIs more efficient for modular programming.

FAQ: 3. What is the limitation of using AOIs as subroutines in programming?

Answer: - One limitation of using AOIs as subroutines is the inability to edit them online, which can pose a challenge when real-time adjustments are needed.

FAQ: 4. Should I consider transitioning from using AOIs to subroutine parameters for all my programming needs?

Answer: - The decision to transition from using AOIs to subroutine parameters depends on individual programming preferences and the specific requirements of each project. It is advisable to weigh the benefits and limitations of each method before making a decision.

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  â†’